0

Let $X$ be the random variable "number of tosses of a fair coin required to get 3 consequtive heads". From this answer:

Let $A$ be the event "the first toss is a heads". Then we have $$ E(X)=E(X\mid A)P(A)+E(X\mid \bar A)P(\bar A)\\ =\frac12E(X\mid A)+\frac12(1+E(X)) $$ since the expectation of $X$ given that the first toss is a tails is clearly one more than the expectation of $X$; you just wasted a throw.

I have two questions:

  1. By definition, $E(X|Y=y)=\sum_x x P(X=x|Y=y)$. What is the random variable $Y$ in this case, and how to write $E(X\mid A)$ and/or $E(X\mid \bar A)$ in the form $E(X|Y=y)$? (Or is there a definition of $E(X|A)$ that doesn't involve a second random variable?)

  2. I don't really understand why "the expectation of $X$ given that the first toss is a tails is clearly one more than the expectation of $X$". How to deduce this from definition of conditional expectation above (or whatever definition of conditional expectation that is used above)?

RobPratt
  • 45,619
  • I am not qualified to respond to your first question. For your 2nd question, note that if the first flip is a Tails, then the situation (i.e. $0$ consecutive Heads pending) is identical to the situation at the start of all of the coin tosses. So, the only change to the expected number of coin tosses is that then, there has been one (totally wasted) coin flip. – user2661923 Mar 19 '23 at 22:17

1 Answers1

2

One can define conditional expectation over events instead of random variables. In fact, the definition of conditional expectation over random variables builds over the definition of conditional expectation over events. Let $X$ be a random variable (for simplicity assume it to be discrete) and $A$ be an event. Then the conditional PMF of $X$ given $A$ is given by \begin{align*} p_{X|A}(x) = \Pr(X = x|A) = \frac{\Pr(\{X = x\} \cap A)}{\Pr(A)}. \end{align*} The conditional expectation of $X$ given $A$ is simply the expectation of $X$ under this conditional PMF. That is, \begin{align*} \mathbb{E}[X|A] = \sum_{x} x \cdot p_{X|A}(x). \end{align*}

One extends this to conditioning over random variables by defining $\mathbb{E}[X|Y = y]$ by considering events of the form $\{Y = y\}$.

In your particular case, we can either directly use the conditional expectation with respect to events as described above. If you insist on choosing a random variable, then the random variable of interest is simply the indicator random variable of the event $A$.

Regarding the second point, you can think of this as follows. While tossing the coins you can be in one of the four states: $0$ heads, $1$ head, $2$ heads, $3$ heads. Here the state $i$ heads corresponds to case when the last $i$ tosses that you have seen are all heads. This is true for all $i = 0,1,2,3$. Your goal is to reach from $0$ heads to $3$ heads. You can note that every time you get a head, you move closer to your goal. However, the moment you see a tail, you immediately go back to the state of $0$ heads because you now have $0$ consecutive heads according to the latest observations. Now consider the beginning of the process, where you start at $0$ heads. If you see a head, then you move towards your goal, i.e., to the state of $1$ head. However, if you obtain a tail (i.e. conditioned on $\bar{A}$), then continue to stay where you are and have wasted a toss in the process. So on average, you would still need an additional $\mathbb{E}[X]$ tosses till you reach your goal and you have wasted a toss in reaching where you are, i.e., back to the start giving you the result of $\mathbb{E}[X|\bar{A}] = \mathbb{E}[X] + 1$.

sudeep5221
  • 2,736