lkarch.org/tools/mathisfun/www.mathsisfun.com/data/random-variables-mean-variance.html
Lucas Kent e39465ad2f Changes to be committed:
new file:   Files/flashplayer_32_sa.exe
	new file:   favicon.ico
	new file:   globe.gif
	new file:   imgs/download.png
	new file:   imgs/zuck.jpg
	new file:   index.html
	new file:   other.ico
	new file:   script.js
	new file:   site.webmanifest
	new file:   sitemap.html
	new file:   styles/backround.css
	new file:   styles/border.css
	new file:   styles/fonts/Titillium_Web/OFL.txt
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf
	new file:   styles/fonts/webfontkit-20221027-163353/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2
	new file:   styles/fonts/webfontkit-20221027-165950/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2
	new file:   styles/style.css
	new file:   tools/2048/.gitignore
	new file:   tools/2048/.jshintrc
	new file:   tools/2048/CONTRIBUTING.md
	new file:   tools/2048/LICENSE.txt
	new file:   tools/2048/README.md
	new file:   tools/2048/Rakefile
	new file:   tools/2048/favicon.ico
	new file:   tools/2048/index.html
	new file:   tools/2048/js/animframe_polyfill.js
	new file:   tools/2048/js/application.js
	new file:   tools/2048/js/bind_polyfill.js
	new file:   tools/2048/js/classlist_polyfill.js
	new file:   tools/2048/js/game_manager.js
	new file:   tools/2048/js/grid.js
	new file:   tools/2048/js/html_actuator.js
	new file:   tools/2048/js/keyboard_input_manager.js
	new file:   tools/2048/js/local_storage_manager.js
	new file:   tools/2048/js/tile.js
    new file:   tools/2048/meta/apple-touch-icon.png
	new file:   tools/webretro/cores/neocd_libretro.js
	new file:   tools/webretro/cores/neocd_libretro.wasm
	new file:   tools/webretro/cores/nestopia_libretro.js
	new file:   tools/webretro/cores/nestopia_libretro.wasm
	new file:   tools/webretro/cores/o2em_libretro.js
	new file:   tools/webretro/cores/o2em_libretro.wasm
	new file:   tools/webretro/cores/opera_libretro.js
	new file:   tools/webretro/cores/opera_libretro.wasm
2022-11-02 08:40:01 -04:00

453 lines
16 KiB
HTML

<!doctype html>
<html lang="en">
<!-- #BeginTemplate "/Templates/Advanced.dwt" --><!-- DW6 -->
<!-- Mirrored from www.mathsisfun.com/data/random-variables-mean-variance.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:42:23 GMT -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- #BeginEditable "doctitle" -->
<title>Random Variables - Mean, Variance, Standard Deviation</title>
<meta name="description" content=" A Random Variable is a set of possible values from a random experiment." />
<!-- #EndEditable -->
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="HandheldFriendly" content="true">
<meta name="referrer" content="always">
<link rel="stylesheet" type="text/css" href="../style3.css">
<script src="../main3.js"></script>
</head>
<body id="bodybg" class="adv">
<div class="bg">
<div id="stt"></div>
<div id="hdr"></div>
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun"></a></div>
<div id="advText">Advanced</div>
<div id="gtran">
<script>document.write(getTrans());</script>
</div>
<div id="adTopOuter" class="centerfull noprint">
<div id="adTop">
<script>document.write(getAdTop());</script>
</div>
</div>
<div id="adHide">
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
<a href="../about-ads.html">About Ads</a></div>
</div>
<div id="menuWide" class="menu">
<script>document.write(getMenu(0));</script>
</div>
<div id="linkto">
<div id="linktort">
<script>document.write(getLinks());</script>
</div>
</div>
<div id="search" role="search">
<script>document.write(getSearch());</script>
</div>
<div id="menuSlim" class="menu">
<script>document.write(getMenu(1));</script>
</div>
<div id="menuTiny" class="menu">
<script>document.write(getMenu(2));</script>
</div>
<div id="extra"></div>
</div>
<div id="content" role="main">
<!-- #BeginEditable "Body" -->
<h1 style="text-align:center">
Random Variables: <br>
Mean, Variance and<br>
Standard Deviation </h1>
<p>A Random Variable is a set of <b>possible values</b> from a random experiment.</p>
<div class="example">
<h3>Example: Tossing a coin: we could get Heads or Tails. </h3>
<p> Let's give them the values <b>Heads=0</b> and <b>Tails=1</b> and we have a Random Variable &quot;X&quot;: </p>
<p class="center"><img src="images/random-variable-1.svg" alt="random variable 1" /></p>
</div>
<p>So: </p>
<ul>
<li>We have an <b>experiment</b> (like tossing a coin)</li>
<li>We give <b>values</b> to each event</li>
<li>The <b>set of values</b> is a <b>Random Variable</b></li>
</ul>
<p>Learn more at <a href="random-variables.html">Random Variables</a>.</p>
<h2>Mean, Variance and Standard Deviation</h2>
<div class="example"><p style="float:right; margin: 0 0 5px 10px;"><img src="images/die.jpg" width="120" height="118" alt="single die" /></p>
<h3>Example: Tossing a single <b>unfair</b> <a href="../geometry/fair-dice.html">die</a></h3>
<p>For fun, imagine a <b>weighted</b> die (cheating!) so we have these probabilities:</p>
<table border="0" align="center">
<tr class="large">
<td width="60" align="center">1</td>
<td width="60" align="center">2</td>
<td width="60" align="center">3</td>
<td width="60" align="center">4</td>
<td width="60" align="center">5</td>
<td width="60" align="center">6</td>
</tr>
<tr>
<td align="center"><b>0.1</b></td>
<td align="center"><b>0.1</b></td>
<td align="center"><b>0.1</b></td>
<td align="center"><b>0.1</b></td>
<td align="center"><b>0.1</b></td>
<td align="center"><b>0.5</b></td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<h3>Mean or Expected Value: <span class="large">&mu;</span></h3>
<p>When we know the probability <b>p</b> of every value <b>x</b> we can calculate the Expected Value (Mean) of X:</p>
<div class="def">
<p class="center"><span class="large">&mu; = &Sigma;xp</span></p>
</div>
<p class="center">Note: <b>&Sigma;</b> is <a href="../algebra/sigma-notation.html"> Sigma Notation</a>, and means to sum up.</p>
<p>To calculate the Expected Value:</p>
<ul>
<li>multiply each value by its probability</li>
<li>sum them up</li>
</ul>
<div class="example">
<p style="float:right; margin: 0 0 5px 10px;"><img src="images/die.jpg" width="120" height="118" alt="single die" /></p>
<h3>Example continued:</h3>
<table border="0" align="center">
<tr class="large">
<td width="60" align="center">x</td>
<td width="60" align="center">1</td>
<td width="60" align="center">2</td>
<td width="60" align="center">3</td>
<td width="60" align="center">4</td>
<td width="60" align="center">5</td>
<td width="60" align="center">6</td>
</tr>
<tr>
<td align="center">p</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.5</td>
</tr>
<tr>
<td align="center">xp</td>
<td align="center">0.1</td>
<td align="center">0.2</td>
<td align="center">0.3</td>
<td align="center">0.4</td>
<td align="center">0.5</td>
<td align="center">3</td>
</tr>
</table>
<p class="large">&mu; = &Sigma;xp</span></span> = 0.1+0.2+0.3+0.4+0.5+3 = 4.5</p>
<p>The expected value is 4.5</p>
</div>
<p>Note: this is a <a href="weighted-mean.html">weighted mean</a>: values with higher probability have higher contribution to the mean.</p>
<p>&nbsp;</p>
<h3>&nbsp;</h3>
<h3>Variance: <span class="large">Var(X) </span></h3>
<p>The Variance is:</p>
<div class="def">
<p class="center"><span class="large">Var(X) = &Sigma;x<sup>2</sup>p &minus; &mu;<sup>2</sup></span></p>
</div>
<p>To calculate the <span class="center">Variance</span>:</p>
<ul>
<li>square each value and multiply by its probability</li>
<li>sum them up and we get <b>&Sigma;x<sup>2</sup>p</b></li>
<li>then subtract the square of the Expected Value <b>&mu;<sup>2</sup></b></li>
</ul>
<div class="example">
<p style="float:right; margin: 0 0 5px 10px;"><img src="images/die.jpg" width="120" height="118" alt="single die" /></p>
<h3>Example continued:</h3>
<table border="0" align="center">
<tr class="large">
<td width="60" align="center">x</td>
<td width="60" align="center">1</td>
<td width="60" align="center">2</td>
<td width="60" align="center">3</td>
<td width="60" align="center">4</td>
<td width="60" align="center">5</td>
<td width="60" align="center">6</td>
</tr>
<tr>
<td align="center">p</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.5</td>
</tr>
<tr>
<td align="center">x<sup>2</sup>p</td>
<td align="center">0.1</td>
<td align="center">0.4</td>
<td align="center">0.9</td>
<td align="center">1.6</td>
<td align="center">2.5</td>
<td align="center">18</td>
</tr>
</table>
<p>&Sigma;x<sup>2</sup>p = 0.1+0.4+0.9+1.6+2.5+18 = 23.5</p>
<p class="large">Var(X) = &Sigma;x<sup>2</sup>p &minus; &mu;<sup>2</sup> = 23.5&nbsp;- 4.5<sup>2</sup> = 3.25</p>
<p>The variance is 3.25</p>
</div>
<p>&nbsp;</p>
<h3>Standard Deviation: <span class="large">&sigma;</span></h3>
<p>The Standard Deviation is the square root of the Variance:</p>
<div class="def">
<p class="center"><span class="large">&sigma; = &radic;Var(X)</span></p>
</div>
<div class="example">
<p style="float:right; margin: 0 0 5px 10px;"><img src="images/die.jpg" width="120" height="118" alt="single die" /></p>
<h3>Example continued:</h3>
<table border="0" align="center">
<tr class="large">
<td width="60" align="center">x</td>
<td width="60" align="center">1</td>
<td width="60" align="center">2</td>
<td width="60" align="center">3</td>
<td width="60" align="center">4</td>
<td width="60" align="center">5</td>
<td width="60" align="center">6</td>
</tr>
<tr>
<td align="center">p</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.1</td>
<td align="center">0.5</td>
</tr>
<tr>
<td align="center">x<sup>2</sup>p</td>
<td align="center">0.1</td>
<td align="center">0.4</td>
<td align="center">0.9</td>
<td align="center">1.6</td>
<td align="center">2.5</td>
<td align="center">18</td>
</tr>
</table>
<p class="large">&sigma; = &radic;Var(X) = &radic;3.25 = 1.803...</p>
<p>The Standard Deviation&nbsp;is 1.803...</p>
</div>
<p>&nbsp;</p>
<p>Let's have another example!</p>
<p>(Note that we run the table downwards instead of along this time.)</p>
<div class="example">
<p style="float:left; margin: 0 10px 5px 0;"><img src="images/fried-chicken.jpg" width="153" height="90" alt="fried chicken" /></p>
<h3>You plan to open a new McDougals Fried Chicken, and found these stats for similar restaurants:</h3>
<table border="0" align="center">
<tr>
<th width="80" align="center">Percent</th>
<th width="150">Year's Earnings</th>
</tr>
<tr>
<td align="center">20%</td>
<td>$50,000 Loss</td>
</tr>
<tr>
<td align="center">30%</td>
<td>$0</td>
</tr>
<tr>
<td align="center">40%</td>
<td>$50,000 Profit</td>
</tr>
<tr>
<td align="center">10%</td>
<td>$150,000 Profit</td>
</tr>
</table>
<p>Using that as <b>probabilities</b> for your new restaurant's profit, what is the Expected Value and Standard Deviation?</p>
<p>&nbsp;</p>
<p>The Random Variable is X = 'possible profit'.</p>
<p>Sum up <b>xp</b> and <b>x<sup>2</sup>p</b>:</p>
<div class="beach">
<table border="0" align="center">
<tr>
<th align="center">Probability<br />
p</th>
<th width="150" align="center">Earnings ($'000s)<br />
x</th>
<th width="120" align="right"><br />
xp</th>
<th width="150" align="right"><br />
x<sup>2</sup>p</th>
</tr>
<tr>
<td align="center">0.2</td>
<td align="center">-50</td>
<td width="120" align="right">-10</td>
<td align="right">500</td>
</tr>
<tr>
<td align="center">0.3</td>
<td align="center">0</td>
<td width="120" align="right">0</td>
<td align="right">0</td>
</tr>
<tr>
<td align="center">0.4</td>
<td align="center">50</td>
<td width="120" align="right">20</td>
<td align="right">1000</td>
</tr>
<tr>
<td align="center">0.1</td>
<td align="center">150</td>
<td width="120" align="right">15</td>
<td align="right">2250</td>
</tr>
<tr>
<td height="23" align="center"><span class="center larger">&Sigma;p = 1</span></td>
<td align="center">&nbsp;</td>
<td width="120" align="right"><span class="center larger">&Sigma;xp = 25</span> </td>
<td align="right"><span class="center larger">&Sigma;x<sup>2</sup>p = 3750</span></td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p class="center larger">&mu; = Σxp = <b>25</b></p>
<p class="center larger">Var(X) = &Sigma;x<sup>2</sup>p &minus; &mu;<sup>2</sup> <br>
= 3750 &minus; 25<sup>2</sup> <br>
= 3750 &minus; 625 <br>
= <b>3125</b></p>
<p class="center larger">&sigma; = &radic;3125 = <b>56</b> (to nearest whole number)</p>
<p>But remember these are in thousands of dollars, so:</p>
<ul>
<li>&mu; = $25,000</li>
<li>&sigma; = $56,000</li>
</ul>
<p>So you might expect to make $25,000, but with a very wide deviation possible.</p>
</div>
<p>Let's try that again, but with a much higher probability for $50,000:</p>
<div class="example">
<h3>Example (continued):</h3>
<p>Now with different probabilities (the $50,000 value has a high probability of <b>0.7</b> now):</p>
<div class="beach">
<table border="0" align="center">
<tr>
<th align="center">Probability<br />
p</th>
<th width="150" align="center">Earnings ($'000s)<br />
x</th>
<th width="120" align="right"><br />
xp</th>
<th width="150" align="right"><br />
x<sup>2</sup>p</th>
</tr>
<tr>
<td align="center">0.1</td>
<td align="center">-50</td>
<td width="120" align="right">-5</td>
<td align="right">250</td>
</tr>
<tr>
<td align="center">0.1</td>
<td align="center">0</td>
<td width="120" align="right">0</td>
<td align="right">0</td>
</tr>
<tr>
<td align="center">0.7</td>
<td align="center">50</td>
<td width="120" align="right">35</td>
<td align="right">1750</td>
</tr>
<tr>
<td align="center">0.1</td>
<td align="center">150</td>
<td width="120" align="right">15</td>
<td align="right">2250</td>
</tr>
<tr>
<td height="23" align="center"><span class="center larger">&Sigma;p = 1</span></td>
<td align="center">Sums:</td>
<td width="120" align="right"><span class="center larger">&Sigma;xp = 45</span></td>
<td align="right"><span class="center larger">&Sigma;x<sup>2</sup>p = 4250</span></td>
</tr>
</table>
</div>
<p>&nbsp;</p>
<p class="center larger">&mu; = Σxp = <b>45</b></p>
<p class="center larger">Var(X) = &Sigma;x<sup>2</sup>p &minus; &mu;<sup>2</sup> <br>
= 4250 &minus; 45<sup>2</sup> <br>
= 4250 &minus; 2025 <br>
= <b>2225</b></p>
<p class="center larger">&sigma; = &radic;2225 = <b>47</b> (to nearest whole number)</p>
<p>In thousands of dollars:</p>
<ul>
<li>&mu; = $45,000</li>
<li>&sigma; = $47,000</li>
</ul>
<p>The mean is now much closer to the most probable value.</p>
<p>And the standard deviation is a little smaller (showing that the values are more central.)<b></b></p>
</div>
<p>&nbsp;</p>
<h2>Continuous</h2>
<p>Random Variables can be either <a href="data-discrete-continuous.html"><span><span style="text-decoration:underline">Discrete
or Continuous</span></span></a>:</p>
<ul>
<li>Discrete Data can only take certain values (such as 1,2,3,4,5) </li>
<li>Continuous Data can take any value within a range (such as a person's height)</li>
</ul>
<p>Here we looked only at discrete data, as finding the Mean, Variance and Standard Deviation of continuous data needs <a href="../calculus/integration-introduction.html"><span><span style="text-decoration:underline">Integration</span></span></a>.</p>
<p>&nbsp;</p>
<h2>Summary</h2>
<div>
<ul class="larger">
<li>A <span style="font-weight:bold">Random
Variable</span> is a variable whose possible values are numerical outcomes
of a random experiment.</li>
<li>The <b>Mean</b> (Expected
Value) is: <span class="large">&mu; = &Sigma;xp</span></li>
<li>The <span style="font-weight:bold">Variance</span> is: <span class="center"><span class="large">Var(X) = &Sigma;x<sup>2</sup>p &minus; &mu;<sup>2</sup></span></span></li>
<li>The <b>Standard Deviation</b> is: <span class="center"><span class="large">&sigma; = &radic;Var(X)</span></span></li>
</ul>
</div>
<p>&nbsp;</p>
<div class="questions">
<script>getQ(8878, 8879, 8880, 8881, 8882, 8883, 8884, 8885, 8886, 8887);</script>&nbsp;
</div>
<div class="related">
<a href="random-variables.html">Random Variables</a>
<a href="index.html">Data Index</a>
</div>
<!-- #EndEditable -->
</div>
<div id="adend" class="centerfull noprint">
<script>document.write(getAdEnd());</script>
</div>
<div id="footer" class="centerfull noprint">
<script>document.write(getFooter());</script>
</div>
<div id="copyrt">
Copyright &copy; 2020 MathsIsFun.com
</div>
<script>document.write(getBodyEnd());</script>
</body>
<!-- Mirrored from www.mathsisfun.com/data/random-variables-mean-variance.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:42:24 GMT -->
</html>