coding some statistical conversions between probability data types