Equations on programs are used to express domain knowledge, verify correctness, and improve performance, by people such as programmers and by tools such as compilers. It turns out that equations on probabilistic programs are a particularly good way to express Bayesian inference, verify distribution correctness, and improve sampler performance. In this way, this tutorial will introduce the mathematical reasoning principles that practitioners of probabilistic reasoning use to turn declarative models into efficient algorithms. These principles include integration and conjugacy, density and conditioning, and detailed balance.