Find the probability that the median of the three uniform numbers is less than 0.4.

1.7k Views Asked by At

Three numbers are randomly and independently selected from the interval (0, 1). Determine the probability that the median of the three numbers is less than 0.4.

I know that in order for this to happen, we need at least two values to be < 0.4. I'm just not sure where to go from here and what formula to use. Thanks in advance!

2

There are 2 best solutions below

0
On

Hint:

  • Find the probability the first is below $0.4$, the second is below $0.4$, and the third is above $0.4$
  • Multiply this by the number of ways you can have this pattern with three different users
  • Add the probability all three are below $0.4$
2
On

Comment: Let $X$ be the number of observations below $0.4.$ Then $X \sim \mathsf{Binom}(3, 0.4).$ As you say, the median is below $0.4,$ if $X \ge 2.$

Here are three methods of evaluation, the first of which is @Henry's (+1).

(1) You seek $$P(X \ge 2) = P(X=2)+P(X =3)\\ = 3(.4)^2(.6) + (.4)^3 = 0.352.$$

(2) Also, $P(X \ge 2) = 1 - P(X \le 1) = 0.352;$ computation in R, where pbinom is a binomial CDF.

1 - pbinom(1, 3, .4)
[1] 0.352

(3) Looking at the distribution of the median: Simulation in R of a million iterations: each sampling three independent standard uniform values and taking their median. One can expect three place accuracy.

set.seed(2020)
med = replicate(10^6, median(runif(3)))
mean(med < .4)  # aprx. prop. of medians < .4
[1] 0.351944

One can prove analytically that the distribution of the median of three standard uniform random variables $U_i$ is $U_{(2)} \sim \mathsf{Beta}(2,2).$ Here is a histogram of the one million simulated medians along with the density function of this distribution.

enter image description here

hist(med, prob=T, col="skyblue2")
 curve(dbeta(x,2,2), add=T, col="orange", lwd=2)
 abline(v = .4, col="darkgreen", lwd=2)

Note: The simulation result can be compared with the exact answer as follows.

The density of $\mathsf{Beta}(2,2)$ is $f(x) = 6x(1-x),$ for $ 0<x<1.$ Then $$P(U_{(2)} \le 4) = \int_0^{0.4} 6x(1-x)\,dx = 0.352.$$

diff(pbeta(c(0,.4), 2, 2))
[1] 0.352