function of random variable interactive