Expected Value for uniform random permutations using random variables

discrete mathematicsexpected valueprobabilityprobability theoryrandom variables

Question: Let $n \geq 2$ be an integer. You are given n beer bottles $B_1, B_2,…B_n$ and one cider bottle $C$. Consider a uniformly random permutation of these $n + 1$ bottles. The positions in this permutation are numbered as $1, 2, 3,…,n + 1$.

Define the random variable X to be:

X= the position of the leftmost beer bottle.

What is the expected value E(X) of the random variable X?

Answer: $\frac{(n+2)}{(n+1)}$

Attempt:

Total ways to arrange bottles: (n+1)! ways

The position of the leftmost beer: 1 way

E(X) = $$ \sum_{i=0}^{n+1} i*Pr(X = position, of, the, leftmost, beer)$$

E(X) = $$ \sum_{i=0}^{n+1} = 1*\frac{{n+1 \choose 1}*1}{(n+1)!} $$

$$ \sum_{i=0}^{n+1} = \frac{1}{(n-1)!} $$

Can't seem to simplify it to get the correct answer.

Best Answer

Left most beer bottle can be on position 1 or 2. If it is on position 1 then cider bootle can be on any position between 2 and n+1, so we have $n$ possibilities for cider bootle among all $n+1$ positions. Else if cider bottle is on position 1 and leftmost bottle is on position 2. So we have: $$E(X) = 1\cdot P(X=1)+2\cdot P(X=2) $$ $$ = {n\over n+1}+2{1\over n+1}$$