I've been stuck on this question for quite a while now. I was wondering what distributions each of these cases follow and how to solve. Any help would be much appreciated!
In an investigation into animal behaviour, rats have to choose between three similar doors, one of which is 'correct'. Correct choice is rewarded by food and incorrect choice is punished by a slight electric shock. If an incorrect choice is made, the rat is returned to the starting point and chooses again, this continuing until the correct door is chosen. The random variable X is the serial number of the trial on which the correct response is made, thus taking values 1,2,3,...
Find the expectations of X under each of the following hypotheses:
(a) Each door is equally likely to be chosen on each trial and all trials are mutually independent. (b) At each trial the rat chooses with equal probability between doors which have not so far been tried, no choice ever being repeated. (c) The rat never chooses the same door on two successive trials, but otherwise chooses at random with equal probability.
For $(a)$, $X$ has geometric distribution with parameter $\frac13$, that is, $\mathbb P(X=k)=(1-p)^{k-1}p$ for $k=1,2,\ldots$. Hence $$ \mathbb E[X] = \sum_{k=1}^\infty k\cdot\mathbb P(X=k) = \sum_{k=1}^\infty k\left(1-\frac13\right)^{k-1}\frac13 = \frac 1{1/3} = 3. $$
For $(b)$, it is clear that $$ \mathbb P(X=k) = \begin{cases} \frac13,& k=1\\ \frac16,& k=2\\ \frac12,& k=3, \end{cases} $$ and so $$ \mathbb E[X] = 1\cdot\frac13 + 2\cdot\frac16 + 3\cdot\frac12 = \frac{13}6. $$
For $(c)$, clearly $\mathbb P(X=1)=\frac13$, and taking into account the fact that $\{X=k\}$ means that there were $k-1$ failures, we have $\mathbb P(X=k) = \frac23\left(\frac12\right)^{k-1}$. The first failure took place with probability $1-\frac13$, the rest of the failures took place with probability $\frac12$, and the success took place with probability $\frac12$. The expectation is thus $$ \mathbb E[X] = 1\cdot\frac13 + \sum_{k=2}^\infty k\cdot \frac23\left(\frac12\right)^{k-1} = \frac73. $$