Let $X_{1}$,$X_{2}$… $X_{n+1}$ be independent uniform random variables on [0,1].
let Z be the 2nd highest value in $\{X_{1},X_{2}… X_{n}\}$
let $c$ be a constant s.t $c \in [0,1]$
let $b$ be a constant s.t $b \in [0,1]$ and $b<c$
What is the $prob(X_{n+1}<Z<c,b<Z)$?
My attempt using the method from Conditional expected value of a maximum of uniform random variables.
$$prob(X_{n+1}<Z<c,b<Z)={\int_{b}^{c} n(n-1)(1-z) z^{n – 1} dz}.$$
Is this correct? If not where am I going wrong?
Best Answer
You're right:
$Z$ follows a Beta$(n-1,2)$ distribution as the second largest random variable in a sample of $n$ independent uniform random variables - check order statistics for this. The density of $Z$ is then:
$$f(z)= n(n-1) z^{n-2} (1-z) 1_{(0,1)}(z) $$
(This is intuitively clear : $z^{n-2}$ is the probability that $n-2$ independent uniform are below $z$, and $1-z$ that a further independent uniform random variable is above; once you have chosen one of the $n$ indices to be the one that achieves the second record, you have $n-1$ others to choose to be the one of the first record)
Since the event $X_{n+1}$ is independent of $\{X_1, \ldots, X_n\}$, the two r.v. in the pair $(X_{n+1},Z)$ are independent, with density the product of their respective maginals. Set $D=\{(x,z) \in [0,1]^2: x<z, b<z<c \}$ and compute :
\begin{align} P(X_{n+1}<Z ,b<Z<c) & = P((X_{n+1},Z) \in D ) \\ & =\int x f(z) 1_{(x,z) \in D} dx dz \\ &= \int_{b}^{c} z f(z) dz \\ & = n(n-1) \int_{b}^c z^{n-1} (1-z) 1_{(0,1)}(z) \end{align}