1. Instrinsic charge carrier concentration
The concentration of thermally-generated electron-hole pairs varies (lots!) with temperature, and is:
2. Doping
Adding impurities to the crystal from Group III or IV elements (replacing an Si atom with another like B or P) also adds extra electrons or holes to the structure.
Impurities which add extra free electrons are called donors, with concentration $N_D \;\; \mathrm{cm^{-3}}$.
Impurities which add extra (free) holes are acceptors: $N_A \;\; \mathrm{cm^{-3}}$.
Even when doped, a semiconductor crystal has no net charge
This, combined with the fundamental relationship
Allows us to calculate the concentration of free electrons and holes for any doping condition (always choose $+$ version):
or, solved the other way:
Q: Are the above two sets of solutions equivalent?
Q: Does it matter which set to use depending on which of $N_D$ or $N_A$ is larger?
When we dope in practice, the impurities $N_D$ and/or $N_A$ are in the range $10^{14} \text{ to } 10^{21} \; \mathrm{cm^{-3}}$, which is much greater than $n_i$ at normal temperatures. This results in us using the following approximations all the time:
$\rightarrow$ Notice how only the minority carrier concentrations are affected by temperature (holes for n-type doping, electrons for p-type doping).