A time-explicit formula that describes the time evolution of velocity distribution functions of gases and plasmas is derived from the Boltzmann equation. The formula can be used to construct collision simulation algorithms. Specialization of the formula to the case of the Coulomb interaction shows that the previous method [K. Nanbu, Phys. Rev. E 55, 4642 (1997)] for a Coulomb collision simulation is a solution method of the Landau-Fokker-Planck equation in the limit of a small time step. Also, a collision simulation algorithm for multicomponent plasmas is proposed based on the time-explicit formula derived.