How a pure intrinsic semiconductor can be transformed into n-type and p-type semiconductor?