Computing exact probabilities and manipulating random variables