--- from: http://rosettacode.org/wiki/Probabilistic_choice note: Probability and statistics