Write code to calculate basic distributions.