Statistics of excitons in quantum dots and their effect on the optical emission spectra of microcavities