Tossing a fair coin $N$ times, what is the variance?
$begingroup$
$X$ is a random variable that equals the number of heads.
$E(X)$ is the expected value of the number of heads when a coin is tossed $n$ times, so since $P(X)= 0.5, E(X) = frac n2$
I know that the variance is calculated by $V(X) = E(X^2) - E(X)^2$, but my question is how would I calculate $E(X^2)$?
probability
$endgroup$
add a comment |
$begingroup$
$X$ is a random variable that equals the number of heads.
$E(X)$ is the expected value of the number of heads when a coin is tossed $n$ times, so since $P(X)= 0.5, E(X) = frac n2$
I know that the variance is calculated by $V(X) = E(X^2) - E(X)^2$, but my question is how would I calculate $E(X^2)$?
probability
$endgroup$
add a comment |
$begingroup$
$X$ is a random variable that equals the number of heads.
$E(X)$ is the expected value of the number of heads when a coin is tossed $n$ times, so since $P(X)= 0.5, E(X) = frac n2$
I know that the variance is calculated by $V(X) = E(X^2) - E(X)^2$, but my question is how would I calculate $E(X^2)$?
probability
$endgroup$
$X$ is a random variable that equals the number of heads.
$E(X)$ is the expected value of the number of heads when a coin is tossed $n$ times, so since $P(X)= 0.5, E(X) = frac n2$
I know that the variance is calculated by $V(X) = E(X^2) - E(X)^2$, but my question is how would I calculate $E(X^2)$?
probability
probability
edited Jan 22 at 10:54


EdOverflow
25119
25119
asked Jan 22 at 10:44


2000mroliver2000mroliver
644
644
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
This is a classical example of a binomial experiment, in short the probability distribution of the variable $X$ can be written as
$$
P(X = x) = {n choose x}p^x (1 - p)^{n-x} tag{1}
$$
in your case $p = 1/2$ is the probability of getting heads when the coin is tossed. And from here you can do the math to show
$$
mathbb{E}[X] = sum_x x P(X = x) = np
$$
and
$$
mathbb{V}{rm ar}[X] = sum_x (x - mathbb{E}[X])^2 P(X = x) = np(1 - p)
$$
$endgroup$
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
add a comment |
$begingroup$
You can calculate $mathbb EX^2$ purely on base of the equality:$$mathbb EX^2=sum_{k=0}^nk^2P(X=k)$$
If you take that (cumbersome) route then it is handsome to make use of: $$cdots=sum_{k=0}^nk(k-1)P(X=k)+sum_{k=0}^nkP(X=k)=sum_{k=0}^nk(k-1)P(X=k)+mathbb EX$$
However you are dealing with a random variable $X$ that has binomial distribution with parameters $n$ and $p=frac12$. Then it is much more handsome to write $X=B_1+cdots+B_n$ where the $B_i$ are iid random variables having Bernoulli-distribution with parameter $p=frac12$.
Then with linearity of expectation, symmetry and independence we find:$$mathbb EX^2=mathbb Eleft[sum_{i=1}^nsum_{j=1}^nB_iB_jright]=nmathbb EB_1^2+n(n-1)mathbb EB_1mathbb EB_2=ncdotfrac12+n(n-1)cdotfrac12frac12=frac14n+frac14n^2$$leading to $mathsf{Var}X=frac14n+frac14n^2-left(frac12nright)^2=frac14n$.
If you are aiming only at variance and not specifically $mathbb EX^2$ then there is even a faster route:$$mathsf{Var}
X=sum_{k=1}^nmathsf{Var}B_k=nmathsf{Var}B_1=frac14n$$
This because the variance is also linear under the extra condition that the terms are independent.
$endgroup$
add a comment |
$begingroup$
HINT
Given the random variable $X$ and its corresponding probability mass function $f_{X}(x)$, we have
$$textbf{E}(g(X)) = sum_{x}g(x)f(x)$$
$endgroup$
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
add a comment |
$begingroup$
There is some misunderstanding in your model, because you mixed up one single toss with the whole experiment.
The right model:
You have $n$ random variables $X_i, i=1,dots,n$ which are identically and independently distributed. Each $X_i$ returns $1$ if you toss head and 0 else. Therefore the distribution is given by
$$
P(X_i = 1) = 0.5 quadtext{and} quad P(X_i = 0) = 0.5 quadtext{for all} quad i in {1,dots,n}.
$$
The random variable $X$ which counts the number of heads is $X = sum_{i=1}^{n} X_i$. Therefore, you have $P(X=k) = binom{n}{k}cdot 0.5^{n}$.
Now remember that $mathbb{E}(Y) := sum_{iin Y^{-1}(mathbb{R})} iP(Y=i)$ (for discrete random variables)
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3082993%2ftossing-a-fair-coin-n-times-what-is-the-variance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This is a classical example of a binomial experiment, in short the probability distribution of the variable $X$ can be written as
$$
P(X = x) = {n choose x}p^x (1 - p)^{n-x} tag{1}
$$
in your case $p = 1/2$ is the probability of getting heads when the coin is tossed. And from here you can do the math to show
$$
mathbb{E}[X] = sum_x x P(X = x) = np
$$
and
$$
mathbb{V}{rm ar}[X] = sum_x (x - mathbb{E}[X])^2 P(X = x) = np(1 - p)
$$
$endgroup$
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
add a comment |
$begingroup$
This is a classical example of a binomial experiment, in short the probability distribution of the variable $X$ can be written as
$$
P(X = x) = {n choose x}p^x (1 - p)^{n-x} tag{1}
$$
in your case $p = 1/2$ is the probability of getting heads when the coin is tossed. And from here you can do the math to show
$$
mathbb{E}[X] = sum_x x P(X = x) = np
$$
and
$$
mathbb{V}{rm ar}[X] = sum_x (x - mathbb{E}[X])^2 P(X = x) = np(1 - p)
$$
$endgroup$
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
add a comment |
$begingroup$
This is a classical example of a binomial experiment, in short the probability distribution of the variable $X$ can be written as
$$
P(X = x) = {n choose x}p^x (1 - p)^{n-x} tag{1}
$$
in your case $p = 1/2$ is the probability of getting heads when the coin is tossed. And from here you can do the math to show
$$
mathbb{E}[X] = sum_x x P(X = x) = np
$$
and
$$
mathbb{V}{rm ar}[X] = sum_x (x - mathbb{E}[X])^2 P(X = x) = np(1 - p)
$$
$endgroup$
This is a classical example of a binomial experiment, in short the probability distribution of the variable $X$ can be written as
$$
P(X = x) = {n choose x}p^x (1 - p)^{n-x} tag{1}
$$
in your case $p = 1/2$ is the probability of getting heads when the coin is tossed. And from here you can do the math to show
$$
mathbb{E}[X] = sum_x x P(X = x) = np
$$
and
$$
mathbb{V}{rm ar}[X] = sum_x (x - mathbb{E}[X])^2 P(X = x) = np(1 - p)
$$
answered Jan 22 at 11:05
caveraccaverac
14.8k31130
14.8k31130
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
add a comment |
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
okay thank you, is the formula np(1-p) for the variance something that I can use in any problem?
$endgroup$
– 2000mroliver
Jan 22 at 11:09
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
$begingroup$
@OliverBeck If the problem is binomial, then yes. Otherwise you cannot start applying this result to every problem you find.
$endgroup$
– caverac
Jan 22 at 11:10
add a comment |
$begingroup$
You can calculate $mathbb EX^2$ purely on base of the equality:$$mathbb EX^2=sum_{k=0}^nk^2P(X=k)$$
If you take that (cumbersome) route then it is handsome to make use of: $$cdots=sum_{k=0}^nk(k-1)P(X=k)+sum_{k=0}^nkP(X=k)=sum_{k=0}^nk(k-1)P(X=k)+mathbb EX$$
However you are dealing with a random variable $X$ that has binomial distribution with parameters $n$ and $p=frac12$. Then it is much more handsome to write $X=B_1+cdots+B_n$ where the $B_i$ are iid random variables having Bernoulli-distribution with parameter $p=frac12$.
Then with linearity of expectation, symmetry and independence we find:$$mathbb EX^2=mathbb Eleft[sum_{i=1}^nsum_{j=1}^nB_iB_jright]=nmathbb EB_1^2+n(n-1)mathbb EB_1mathbb EB_2=ncdotfrac12+n(n-1)cdotfrac12frac12=frac14n+frac14n^2$$leading to $mathsf{Var}X=frac14n+frac14n^2-left(frac12nright)^2=frac14n$.
If you are aiming only at variance and not specifically $mathbb EX^2$ then there is even a faster route:$$mathsf{Var}
X=sum_{k=1}^nmathsf{Var}B_k=nmathsf{Var}B_1=frac14n$$
This because the variance is also linear under the extra condition that the terms are independent.
$endgroup$
add a comment |
$begingroup$
You can calculate $mathbb EX^2$ purely on base of the equality:$$mathbb EX^2=sum_{k=0}^nk^2P(X=k)$$
If you take that (cumbersome) route then it is handsome to make use of: $$cdots=sum_{k=0}^nk(k-1)P(X=k)+sum_{k=0}^nkP(X=k)=sum_{k=0}^nk(k-1)P(X=k)+mathbb EX$$
However you are dealing with a random variable $X$ that has binomial distribution with parameters $n$ and $p=frac12$. Then it is much more handsome to write $X=B_1+cdots+B_n$ where the $B_i$ are iid random variables having Bernoulli-distribution with parameter $p=frac12$.
Then with linearity of expectation, symmetry and independence we find:$$mathbb EX^2=mathbb Eleft[sum_{i=1}^nsum_{j=1}^nB_iB_jright]=nmathbb EB_1^2+n(n-1)mathbb EB_1mathbb EB_2=ncdotfrac12+n(n-1)cdotfrac12frac12=frac14n+frac14n^2$$leading to $mathsf{Var}X=frac14n+frac14n^2-left(frac12nright)^2=frac14n$.
If you are aiming only at variance and not specifically $mathbb EX^2$ then there is even a faster route:$$mathsf{Var}
X=sum_{k=1}^nmathsf{Var}B_k=nmathsf{Var}B_1=frac14n$$
This because the variance is also linear under the extra condition that the terms are independent.
$endgroup$
add a comment |
$begingroup$
You can calculate $mathbb EX^2$ purely on base of the equality:$$mathbb EX^2=sum_{k=0}^nk^2P(X=k)$$
If you take that (cumbersome) route then it is handsome to make use of: $$cdots=sum_{k=0}^nk(k-1)P(X=k)+sum_{k=0}^nkP(X=k)=sum_{k=0}^nk(k-1)P(X=k)+mathbb EX$$
However you are dealing with a random variable $X$ that has binomial distribution with parameters $n$ and $p=frac12$. Then it is much more handsome to write $X=B_1+cdots+B_n$ where the $B_i$ are iid random variables having Bernoulli-distribution with parameter $p=frac12$.
Then with linearity of expectation, symmetry and independence we find:$$mathbb EX^2=mathbb Eleft[sum_{i=1}^nsum_{j=1}^nB_iB_jright]=nmathbb EB_1^2+n(n-1)mathbb EB_1mathbb EB_2=ncdotfrac12+n(n-1)cdotfrac12frac12=frac14n+frac14n^2$$leading to $mathsf{Var}X=frac14n+frac14n^2-left(frac12nright)^2=frac14n$.
If you are aiming only at variance and not specifically $mathbb EX^2$ then there is even a faster route:$$mathsf{Var}
X=sum_{k=1}^nmathsf{Var}B_k=nmathsf{Var}B_1=frac14n$$
This because the variance is also linear under the extra condition that the terms are independent.
$endgroup$
You can calculate $mathbb EX^2$ purely on base of the equality:$$mathbb EX^2=sum_{k=0}^nk^2P(X=k)$$
If you take that (cumbersome) route then it is handsome to make use of: $$cdots=sum_{k=0}^nk(k-1)P(X=k)+sum_{k=0}^nkP(X=k)=sum_{k=0}^nk(k-1)P(X=k)+mathbb EX$$
However you are dealing with a random variable $X$ that has binomial distribution with parameters $n$ and $p=frac12$. Then it is much more handsome to write $X=B_1+cdots+B_n$ where the $B_i$ are iid random variables having Bernoulli-distribution with parameter $p=frac12$.
Then with linearity of expectation, symmetry and independence we find:$$mathbb EX^2=mathbb Eleft[sum_{i=1}^nsum_{j=1}^nB_iB_jright]=nmathbb EB_1^2+n(n-1)mathbb EB_1mathbb EB_2=ncdotfrac12+n(n-1)cdotfrac12frac12=frac14n+frac14n^2$$leading to $mathsf{Var}X=frac14n+frac14n^2-left(frac12nright)^2=frac14n$.
If you are aiming only at variance and not specifically $mathbb EX^2$ then there is even a faster route:$$mathsf{Var}
X=sum_{k=1}^nmathsf{Var}B_k=nmathsf{Var}B_1=frac14n$$
This because the variance is also linear under the extra condition that the terms are independent.
answered Jan 22 at 11:15


drhabdrhab
103k545136
103k545136
add a comment |
add a comment |
$begingroup$
HINT
Given the random variable $X$ and its corresponding probability mass function $f_{X}(x)$, we have
$$textbf{E}(g(X)) = sum_{x}g(x)f(x)$$
$endgroup$
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
add a comment |
$begingroup$
HINT
Given the random variable $X$ and its corresponding probability mass function $f_{X}(x)$, we have
$$textbf{E}(g(X)) = sum_{x}g(x)f(x)$$
$endgroup$
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
add a comment |
$begingroup$
HINT
Given the random variable $X$ and its corresponding probability mass function $f_{X}(x)$, we have
$$textbf{E}(g(X)) = sum_{x}g(x)f(x)$$
$endgroup$
HINT
Given the random variable $X$ and its corresponding probability mass function $f_{X}(x)$, we have
$$textbf{E}(g(X)) = sum_{x}g(x)f(x)$$
answered Jan 22 at 11:01
user1337user1337
46110
46110
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
add a comment |
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
$begingroup$
sorry but I am unfamiliar with the probability mass function, is it necessary here to find the variance?
$endgroup$
– 2000mroliver
Jan 22 at 11:06
add a comment |
$begingroup$
There is some misunderstanding in your model, because you mixed up one single toss with the whole experiment.
The right model:
You have $n$ random variables $X_i, i=1,dots,n$ which are identically and independently distributed. Each $X_i$ returns $1$ if you toss head and 0 else. Therefore the distribution is given by
$$
P(X_i = 1) = 0.5 quadtext{and} quad P(X_i = 0) = 0.5 quadtext{for all} quad i in {1,dots,n}.
$$
The random variable $X$ which counts the number of heads is $X = sum_{i=1}^{n} X_i$. Therefore, you have $P(X=k) = binom{n}{k}cdot 0.5^{n}$.
Now remember that $mathbb{E}(Y) := sum_{iin Y^{-1}(mathbb{R})} iP(Y=i)$ (for discrete random variables)
$endgroup$
add a comment |
$begingroup$
There is some misunderstanding in your model, because you mixed up one single toss with the whole experiment.
The right model:
You have $n$ random variables $X_i, i=1,dots,n$ which are identically and independently distributed. Each $X_i$ returns $1$ if you toss head and 0 else. Therefore the distribution is given by
$$
P(X_i = 1) = 0.5 quadtext{and} quad P(X_i = 0) = 0.5 quadtext{for all} quad i in {1,dots,n}.
$$
The random variable $X$ which counts the number of heads is $X = sum_{i=1}^{n} X_i$. Therefore, you have $P(X=k) = binom{n}{k}cdot 0.5^{n}$.
Now remember that $mathbb{E}(Y) := sum_{iin Y^{-1}(mathbb{R})} iP(Y=i)$ (for discrete random variables)
$endgroup$
add a comment |
$begingroup$
There is some misunderstanding in your model, because you mixed up one single toss with the whole experiment.
The right model:
You have $n$ random variables $X_i, i=1,dots,n$ which are identically and independently distributed. Each $X_i$ returns $1$ if you toss head and 0 else. Therefore the distribution is given by
$$
P(X_i = 1) = 0.5 quadtext{and} quad P(X_i = 0) = 0.5 quadtext{for all} quad i in {1,dots,n}.
$$
The random variable $X$ which counts the number of heads is $X = sum_{i=1}^{n} X_i$. Therefore, you have $P(X=k) = binom{n}{k}cdot 0.5^{n}$.
Now remember that $mathbb{E}(Y) := sum_{iin Y^{-1}(mathbb{R})} iP(Y=i)$ (for discrete random variables)
$endgroup$
There is some misunderstanding in your model, because you mixed up one single toss with the whole experiment.
The right model:
You have $n$ random variables $X_i, i=1,dots,n$ which are identically and independently distributed. Each $X_i$ returns $1$ if you toss head and 0 else. Therefore the distribution is given by
$$
P(X_i = 1) = 0.5 quadtext{and} quad P(X_i = 0) = 0.5 quadtext{for all} quad i in {1,dots,n}.
$$
The random variable $X$ which counts the number of heads is $X = sum_{i=1}^{n} X_i$. Therefore, you have $P(X=k) = binom{n}{k}cdot 0.5^{n}$.
Now remember that $mathbb{E}(Y) := sum_{iin Y^{-1}(mathbb{R})} iP(Y=i)$ (for discrete random variables)
edited Jan 22 at 11:22
answered Jan 22 at 11:17


Nathanael SkrepekNathanael Skrepek
1,7111615
1,7111615
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3082993%2ftossing-a-fair-coin-n-times-what-is-the-variance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown