Variance equations that yield inconsistent results












0












$begingroup$


Consider a game of chance were a player places a bet, and coin is flipped if the coin lands on heads the player wins $2b$ where $b$ is the bet value. If the coin lands on tails the player looses the bet. $E[V] = mu= 1$ for this game, where $V$ is the random amount we win. The $sigma^2 = 2.5$ for a bet of 1 according to the following equation:
$$sigma^2 = sum p_i(x_i-mu_x)^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-1 -mu)^2$$



How ever simulations have shown a convergence to $sigma^2 = 1$ or more generally $sigma^2$ converges according to (in the simulations):



$$sigma^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-mu)^2$$



Where $w$ is the winning value and $b$ is the bet value. This is inconsistent and I'm sure i'm going wrong somewhere. Most probably in the way I'm calculating the actual variance. But I'm not sure how. Please can someone point out what I'm doing wrong and what would be the correct way.



The equations used in the simulation are as follows:



Equation used in computing the mean
$$overline{x}=frac{1}{n}sum_{i=1}^{n}{frac{w_i}{b_i}}$$
Where $overline{x}$ is the actual mean, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$.



Equation used in computing the actual variance
$$overlinesigma^2 = frac{sum_{i=1}^{n}{(frac{w_i}{b_i})^2}}{n}-overline{x}^2$$



Where $overlinesigma^2$ is the actual variance, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$ and $overline{x}$ is the actual mean as calculated above.



Note: The equation for calculating the actual variance is derived from the equation $sigma^2 = sum(x_i-mu_x)^2$ as to eliminate the need for the simulator to store a history of each rounds bet and winning values.










share|cite|improve this question











$endgroup$












  • $begingroup$
    I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
    $endgroup$
    – Brian Tung
    Jan 24 at 0:44












  • $begingroup$
    I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
    $endgroup$
    – lulu
    Jan 24 at 0:50












  • $begingroup$
    $x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
    $endgroup$
    – MSD
    Jan 24 at 0:59












  • $begingroup$
    $iin W$ where $W$ is all possible winning outcomes
    $endgroup$
    – MSD
    Jan 24 at 1:00












  • $begingroup$
    So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
    $endgroup$
    – lulu
    Jan 24 at 1:05


















0












$begingroup$


Consider a game of chance were a player places a bet, and coin is flipped if the coin lands on heads the player wins $2b$ where $b$ is the bet value. If the coin lands on tails the player looses the bet. $E[V] = mu= 1$ for this game, where $V$ is the random amount we win. The $sigma^2 = 2.5$ for a bet of 1 according to the following equation:
$$sigma^2 = sum p_i(x_i-mu_x)^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-1 -mu)^2$$



How ever simulations have shown a convergence to $sigma^2 = 1$ or more generally $sigma^2$ converges according to (in the simulations):



$$sigma^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-mu)^2$$



Where $w$ is the winning value and $b$ is the bet value. This is inconsistent and I'm sure i'm going wrong somewhere. Most probably in the way I'm calculating the actual variance. But I'm not sure how. Please can someone point out what I'm doing wrong and what would be the correct way.



The equations used in the simulation are as follows:



Equation used in computing the mean
$$overline{x}=frac{1}{n}sum_{i=1}^{n}{frac{w_i}{b_i}}$$
Where $overline{x}$ is the actual mean, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$.



Equation used in computing the actual variance
$$overlinesigma^2 = frac{sum_{i=1}^{n}{(frac{w_i}{b_i})^2}}{n}-overline{x}^2$$



Where $overlinesigma^2$ is the actual variance, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$ and $overline{x}$ is the actual mean as calculated above.



Note: The equation for calculating the actual variance is derived from the equation $sigma^2 = sum(x_i-mu_x)^2$ as to eliminate the need for the simulator to store a history of each rounds bet and winning values.










share|cite|improve this question











$endgroup$












  • $begingroup$
    I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
    $endgroup$
    – Brian Tung
    Jan 24 at 0:44












  • $begingroup$
    I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
    $endgroup$
    – lulu
    Jan 24 at 0:50












  • $begingroup$
    $x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
    $endgroup$
    – MSD
    Jan 24 at 0:59












  • $begingroup$
    $iin W$ where $W$ is all possible winning outcomes
    $endgroup$
    – MSD
    Jan 24 at 1:00












  • $begingroup$
    So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
    $endgroup$
    – lulu
    Jan 24 at 1:05
















0












0








0





$begingroup$


Consider a game of chance were a player places a bet, and coin is flipped if the coin lands on heads the player wins $2b$ where $b$ is the bet value. If the coin lands on tails the player looses the bet. $E[V] = mu= 1$ for this game, where $V$ is the random amount we win. The $sigma^2 = 2.5$ for a bet of 1 according to the following equation:
$$sigma^2 = sum p_i(x_i-mu_x)^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-1 -mu)^2$$



How ever simulations have shown a convergence to $sigma^2 = 1$ or more generally $sigma^2$ converges according to (in the simulations):



$$sigma^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-mu)^2$$



Where $w$ is the winning value and $b$ is the bet value. This is inconsistent and I'm sure i'm going wrong somewhere. Most probably in the way I'm calculating the actual variance. But I'm not sure how. Please can someone point out what I'm doing wrong and what would be the correct way.



The equations used in the simulation are as follows:



Equation used in computing the mean
$$overline{x}=frac{1}{n}sum_{i=1}^{n}{frac{w_i}{b_i}}$$
Where $overline{x}$ is the actual mean, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$.



Equation used in computing the actual variance
$$overlinesigma^2 = frac{sum_{i=1}^{n}{(frac{w_i}{b_i})^2}}{n}-overline{x}^2$$



Where $overlinesigma^2$ is the actual variance, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$ and $overline{x}$ is the actual mean as calculated above.



Note: The equation for calculating the actual variance is derived from the equation $sigma^2 = sum(x_i-mu_x)^2$ as to eliminate the need for the simulator to store a history of each rounds bet and winning values.










share|cite|improve this question











$endgroup$




Consider a game of chance were a player places a bet, and coin is flipped if the coin lands on heads the player wins $2b$ where $b$ is the bet value. If the coin lands on tails the player looses the bet. $E[V] = mu= 1$ for this game, where $V$ is the random amount we win. The $sigma^2 = 2.5$ for a bet of 1 according to the following equation:
$$sigma^2 = sum p_i(x_i-mu_x)^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-1 -mu)^2$$



How ever simulations have shown a convergence to $sigma^2 = 1$ or more generally $sigma^2$ converges according to (in the simulations):



$$sigma^2 = frac{1}{2}(2-mu)^2 + frac{1}{2}(-mu)^2$$



Where $w$ is the winning value and $b$ is the bet value. This is inconsistent and I'm sure i'm going wrong somewhere. Most probably in the way I'm calculating the actual variance. But I'm not sure how. Please can someone point out what I'm doing wrong and what would be the correct way.



The equations used in the simulation are as follows:



Equation used in computing the mean
$$overline{x}=frac{1}{n}sum_{i=1}^{n}{frac{w_i}{b_i}}$$
Where $overline{x}$ is the actual mean, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$.



Equation used in computing the actual variance
$$overlinesigma^2 = frac{sum_{i=1}^{n}{(frac{w_i}{b_i})^2}}{n}-overline{x}^2$$



Where $overlinesigma^2$ is the actual variance, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$ and $overline{x}$ is the actual mean as calculated above.



Note: The equation for calculating the actual variance is derived from the equation $sigma^2 = sum(x_i-mu_x)^2$ as to eliminate the need for the simulator to store a history of each rounds bet and winning values.







probability statistics probability-distributions variance gambling






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 24 at 2:12







MSD

















asked Jan 24 at 0:39









MSDMSD

84




84












  • $begingroup$
    I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
    $endgroup$
    – Brian Tung
    Jan 24 at 0:44












  • $begingroup$
    I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
    $endgroup$
    – lulu
    Jan 24 at 0:50












  • $begingroup$
    $x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
    $endgroup$
    – MSD
    Jan 24 at 0:59












  • $begingroup$
    $iin W$ where $W$ is all possible winning outcomes
    $endgroup$
    – MSD
    Jan 24 at 1:00












  • $begingroup$
    So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
    $endgroup$
    – lulu
    Jan 24 at 1:05




















  • $begingroup$
    I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
    $endgroup$
    – Brian Tung
    Jan 24 at 0:44












  • $begingroup$
    I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
    $endgroup$
    – lulu
    Jan 24 at 0:50












  • $begingroup$
    $x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
    $endgroup$
    – MSD
    Jan 24 at 0:59












  • $begingroup$
    $iin W$ where $W$ is all possible winning outcomes
    $endgroup$
    – MSD
    Jan 24 at 1:00












  • $begingroup$
    So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
    $endgroup$
    – lulu
    Jan 24 at 1:05


















$begingroup$
I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
$endgroup$
– Brian Tung
Jan 24 at 0:44






$begingroup$
I don't understand your first equation. Either $x_i$ is the net gain and is equal to either $-1$ or $1$ (and then $mu = 0$), or $x_i$ is the winnings and is equal to either $0$ or $2$ (and then $mu = 1$). But it seems as though you have $x_i$ equal to either $2$ or $-1$ with equal likelihood, but $mu = 1$.
$endgroup$
– Brian Tung
Jan 24 at 0:44














$begingroup$
I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
$endgroup$
– lulu
Jan 24 at 0:50






$begingroup$
I also don't understand the calculation of the mean. As I understand the game, if I bet $1$ then, with equal probability, I win $2$ or lose $1$. Thus my expected gain is $frac 12times 2-frac 12times 1=1-frac 12=frac 12$. No? If I have the payouts wrong, please state the correct ones clearly.
$endgroup$
– lulu
Jan 24 at 0:50














$begingroup$
$x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
$endgroup$
– MSD
Jan 24 at 0:59






$begingroup$
$x_i$ is amount won or lost as described on stat.yale.edu/Courses/1997-98/101/rvmnvar.htm and numerous other sources. Scroll down to the section of variance it's described in more detail (I was trying to avoid posting links as links can be broken). The value of $mu = 1$ is calculated using $overline{mu}=frac{1}{m}sum f_ix_i$ where $m$ is the number of possible positions or outcomes, $f_i$ is the number of positions with a specific winning outcome & $x_i$ is the multiplier of the bet for that outcome. In our case $m = 2$ for two possible outcomes, $f_i = 1$ and $x_i = 2$.
$endgroup$
– MSD
Jan 24 at 0:59














$begingroup$
$iin W$ where $W$ is all possible winning outcomes
$endgroup$
– MSD
Jan 24 at 1:00






$begingroup$
$iin W$ where $W$ is all possible winning outcomes
$endgroup$
– MSD
Jan 24 at 1:00














$begingroup$
So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
$endgroup$
– lulu
Jan 24 at 1:05






$begingroup$
So, what exact calculation do you do? In your post you say that the possible outcomes are $2,-1$. In your comment you say $2,1$ which I assume is a typo. Sticking with $2,-1$, don't you get the value $frac 12$? Your proposed mean $mu=1$ is quite a lot closer to $2$ then it is to $-1$. Phrased differently, I assume you disagree with the calculation I gave in my first comment, since you claim a different result. What part of my calculation is incorrect?
$endgroup$
– lulu
Jan 24 at 1:05












1 Answer
1






active

oldest

votes


















0












$begingroup$

Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.



Define $X_1, X_2, ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $Pr[X_i = 1] = p$ for $i = 1, 2, ldots$, and that $X_i = 1$ if the outcome of the $i^{rm th}$ toss corresponds to a win.



The expected value of the outcome of a single toss is $operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.



If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = begin{cases} 2b, & X_i = 1 \ -b, & X_i = 0. end{cases}$$ You may easily verify by substitution that this is true. Then $$operatorname{E}[Y_i] = operatorname{E}[(3X_i-1)b] = operatorname{E}[3X_i - 1]b = left(operatorname{E}[3X_i] - 1right)b = (3 operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$operatorname{Var}[Y_i] = b^2 operatorname{Var}[3X_i - 1] = b^2 operatorname{Var}[3X_i] = 9b^2 operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p in [0,1]$ and fixed ante $b$.



If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $mu = 1$ and $sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.



If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $operatorname{E}[W_i] = 2bp$ and $operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $operatorname{E}[W_i] = 1$ and $operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.



For a sample of fixed size $n$, the net winnings is $$S_Y = sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$bar Y = frac{S_Y}{n} = frac{1}{n} sum_{i=1}^n Y_i, quad bar W = frac{S_W}{n} = frac{1}{n}sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$operatorname{E}[S_Y] = noperatorname{E}[Y_i] = (3p-1)nb, quad operatorname{E}[S_W] = noperatorname{E}[W_i] = 2npb, \ operatorname{Var}[Y_i] = noperatorname{Var}[Y_i] = 9b^2 np(1-p), quad operatorname{Var}[W_i] = noperatorname{Var}[W_i] = 4b^2 np(1-p), \ operatorname{E}[bar Y] = operatorname{E}[S_Y/n] = operatorname{E}[Y_i], quad operatorname{E}[bar W] = operatorname{E}[W_i], \
operatorname{Var}[bar Y] = operatorname{Var}[S_Y/n] = operatorname{Var}[Y_i]/n, quad operatorname{Var}[bar W] = operatorname{Var}[S_W/n] = operatorname{Var}[W_i]/n.$$



If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.






share|cite|improve this answer









$endgroup$













    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3085278%2fvariance-equations-that-yield-inconsistent-results%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.



    Define $X_1, X_2, ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $Pr[X_i = 1] = p$ for $i = 1, 2, ldots$, and that $X_i = 1$ if the outcome of the $i^{rm th}$ toss corresponds to a win.



    The expected value of the outcome of a single toss is $operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.



    If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = begin{cases} 2b, & X_i = 1 \ -b, & X_i = 0. end{cases}$$ You may easily verify by substitution that this is true. Then $$operatorname{E}[Y_i] = operatorname{E}[(3X_i-1)b] = operatorname{E}[3X_i - 1]b = left(operatorname{E}[3X_i] - 1right)b = (3 operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$operatorname{Var}[Y_i] = b^2 operatorname{Var}[3X_i - 1] = b^2 operatorname{Var}[3X_i] = 9b^2 operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p in [0,1]$ and fixed ante $b$.



    If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $mu = 1$ and $sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.



    If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $operatorname{E}[W_i] = 2bp$ and $operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $operatorname{E}[W_i] = 1$ and $operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.



    For a sample of fixed size $n$, the net winnings is $$S_Y = sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$bar Y = frac{S_Y}{n} = frac{1}{n} sum_{i=1}^n Y_i, quad bar W = frac{S_W}{n} = frac{1}{n}sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$operatorname{E}[S_Y] = noperatorname{E}[Y_i] = (3p-1)nb, quad operatorname{E}[S_W] = noperatorname{E}[W_i] = 2npb, \ operatorname{Var}[Y_i] = noperatorname{Var}[Y_i] = 9b^2 np(1-p), quad operatorname{Var}[W_i] = noperatorname{Var}[W_i] = 4b^2 np(1-p), \ operatorname{E}[bar Y] = operatorname{E}[S_Y/n] = operatorname{E}[Y_i], quad operatorname{E}[bar W] = operatorname{E}[W_i], \
    operatorname{Var}[bar Y] = operatorname{Var}[S_Y/n] = operatorname{Var}[Y_i]/n, quad operatorname{Var}[bar W] = operatorname{Var}[S_W/n] = operatorname{Var}[W_i]/n.$$



    If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.






    share|cite|improve this answer









    $endgroup$


















      0












      $begingroup$

      Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.



      Define $X_1, X_2, ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $Pr[X_i = 1] = p$ for $i = 1, 2, ldots$, and that $X_i = 1$ if the outcome of the $i^{rm th}$ toss corresponds to a win.



      The expected value of the outcome of a single toss is $operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.



      If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = begin{cases} 2b, & X_i = 1 \ -b, & X_i = 0. end{cases}$$ You may easily verify by substitution that this is true. Then $$operatorname{E}[Y_i] = operatorname{E}[(3X_i-1)b] = operatorname{E}[3X_i - 1]b = left(operatorname{E}[3X_i] - 1right)b = (3 operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$operatorname{Var}[Y_i] = b^2 operatorname{Var}[3X_i - 1] = b^2 operatorname{Var}[3X_i] = 9b^2 operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p in [0,1]$ and fixed ante $b$.



      If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $mu = 1$ and $sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.



      If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $operatorname{E}[W_i] = 2bp$ and $operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $operatorname{E}[W_i] = 1$ and $operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.



      For a sample of fixed size $n$, the net winnings is $$S_Y = sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$bar Y = frac{S_Y}{n} = frac{1}{n} sum_{i=1}^n Y_i, quad bar W = frac{S_W}{n} = frac{1}{n}sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$operatorname{E}[S_Y] = noperatorname{E}[Y_i] = (3p-1)nb, quad operatorname{E}[S_W] = noperatorname{E}[W_i] = 2npb, \ operatorname{Var}[Y_i] = noperatorname{Var}[Y_i] = 9b^2 np(1-p), quad operatorname{Var}[W_i] = noperatorname{Var}[W_i] = 4b^2 np(1-p), \ operatorname{E}[bar Y] = operatorname{E}[S_Y/n] = operatorname{E}[Y_i], quad operatorname{E}[bar W] = operatorname{E}[W_i], \
      operatorname{Var}[bar Y] = operatorname{Var}[S_Y/n] = operatorname{Var}[Y_i]/n, quad operatorname{Var}[bar W] = operatorname{Var}[S_W/n] = operatorname{Var}[W_i]/n.$$



      If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.






      share|cite|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$

        Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.



        Define $X_1, X_2, ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $Pr[X_i = 1] = p$ for $i = 1, 2, ldots$, and that $X_i = 1$ if the outcome of the $i^{rm th}$ toss corresponds to a win.



        The expected value of the outcome of a single toss is $operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.



        If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = begin{cases} 2b, & X_i = 1 \ -b, & X_i = 0. end{cases}$$ You may easily verify by substitution that this is true. Then $$operatorname{E}[Y_i] = operatorname{E}[(3X_i-1)b] = operatorname{E}[3X_i - 1]b = left(operatorname{E}[3X_i] - 1right)b = (3 operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$operatorname{Var}[Y_i] = b^2 operatorname{Var}[3X_i - 1] = b^2 operatorname{Var}[3X_i] = 9b^2 operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p in [0,1]$ and fixed ante $b$.



        If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $mu = 1$ and $sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.



        If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $operatorname{E}[W_i] = 2bp$ and $operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $operatorname{E}[W_i] = 1$ and $operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.



        For a sample of fixed size $n$, the net winnings is $$S_Y = sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$bar Y = frac{S_Y}{n} = frac{1}{n} sum_{i=1}^n Y_i, quad bar W = frac{S_W}{n} = frac{1}{n}sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$operatorname{E}[S_Y] = noperatorname{E}[Y_i] = (3p-1)nb, quad operatorname{E}[S_W] = noperatorname{E}[W_i] = 2npb, \ operatorname{Var}[Y_i] = noperatorname{Var}[Y_i] = 9b^2 np(1-p), quad operatorname{Var}[W_i] = noperatorname{Var}[W_i] = 4b^2 np(1-p), \ operatorname{E}[bar Y] = operatorname{E}[S_Y/n] = operatorname{E}[Y_i], quad operatorname{E}[bar W] = operatorname{E}[W_i], \
        operatorname{Var}[bar Y] = operatorname{Var}[S_Y/n] = operatorname{Var}[Y_i]/n, quad operatorname{Var}[bar W] = operatorname{Var}[S_W/n] = operatorname{Var}[W_i]/n.$$



        If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.






        share|cite|improve this answer









        $endgroup$



        Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.



        Define $X_1, X_2, ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $Pr[X_i = 1] = p$ for $i = 1, 2, ldots$, and that $X_i = 1$ if the outcome of the $i^{rm th}$ toss corresponds to a win.



        The expected value of the outcome of a single toss is $operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.



        If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = begin{cases} 2b, & X_i = 1 \ -b, & X_i = 0. end{cases}$$ You may easily verify by substitution that this is true. Then $$operatorname{E}[Y_i] = operatorname{E}[(3X_i-1)b] = operatorname{E}[3X_i - 1]b = left(operatorname{E}[3X_i] - 1right)b = (3 operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$operatorname{Var}[Y_i] = b^2 operatorname{Var}[3X_i - 1] = b^2 operatorname{Var}[3X_i] = 9b^2 operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p in [0,1]$ and fixed ante $b$.



        If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $mu = 1$ and $sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.



        If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $operatorname{E}[W_i] = 2bp$ and $operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $operatorname{E}[W_i] = 1$ and $operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.



        For a sample of fixed size $n$, the net winnings is $$S_Y = sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$bar Y = frac{S_Y}{n} = frac{1}{n} sum_{i=1}^n Y_i, quad bar W = frac{S_W}{n} = frac{1}{n}sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$operatorname{E}[S_Y] = noperatorname{E}[Y_i] = (3p-1)nb, quad operatorname{E}[S_W] = noperatorname{E}[W_i] = 2npb, \ operatorname{Var}[Y_i] = noperatorname{Var}[Y_i] = 9b^2 np(1-p), quad operatorname{Var}[W_i] = noperatorname{Var}[W_i] = 4b^2 np(1-p), \ operatorname{E}[bar Y] = operatorname{E}[S_Y/n] = operatorname{E}[Y_i], quad operatorname{E}[bar W] = operatorname{E}[W_i], \
        operatorname{Var}[bar Y] = operatorname{Var}[S_Y/n] = operatorname{Var}[Y_i]/n, quad operatorname{Var}[bar W] = operatorname{Var}[S_W/n] = operatorname{Var}[W_i]/n.$$



        If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Jan 24 at 3:56









        heropupheropup

        64.6k764103




        64.6k764103






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3085278%2fvariance-equations-that-yield-inconsistent-results%23new-answer', 'question_page');
            }
            );

            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







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith