What is the expected time at which a success $S$ followed by a failure $F$, occurs for the first time in a sequence of Bernoulli trials?

213 Views Asked by At

We have $P(S) = a$ and $P(F) = 1-a$.

I want to find the expected time at which $SF$ occurs for the first time. I'm following a method given in my lectures but not getting the right answer so I must be misunderstanding. This is my attempt:

Let $T_i$ be the number of further trials needed until $SF$ occurs for the first time.

Note that due to the "fresh start property" we have E[$T_i$] = E[$T_j$] $\forall i,j \in \{1, 2,...\}$.

We define a new random variable, $V$, with $$ V = \begin{cases} 1, & \text{if trial starts with SF} \\ 2, & \text{if trial starts with SS} \\ 3, & \text{if trial starts with F} \end{cases} $$

Now, our aim is to compute $\mathbb{E}[T_1]$. So,

If $V=1 \implies T_1 = 2$

If $V=2 \implies T_1 = 2 + T_3 = 2 + T_1$

If $V=3 \implies T_1 = 1 + T_2 = 1 + T_1$

So, we have $\begin{align} \mathbb{E}[T_1] &= \mathbb{E}_V[E_T[T_1 | V]] \\[2ex] &= \mathbb{E}[T_1|V=1]Pr(V=1) + \mathbb{E}[T_1|V=2]Pr(V=2) + \mathbb{E}[T_1|V=3]Pr(V=3) \\[2ex] &= 2a(1-a) + a^2E[2+T_1] + (1-a)\mathbb{E}[T_1] \\[2ex] &= a + 1 + \mathbb{E}[T_1](a^2 - a +1) \\[2ex] \implies \mathbb{E}[T_1] &= \frac{-a-1}{a^2-a} \end{align}$

But this is apparently incorrect, I'm trying my best to follow the method shown to me in lecture to calculate the same thing but for $SS$ instead of $SF$. What am I doing wrong/misunderstanding?


EDIT:

I think through the below comments I've understood that I'm doing something wrong when dealing with the case of $S$ happening. So, if we redefine $V$ as:

$$ V = \begin{cases} 1, & \text{if trial starts with SF} \\ 2, & \text{if trial starts with S} \\ 3, & \text{if trial starts with F} \end{cases} $$

Because starting with $SS$ and starting with $S$ is the same (fresh start). But, I still can't get the right answer. I'm confident that

If $V=1 \implies T_1 = 2 \implies \mathbb{E}[T_1|V=1] = 2$

If $V=3 \implies T_1 = 1 + T_2 = 1 + T_1 \implies \mathbb{E}[T_1|V=3] = \mathbb{E}[1+T_1]$

But I'm stumped when it comes to $\mathbb{E}[T_1|V=2]$

2

There are 2 best solutions below

0
On BEST ANSWER

We define a random variable (V) to describe the starting point of the trial as follows: $$ V = \begin{cases} 1, & \text{if the trial starts at } S, \\ 2, & \text{if the trial starts at } F. \end{cases} $$

Our goal is to calculate $E[T_1]$, the expected number of trials. By the law of total expectation, we know: $$ E[T_1] = E[E[T_1|V]] = E[T_1|V=1]P(V=1) + E[T_1|V=2]P(V=2). $$

Now, we consider the expectations $E[T_1|V=1]$ and $E[T_1|V=2]$ separately:

  1. For $E[T_1|V=1]$, we are dealing with the expected time until the first failure, given the first trial was a success. This follows a geometric distribution, thus: $$ E[T_1|V=1] = E[Geom(1-a)] + 1 = \frac{1}{1-a} + 1, $$ where the "+1" accounts for the initial success.

  2. For $E[T_1|V=2]$, it is simply the expected time for achieving "SF" plus the one failed trial, hence: $$ E[T_1|V=2] = 1 + E[T_1]. $$

Applying the law of total expectation, we combine these to form: $$ E[T_1] = \left( \frac{1}{1-a} + 1 \right) \cdot a + (1 + E[T_1]) \cdot (1-a). $$

Solving this equation simplifies down to the expression: $$ E[T_1] = \frac{1}{a \cdot (1-a)}. $$

2
On

If $N$ is first occurrence of SF, then $N=N_1+N_2$ where $N_1\sim\mathsf{Geo}(1-a)$ and $N_2\sim\mathsf{Geo}(a)$. We compute the distribution of $N$ by the law of total probability: \begin{align} \mathbb P(N=n) &= \mathbb P(N_1+N_2=n)\\ &= \sum_{k=1}^{n-1}\mathbb P(N_1+N_2=n\mid N_2=k)\mathbb P(N_2=k)\\ &= \sum_{k=1}^{n-1}\mathbb P(N_1=n-k)\mathbb P(N_2=k)\\ &= \sum_{k=1}^{n-1} a^{n-k-1}(1-a)\cdot(1-a)^{k-1}a\\ &= a^n\sum_{k=1}^{n-1}\left(\frac{1-a}a\right)^k. \end{align} If $a=\frac12$ then the above reduces to $(n-1)2^{-n}$, so the expectation is $$ \mathbb E[N] = \sum_{n=2}^\infty \mathbb n\cdot P(N=n) = \sum_{n=2}^\infty n(n-1)2^{-n} = 4. $$ Else, we evaluate the geometric sum $$ \mathbb P(N=n) = \frac{(1 - a)^n a - (1 - a) a^n}{1-2a} $$ and compute $$ \mathbb E[N] = \sum_{n=2}^\infty n\cdot \mathbb P(N=n) = \sum_{n=2}^\infty n\cdot \frac{(1 - a)^n a - (1 - a) a^n}{1-2a} = \frac1{a(1-a)}. $$