I'm trying to solve the following question:
In a course there are two groups - group $A$ and group $B$. Each week a student passes from group $A$ to group $B$ with probability $p$ and quit the course (i.e leaves group $B$) with probability $q$.
In the beginning there are $M$ students in each group. Length of course is $N$ weeks.
- What is the expected number of students in group $A$ at the end?
- What is the expected number of students in group $B$ at the end?
- What is the expected number of quitting students during the course?
- Let $p=q$. What are the result for the above questions?
My try:
- Let $A_i$ be the number of students in group $A$ at week $i$, then $A_{i+1}=(1-p)A_i$ and so $$A_N=(1-p)^N\cdot A_0=M(1-p)^N$$ and this is also the expected number at the end.
- Let $B_i$ be the number of students in group $B$ at week $i$, then \begin{align*}B_{i+1}&=pA_i+(1-q)B_i=pA_i+(1-q)\left[pA_{i-1}+(1-q)B_{i-1}\right] \\ &={\dots}=p\sum_{k=0}^{i}(1-q)^{i-k}A_k+(1-q)^{i+1}B_0\end{align*}So, $\displaystyle B_N=p\sum_{k=0}^{N-1}(1-q)^{N-(k+1)}A_k+(1-q)^{N}B_0$. Now, can I use linearity of expectation?
- Isn't it simply $2M-\mathbb{E}[A_N]-\mathbb{E}[B_N]$?
- It is simply plug $p=q$ and find results... I believe it shouldn't be so hard.
Am I on the right track?
And help will be appreciated. Thanks.
You're definitely on the right track, but I'd be more careful distinguishing between the random variables and their expectations. For example, when you claim $A_{i+1} = (1-p)A_i$, that's not true: $A_{i+1}$ and $A_i$ are random variables, and they aren't necessarily related by the constant $1-p$ (e.g., there is positive probability that they will be equal because no one will switch). What is true is $\mathbb{E}[A_{i+1}] = (1-p)\mathbb{E}[A_i]$. This will make things a bit more tricky in part 2.
A slightly different tack that might be helpful (especially in part 2) is to write $$ B_i = \sum_{j=1}^M I_i^{(j)} + \sum_{j=1}^M J_i^{(j)}$$ Here $I_i^{(j)}$ is the indicator random variable for the event that student #$j$ of those who started in class $A$ is now in class $B$, and $J_i^{(j)}$ is the indicator random variable for the event that student #$j$ of those who started in class $B$ is now in class $B$. The advantage of this is that clearly all the $I_i^{(j)}$s are identically distributed, as are the $J_i^{(j)}$s, so linearity of expectation gives $$ \mathbb{E}[B_i] = M\mathbb{E}[I_i] + M\mathbb{E}[J_i]$$ $\mathbb{E}[I_i]$ is the probability that a student starting in class $A$ ends up in class $B$, and $\mathbb{E}[J_i]$ is the probability that a student starting in class $B$ ends up in class $B$. Since in each case you are dealing with only a single student, these probabilities might be slightly less tricky to compute.