Suppose you have a playlist consisting of four songs that you play in a smart shuffle mode. In this mode, after the current song is played, the next song is chosen randomly from the other three tracks. This ensures you never hear the same song twice in a row. Let X be the number of songs you listen to until you've heard all the four different songs.
I am trying to calculate the variance of X (Var(x)). But I am stuck on how to approach it in this case. I have calculated the expected value to be E(x) = 25/3 but I was looking at some class notes and think this problem is more than just doing the regular formula for variance using expectation. I am stuck trying to figure out how to approach this exactly.
Any help is appreciated, thank you.
EDIT FOR MORE CLARIFICATION:
This question has many parts which I've worked out.
1.How many sequences of 4 songs are there where no song plays twice in a row? If we label the songs {A, B, C, D}, then examples are ABCD and ABAB but not ABBA.
Answer: 108
2.What's the value of P(X = 4)?
Answer: 6/27
- What's the value of P(X = 5)
Answer: 5/7
- What is the value of E(X)?
Answer: 25/3
- Var(X) = ?
This is where I am stuck, and need clarification/ help.
First off, your probabilities are wrong.
$P(X=1)=1/4$
Now
$P(X=2)= 3/4 \times 1/3=1/4$
$P(X=3)= 3/4 \times 2/3 \times 1/3= 1/4 \times (2/3)$
$P(X=4) = 3/4 \times 2/3 \times 2/3 \times 1/3 = 1/4 \times (2/3)^2=1/9 \neq 6/27$.
To get the expectation you just compute
$$EX = \sum_{j=1}^\infty P(X=j) j.$$
To get the variance you compute
$$EX^2 = \sum_{j=1}^\infty P(X=j) j^2,$$
and then
$$VX=EX^2-(EX)^2,$$
as suggested in one of the comments.
Given that this is homework I'll let you fill in the details.