A number \(U\) is chosen at random in the interval [0,1]. Find the probability that:
First we’ll generate 1M observations for \(U\). We’ll also visually check to ensure that the distrubution is uniform:
The distribution looks okay, so now we can find the probabilities of \(R,S\) & \(T\)
#for R in part A
R <- sum(U^2 < 0.25)/n
#for S in part B
S <- sum(U * (1-U) < 0.25) / n
#for T in part C
T <- sum(U /(1-U) < 0.25) / nAnswer A): The probability is 0.5002
Answer B): The probability is 1
Answer C): The probability is 0.2