Here is the mathematical part as a single PDF, with appendices: Mathematical Excursion to Permutations and STIRLINGs Formula