Concept:
In an intrinsic semiconductor,
\[
n_i=p_i,
\]
where
\[
n_i
\]
is the intrinsic electron concentration and
\[
p_i
\]
is the intrinsic hole concentration.
For any semiconductor in thermal equilibrium, the law of mass action states that
\[
np=n_i^2,
\]
where
\[
n
\]
is the electron concentration after doping and
\[
p
\]
is the hole concentration after doping.
This relation remains valid even after doping.
Step 1: Determine the intrinsic carrier concentration.
Given intrinsic hole concentration,
\[
p_i=5\times10^8\,\text{m}^{-3}.
\]
For an intrinsic semiconductor,
\[
n_i=p_i.
\]
Therefore,
\[
n_i=5\times10^8\,\text{m}^{-3}.
\]
Step 2: Apply the mass action law.
The law of mass action gives
\[
np=n_i^2.
\]
Substituting the given values,
\[
(4\times10^{12})p
=
(5\times10^8)^2.
\]
Step 3: Calculate the square of the intrinsic concentration.
\[
(5\times10^8)^2
=
25\times10^{16}
=
2.5\times10^{17}.
\]
Hence,
\[
(4\times10^{12})p
=
2.5\times10^{17}.
\]
Step 4: Calculate the new hole concentration.
\[
p
=
\frac{2.5\times10^{17}}
{4\times10^{12}}.
\]
\[
p
=
0.625\times10^5.
\]
\[
p
=
6.25\times10^4\,\text{m}^{-3}.
\]
Thus, the new hole concentration is
\[
\boxed{6.25\times10^4\,\text{m}^{-3}}.
\]
Step 5: Identify the type of semiconductor.
After doping,
\[
n=4\times10^{12}\,\text{m}^{-3}
\]
whereas
\[
p=6.25\times10^4\,\text{m}^{-3}.
\]
Clearly,
\[
n \gg p.
\]
Therefore, electrons are the majority charge carriers.
Hence, the doped semiconductor is an
\[
\boxed{\text{n-type semiconductor}}.
\]
Step 6: Write the final answer.
The new hole concentration is
\[
\boxed{6.25\times10^4\,\text{m}^{-3}}
\]
and the semiconductor formed is
\[
\boxed{\text{n-type semiconductor}}.
\]