Variance of Coin Flips Until H
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
If we flip a fair coin until we get heads, what is the variance of the number of flips to do this?
My attempt is:
$$E(flips):=Y=1times P(H)+(1+Y)times P(T)$$
$$Rightarrow Y=frac12+frac1+Y2$$
$$Rightarrow Y=2$$
I know this is correct. Now we attempt to compute:
$$E(flips^2):=X=1^2times P(H)+(sqrtX+1)^2times P(T)$$
$$Rightarrow X=frac12+frac(sqrtX+1)^22$$
$$Rightarrow X=2(2+sqrt 3)$$
I know the right answer is $E(flips^2)=6$, but I'm not sure how to solve it using this recursive strategy, as the above seemed most natural to me.*
*ie take the expected value $X$, square root it to get the number of flips (not squared), add one, then square it again.
variance expected-value
New contributor
add a comment |Â
up vote
1
down vote
favorite
If we flip a fair coin until we get heads, what is the variance of the number of flips to do this?
My attempt is:
$$E(flips):=Y=1times P(H)+(1+Y)times P(T)$$
$$Rightarrow Y=frac12+frac1+Y2$$
$$Rightarrow Y=2$$
I know this is correct. Now we attempt to compute:
$$E(flips^2):=X=1^2times P(H)+(sqrtX+1)^2times P(T)$$
$$Rightarrow X=frac12+frac(sqrtX+1)^22$$
$$Rightarrow X=2(2+sqrt 3)$$
I know the right answer is $E(flips^2)=6$, but I'm not sure how to solve it using this recursive strategy, as the above seemed most natural to me.*
*ie take the expected value $X$, square root it to get the number of flips (not squared), add one, then square it again.
variance expected-value
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
If we flip a fair coin until we get heads, what is the variance of the number of flips to do this?
My attempt is:
$$E(flips):=Y=1times P(H)+(1+Y)times P(T)$$
$$Rightarrow Y=frac12+frac1+Y2$$
$$Rightarrow Y=2$$
I know this is correct. Now we attempt to compute:
$$E(flips^2):=X=1^2times P(H)+(sqrtX+1)^2times P(T)$$
$$Rightarrow X=frac12+frac(sqrtX+1)^22$$
$$Rightarrow X=2(2+sqrt 3)$$
I know the right answer is $E(flips^2)=6$, but I'm not sure how to solve it using this recursive strategy, as the above seemed most natural to me.*
*ie take the expected value $X$, square root it to get the number of flips (not squared), add one, then square it again.
variance expected-value
New contributor
If we flip a fair coin until we get heads, what is the variance of the number of flips to do this?
My attempt is:
$$E(flips):=Y=1times P(H)+(1+Y)times P(T)$$
$$Rightarrow Y=frac12+frac1+Y2$$
$$Rightarrow Y=2$$
I know this is correct. Now we attempt to compute:
$$E(flips^2):=X=1^2times P(H)+(sqrtX+1)^2times P(T)$$
$$Rightarrow X=frac12+frac(sqrtX+1)^22$$
$$Rightarrow X=2(2+sqrt 3)$$
I know the right answer is $E(flips^2)=6$, but I'm not sure how to solve it using this recursive strategy, as the above seemed most natural to me.*
*ie take the expected value $X$, square root it to get the number of flips (not squared), add one, then square it again.
variance expected-value
variance expected-value
New contributor
New contributor
New contributor
asked 3 hours ago
Dan
82
82
New contributor
New contributor
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
You are essentially using the Law of Total Expectation; see the accepted answer here for a review: https://math.stackexchange.com/questions/521609/finding-expected-value-with-recursion.
Let $N$ be the number of flips required until the first heads appears, and let $H_1$ be the indicator of a heads on the first flip; i.e. $H_1 = 1$ if the first flip is heads and $H_1 = 0$ if it is tails. We will compute $E(N^2)$ using the Law of Total Expectation:
$$E(N^2) = E(E(N^2 | H_1)).$$
The conditional expectation $E(N^2 | H_1)$ is a random variable; in particular it is a function of $H_1$. Let's find its distribution. Conditional on $H_1 = 1$ (i.e. when the first flip is heads), the number of flips until heads appears will of course be one, so $E(N^2 | H_1 = 1) = 1^2$. Conditional on $H_1 = 0$ (when the first flip is tails), the number of flips until heads appears will be one more than in the unconditional case, hence the conditional expectation is $E(N^2 | H_1 = 0) = E((N + 1)^2) = E(N^2) + 2E(N) + 1$. Thus
beginalign E(N^2) & = E(E(N^2 | H_1)) \
& = 1^2 cdot frac12 + (E(N^2) + 2E(N) + 1)cdot 1/2 \
& = frac12 + (E(N^2) + 2(2) + 1)cdot 1/2. \
endalign
Solving the equation, we find that $E(N^2) = 6$ and then $Var(N) = 6 - 2^2 = 2$.
add a comment |Â
up vote
1
down vote
Although this doesn't follow your recursive approach, you can use the geometric distribution's properties here.
You have $X$, which I will refer to as $flips$ from now on, is distributed according to $Geometric(p=0.5)$.
Recall the definition of Variance, $Var(flips)=E(flips^2) + [E(flips)]^2$
where,
$Var(flips)=frac1-pp^2$ and $E(flips)=frac1p$.
Thus, $E(flips^2)=Var(flips) + [E(flips)]^2 = 2+4 = 6$.
New contributor
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You are essentially using the Law of Total Expectation; see the accepted answer here for a review: https://math.stackexchange.com/questions/521609/finding-expected-value-with-recursion.
Let $N$ be the number of flips required until the first heads appears, and let $H_1$ be the indicator of a heads on the first flip; i.e. $H_1 = 1$ if the first flip is heads and $H_1 = 0$ if it is tails. We will compute $E(N^2)$ using the Law of Total Expectation:
$$E(N^2) = E(E(N^2 | H_1)).$$
The conditional expectation $E(N^2 | H_1)$ is a random variable; in particular it is a function of $H_1$. Let's find its distribution. Conditional on $H_1 = 1$ (i.e. when the first flip is heads), the number of flips until heads appears will of course be one, so $E(N^2 | H_1 = 1) = 1^2$. Conditional on $H_1 = 0$ (when the first flip is tails), the number of flips until heads appears will be one more than in the unconditional case, hence the conditional expectation is $E(N^2 | H_1 = 0) = E((N + 1)^2) = E(N^2) + 2E(N) + 1$. Thus
beginalign E(N^2) & = E(E(N^2 | H_1)) \
& = 1^2 cdot frac12 + (E(N^2) + 2E(N) + 1)cdot 1/2 \
& = frac12 + (E(N^2) + 2(2) + 1)cdot 1/2. \
endalign
Solving the equation, we find that $E(N^2) = 6$ and then $Var(N) = 6 - 2^2 = 2$.
add a comment |Â
up vote
3
down vote
accepted
You are essentially using the Law of Total Expectation; see the accepted answer here for a review: https://math.stackexchange.com/questions/521609/finding-expected-value-with-recursion.
Let $N$ be the number of flips required until the first heads appears, and let $H_1$ be the indicator of a heads on the first flip; i.e. $H_1 = 1$ if the first flip is heads and $H_1 = 0$ if it is tails. We will compute $E(N^2)$ using the Law of Total Expectation:
$$E(N^2) = E(E(N^2 | H_1)).$$
The conditional expectation $E(N^2 | H_1)$ is a random variable; in particular it is a function of $H_1$. Let's find its distribution. Conditional on $H_1 = 1$ (i.e. when the first flip is heads), the number of flips until heads appears will of course be one, so $E(N^2 | H_1 = 1) = 1^2$. Conditional on $H_1 = 0$ (when the first flip is tails), the number of flips until heads appears will be one more than in the unconditional case, hence the conditional expectation is $E(N^2 | H_1 = 0) = E((N + 1)^2) = E(N^2) + 2E(N) + 1$. Thus
beginalign E(N^2) & = E(E(N^2 | H_1)) \
& = 1^2 cdot frac12 + (E(N^2) + 2E(N) + 1)cdot 1/2 \
& = frac12 + (E(N^2) + 2(2) + 1)cdot 1/2. \
endalign
Solving the equation, we find that $E(N^2) = 6$ and then $Var(N) = 6 - 2^2 = 2$.
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You are essentially using the Law of Total Expectation; see the accepted answer here for a review: https://math.stackexchange.com/questions/521609/finding-expected-value-with-recursion.
Let $N$ be the number of flips required until the first heads appears, and let $H_1$ be the indicator of a heads on the first flip; i.e. $H_1 = 1$ if the first flip is heads and $H_1 = 0$ if it is tails. We will compute $E(N^2)$ using the Law of Total Expectation:
$$E(N^2) = E(E(N^2 | H_1)).$$
The conditional expectation $E(N^2 | H_1)$ is a random variable; in particular it is a function of $H_1$. Let's find its distribution. Conditional on $H_1 = 1$ (i.e. when the first flip is heads), the number of flips until heads appears will of course be one, so $E(N^2 | H_1 = 1) = 1^2$. Conditional on $H_1 = 0$ (when the first flip is tails), the number of flips until heads appears will be one more than in the unconditional case, hence the conditional expectation is $E(N^2 | H_1 = 0) = E((N + 1)^2) = E(N^2) + 2E(N) + 1$. Thus
beginalign E(N^2) & = E(E(N^2 | H_1)) \
& = 1^2 cdot frac12 + (E(N^2) + 2E(N) + 1)cdot 1/2 \
& = frac12 + (E(N^2) + 2(2) + 1)cdot 1/2. \
endalign
Solving the equation, we find that $E(N^2) = 6$ and then $Var(N) = 6 - 2^2 = 2$.
You are essentially using the Law of Total Expectation; see the accepted answer here for a review: https://math.stackexchange.com/questions/521609/finding-expected-value-with-recursion.
Let $N$ be the number of flips required until the first heads appears, and let $H_1$ be the indicator of a heads on the first flip; i.e. $H_1 = 1$ if the first flip is heads and $H_1 = 0$ if it is tails. We will compute $E(N^2)$ using the Law of Total Expectation:
$$E(N^2) = E(E(N^2 | H_1)).$$
The conditional expectation $E(N^2 | H_1)$ is a random variable; in particular it is a function of $H_1$. Let's find its distribution. Conditional on $H_1 = 1$ (i.e. when the first flip is heads), the number of flips until heads appears will of course be one, so $E(N^2 | H_1 = 1) = 1^2$. Conditional on $H_1 = 0$ (when the first flip is tails), the number of flips until heads appears will be one more than in the unconditional case, hence the conditional expectation is $E(N^2 | H_1 = 0) = E((N + 1)^2) = E(N^2) + 2E(N) + 1$. Thus
beginalign E(N^2) & = E(E(N^2 | H_1)) \
& = 1^2 cdot frac12 + (E(N^2) + 2E(N) + 1)cdot 1/2 \
& = frac12 + (E(N^2) + 2(2) + 1)cdot 1/2. \
endalign
Solving the equation, we find that $E(N^2) = 6$ and then $Var(N) = 6 - 2^2 = 2$.
edited 59 mins ago
answered 1 hour ago
Gordon Honerkamp-Smith
1546
1546
add a comment |Â
add a comment |Â
up vote
1
down vote
Although this doesn't follow your recursive approach, you can use the geometric distribution's properties here.
You have $X$, which I will refer to as $flips$ from now on, is distributed according to $Geometric(p=0.5)$.
Recall the definition of Variance, $Var(flips)=E(flips^2) + [E(flips)]^2$
where,
$Var(flips)=frac1-pp^2$ and $E(flips)=frac1p$.
Thus, $E(flips^2)=Var(flips) + [E(flips)]^2 = 2+4 = 6$.
New contributor
add a comment |Â
up vote
1
down vote
Although this doesn't follow your recursive approach, you can use the geometric distribution's properties here.
You have $X$, which I will refer to as $flips$ from now on, is distributed according to $Geometric(p=0.5)$.
Recall the definition of Variance, $Var(flips)=E(flips^2) + [E(flips)]^2$
where,
$Var(flips)=frac1-pp^2$ and $E(flips)=frac1p$.
Thus, $E(flips^2)=Var(flips) + [E(flips)]^2 = 2+4 = 6$.
New contributor
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Although this doesn't follow your recursive approach, you can use the geometric distribution's properties here.
You have $X$, which I will refer to as $flips$ from now on, is distributed according to $Geometric(p=0.5)$.
Recall the definition of Variance, $Var(flips)=E(flips^2) + [E(flips)]^2$
where,
$Var(flips)=frac1-pp^2$ and $E(flips)=frac1p$.
Thus, $E(flips^2)=Var(flips) + [E(flips)]^2 = 2+4 = 6$.
New contributor
Although this doesn't follow your recursive approach, you can use the geometric distribution's properties here.
You have $X$, which I will refer to as $flips$ from now on, is distributed according to $Geometric(p=0.5)$.
Recall the definition of Variance, $Var(flips)=E(flips^2) + [E(flips)]^2$
where,
$Var(flips)=frac1-pp^2$ and $E(flips)=frac1p$.
Thus, $E(flips^2)=Var(flips) + [E(flips)]^2 = 2+4 = 6$.
New contributor
edited 56 mins ago
New contributor
answered 1 hour ago
OUrista
112
112
New contributor
New contributor
add a comment |Â
add a comment |Â
Dan is a new contributor. Be nice, and check out our Code of Conduct.
Dan is a new contributor. Be nice, and check out our Code of Conduct.
Dan is a new contributor. Be nice, and check out our Code of Conduct.
Dan is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f373195%2fvariance-of-coin-flips-until-h%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password