The mobile electrons in a semiconductor, carrying electrical charge under any applied voltage, are the electrons occupying the energy states of conduction band (E > Ec). The counting statistics of conduction band electrons is based on
number of electrons = (number of states) * (probability of occupancy by an electron).
The number of electron energy states per unit volume over the energy interval, E ~ E+dE, is defined as
number of states = g(E)dE.
Here g(E) is called the density of states (DOS).
Then, an energy state at energy E has a definite probability to be occupied by an electron given by
probability of occupancy = f(E).
This probability is the main conclusion of the Fermi-Dirac statistics
and f(E) is called the Fermi distribution function.
Therefore, the number of electrons over the energy interval, E ~ E+dE, is found as
number of electrons over E ~ E+dE = (number of states) * (probability
= g(E)dE * f(E)
Total number of conduction band electrons is found by integrating this:
n = g(E)f(E)dE over E = Ec ~ +infinity.
For holes in the valence band (i.e., the unoccupied states in VB),
number of holes over E ~ E+dE = (number of states) * (probability of
= g(E)dE * [1-f(E)]
And the total number of holes,
p = g(E)[1-f(E)]dE over E = -infinity ~ Ev.
Read the Mathematical Analysis for further details.