You can detect if a given transistor is a NPN or a PNP with the help of a digital multimeter in Diode mode. A NPN transistor will have a diode between its base and its emitter with its anode at the base and a PNP transistor will have the same diode but with its cathode at the base.
However the calculation and the use of these transistor completely depends on what you want to do.