The DSMC method was applied to perform a numerical study of detonation in an H2/O2 mixture with detailed chemical kinetics at the molecular level. Collision chemistry models were modified to correctly reproduce the chemical equilibrium in mixtures of polyatomic molecules. The DSMC results on homogeneous constant-volume adiabatic autoignition of the stoichiometric H2/O2 mixture are in good agreement with the numerical solution of equations of chemical kinetics. The results of the DSMC modeling of a nonstationary detonation wave for different values of pressure yield the velocity of detonation that coincides with the Chapman-Jouguet velocity. The structure of the detonation wave obtained in the DSMC simulation is in qualitative agreement with the Zeldovich - von Neumann - Doering theory.