{"categories":["Probability Theory"],"contentHtml":"<h3>Week 4</h3><h4>Lecture Notes</h4><p>We will be covering discrete random variables this week.</p><p>A discrete random variable is one whose image <math><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></math> is a finite/countable subset of <math><mi>ℝ</mi></math>.</p><p>First thing we introduce is the probability mass function (pmf).</p><p>It is basically the probability measure assigned to a single value: <math><msub><mi>𝑃</mi><mi>𝑋</mi></msub><mo form=\"prefix\" stretchy=\"false\">(</mo><mrow><mo>{</mo><mi>𝑥</mi><mo>}</mo></mrow><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>Because of the law of total probability, the probability of all outcomes must sum to 1:</p><p><math><msub><mo lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mn>1</mn><mi>.</mi></math></p><p>Next thing is the cumulative distribution function (cdf).</p><p>Usually use the capital F to denote this: <math><mi>𝐹</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑡</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>≤</mo><mi>𝑡</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">∩</mo><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">≤</mo><mi>𝑡</mi></mrow></msub><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>A simple example for a discrete random variable is that if you roll a die, the outcome of the die will give you a discrete random variable. If I’m interested in <math><mi>𝐹</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>3</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>≤</mo><mn>3</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>+</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>+</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>3</mn><mo stretchy=\"false\">)</mo></math></p><p>Another example:</p><p>We denote <math><mi>𝑋</mi></math> as the number of times we roll the die until we get the outcome 6. If we’re lucky and roll the die once to get a 6, what’s the probability? For a fair die it’s <math><mfrac><mn>1</mn><mn>6</mn></mfrac></math>. For the second roll, <math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mfrac><mn>5</mn><mn>6</mn></mfrac><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mn>6</mn></mfrac><mo>=</mo><mfrac><mn>5</mn><mn>36</mn></mfrac></math>: the first roll is not 6 and the second roll is 6.</p><p>The outcome of the first roll does not affect the second roll.</p><p>More difficult one, <math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>3</mn><mo stretchy=\"false\">)</mo></math></p><p><math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mn>3</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mfrac><mn>5</mn><mn>6</mn></mfrac><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>5</mn><mn>6</mn></mfrac><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mn>6</mn></mfrac></math></p><p>You can prove by induction that the formula is</p><p><math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑛</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><msup><mrow><mo>(</mo><mfrac><mn>5</mn><mn>6</mn></mfrac><mo>)</mo></mrow><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mn>6</mn></mfrac><mo>,</mo><mn>1</mn><mo>≤</mo><mi>𝑛</mi></math></p><p>This is a simple example.</p><p>I want to say a property of the cdf:</p><p>If you have <math><mi>𝑋</mi><mo lspace=\"0.2777777777777778em\" rspace=\"0.2777777777777778em\">:</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">→</mo><mi>ℝ</mi></math> is a discrete r.v., the cdf <math><mi>𝐹</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑡</mi><mo stretchy=\"false\">)</mo></math> is piecewise constant and has finite/countable jumps.</p><p>If you think about cdf, it’s a probability that lies from 0 to 1.</p><p>The graph of discrete cdf is exclusive coming from the right side, so the hole is on the bottom of the jump, not the top. We accumulate in a discrete ways, which makes it like a staircase. Each piece corresponds to a constant value, and there are finite jumps.</p><p>For simplicity, we will denote the following notations:</p><p><math><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mrow><mo>{</mo><mrow><msub><mi>𝑎</mi><mn>1</mn></msub><mo>,</mo><msub><mi>𝑎</mi><mn>2</mn></msub><mo>,</mo><msub><mi>𝑎</mi><mn>3</mn></msub><mo>,</mo><mi>…</mi></mrow><mo>}</mo></mrow></math></p><p><math><msub><mi>𝑝</mi><mi>𝑖</mi></msub><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><msub><mi>𝑎</mi><mi>𝑖</mi></msub><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>,</mo><mi>𝑖</mi><mo>=</mo><mn>1</mn></math></p><h5>Moments</h5><p>Moments are expectations, expectations are kind of like intervals in calculus. Here we are talking about discrete random variables, so our integration is basically a summation. In the next class we are going to talk about continuous, where the integral is an integral. Integrals is approximated by the Riemann sum, and there are many techniques for evaluating them. But right now we are sticking to summations.</p><p>Let’s define the expectation, by definition 4.7.</p><p>If you have a discrete r.v. <math><mi>𝑋</mi></math>, we say <math><mi>𝑋</mi></math> is integrable if</p><p><math><msub><mo lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>&lt;</mo><mi>∞</mi></math></p><p>If you map this to what you learned in calculus, this is <strong>absolute integrability</strong>. You know that if you are absolutely integrable, you are regular integrable. Why absolute value? This <math><mi>𝑥</mi></math> can take positive or negative values. If this holds, we can define expectation as</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝑥</mi><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>In order to help you understand this from a discrete random variable notation, you can put this in a table format.</p><p><math><mi>𝑋</mi><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">{</mo><mtext>outcome</mtext><mspace width=\"0.2222em\"></mspace><mtext>probability</mtext><mspace width=\"0.2222em\"></mspace><msub><mi>𝑎</mi><mn>1</mn></msub><msub><mi>𝑝</mi><mn>1</mn></msub><mspace width=\"0.2222em\"></mspace><msub><mi>𝑎</mi><mn>2</mn></msub><msub><mi>𝑝</mi><mn>2</mn></msub></math></p><p>This will be a handy tool when doing calculations.</p><p>This summation is purely rigorous.</p><p>We need the non-absolute value sum to be less, because the probability cannot be negative. I’m not just saying that the expectation is finite. I’m saying that the expectation is bounded by something finite. <math><mi>𝑋</mi><mo>&lt;</mo><mi>∞</mi></math> is very different from <math><mi>𝑋</mi><mo>&lt;</mo><mi>𝑌</mi><mo>&lt;</mo><mi>∞</mi></math>. The second one means that the value is bounded away from infinity, where <math><mi>𝑌</mi></math> is the ceiling. The first one means you can approach infinity. This is important for mathematical analysis.</p><p>Proposition 4.8 says a property of the expectation is that expectation is linear. If you learn functional analysis (calculus on functions), you understand that expectation is a linear operator. The statement is this: <math><mi>𝕖</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑎</mi><mi>𝑋</mi><mo>+</mo><mi>𝑏</mi><mi>𝑌</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝑎</mi><mi>𝐸</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>+</mo><mi>𝑏</mi><mi>𝐸</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑌</mi><mo stretchy=\"false\">]</mo></math> where <math><mi>𝑎</mi></math> and <math><mi>𝑏</mi></math> are constants in <math><mi>ℝ</mi></math>.</p><p>How do we prove this?</p><p>We want to first establish that <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑎</mi><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝑎</mi><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo stretchy=\"false\">]</mo></math></p><p>There are two cases. When <math><mi>𝑎</mi><mo>=</mo><mn>0</mn></math>, this is trivial because <math><mi>𝑋</mi></math> becomes 0. How do you prove for <math><mi>𝑎</mi><mo>≠</mo><mn>0</mn></math>?</p><p>We will define <math><mi>𝑍</mi><mo>=</mo><mi>𝑎</mi><mi>𝑋</mi></math>. From the definition of a discrete random variable, its image set must be a countable subset of <math><mi>ℝ</mi></math>. Therefore, <math><mi>𝑍</mi></math> is a discrete random variable. This implies that <math><mi>𝑍</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></math> is countable. This is important because anything countable can be represented as a sum. <math><mi>𝜋</mi></math> is uncountable and cannot be represented by a summation.</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑍</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑎</mi><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑍</mi><mo>=</mo><mi>𝑎</mi><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>by the simple definition of expectation.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><msub><mo form=\"prefix\" lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑎</mi><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑎</mi><mi>𝑋</mi><mo>=</mo><mi>𝑎</mi><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>I’m going to factor out the <math><mi>𝑎</mi></math>, which we can do because we know <math><mi>𝑎</mi><mo>≠</mo><mn>0</mn></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑎</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><msub><mo form=\"prefix\" rspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">|</mo><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><p>Based on our definition 4.7, we can say that this is less than infinity.</p><p>Then we can formally write down <math><mi>𝑍</mi></math> without absolute value, since it’s bounded finitely.</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑍</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝑎</mi><mi>𝑥</mi><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑍</mi><mo>=</mo><mi>𝑎</mi><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑎</mi><msub><mo form=\"prefix\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝑥</mi><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑎</mi><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo stretchy=\"false\">]</mo></math></p><p>This might seem silly, but we need to be rigorous in math when proving things.</p><p>Now we want to prove <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑎</mi><mi>𝑋</mi><mo>+</mo><mi>𝑏</mi><mi>𝑌</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑎</mi><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>+</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑎</mi><mi>𝑌</mi><mo stretchy=\"false\">]</mo></math></p><p>The proof is too long, has too much rigor, uses some techniques of interchanging the summation signs.</p><p>Second part of proposition is that if <math><mi>𝑋</mi><mo>≥</mo><mn>0</mn></math>, then <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>≥</mo><mn>0</mn></math>. If the random variable is greater than 0, then the expectation is greater than 0. The simple proof is that</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝑥</mi><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>≥</mo><mn>0</mn></math></p><p>If <math><mi>𝑋</mi><mo>&gt;</mo><mi>𝑌</mi></math>, then <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>≥</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑌</mi><mo stretchy=\"false\">]</mo></math>, where we can show that the difference is positive</p><p>Theorem 4.9 the transfer formula says that for <math><mi>𝑋</mi></math> discrete r.v., where <math><mi>𝜑</mi><mo lspace=\"0.2777777777777778em\" rspace=\"0.2777777777777778em\">:</mo><mi>ℝ</mi><mo stretchy=\"false\">→</mo><mi>ℝ</mi></math> is a measurable function, then <math><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo stretchy=\"false\">)</mo></math> is a r.v. and is integrable iff</p><p><math><msub><mo lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">|</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>&lt;</mo><mi>∞</mi></math></p><p>In this case I can formally write down the expectation to be the sum</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑥</mi><mo lspace=\"0em\" rspace=\"0em\">∈</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo stretchy=\"false\">)</mo></mrow></msub><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑥</mi><mo stretchy=\"false\">)</mo></math></p><h5>Examples</h5><p>Here are some examples:</p><p>If we have a discrete r.v.</p><p><math><mi>𝑋</mi><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">{</mo><mn>1</mn><mn>0.2</mn><mspace width=\"0.2222em\"></mspace><mn>2</mn><mn>0.3</mn><mspace width=\"0.2222em\"></mspace><mn>3</mn><mn>0.5</mn><mo>,</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo rspace=\"0em\">=</mo><mo separator=\"true\" lspace=\"0em\" rspace=\"0em\">?</mo></math></p><p>You multiply horizontally and add them all up.</p><p>Represented in the cases format,</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><msub><mi>𝑎</mi><mi>𝑖</mi></msub><msub><mi>𝑝</mi><mi>𝑖</mi></msub></math></p><p>For a measurable function <math><mi>𝜑</mi></math>,</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><msub><mi>𝑎</mi><mi>𝑖</mi></msub><mo form=\"postfix\" stretchy=\"false\">)</mo><msub><mi>𝑝</mi><mi>𝑖</mi></msub></math></p><p>You only change the outcome, not the probability.</p><p>In this example,</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mn>1</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.2</mn><mo>+</mo><mn>2</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.3</mn><mo>+</mo><mn>3</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.5</mn><mo>=</mo><mn>2.3</mn></math>.</p><p>What if we take <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo stretchy=\"false\">]</mo></math>?</p><p>The square is a measurable function, so we can consider <math><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><msup><mi>𝑋</mi><mn>2</mn></msup></math></p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝜑</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msup><mn>1</mn><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.2</mn><mo>+</mo><msup><mn>2</mn><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.3</mn><mo>+</mo><msup><mn>3</mn><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>0.5</mn><mo>=</mo><mn>5.9</mn></math></p><p>We can go a little crazier and talk about <math><mi>𝜑</mi><mo>=</mo><mo form=\"prefix\" lspace=\"0em\" rspace=\"0.16666666666666666em\">sin</mo><mi>𝑋</mi></math></p><p>In all our examples, all of our functions are measurable. In terms of mathematical analysis, you might be interested in functions that are not measurable. But we don’t have to worry about that in our class.</p><h5>Variance</h5><p>The variance of a r.v. is defined to be</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝔼</mi><mrow><mo>[</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></mrow><mo>]</mo></mrow></math></p><p>There is an intuitive explanation for this definition. How do you measure the variability if numbers in a set? What you do is take the expected value of the numbers in the set.</p><p>Let’s say we have a sequence <math><mo stretchy=\"false\">(</mo><msub><mi>𝑥</mi><mn>1</mn></msub><mo>,</mo><msub><mi>𝑥</mi><mn>2</mn></msub><mo>,</mo><mi>…</mi><mo>,</mo><msub><mi>𝑥</mi><mi>𝑛</mi></msub><mo stretchy=\"false\">)</mo></math></p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msub><mi>𝑥</mi><mn>1</mn></msub><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo>+</mo><msub><mi>𝑥</mi><mn>2</mn></msub><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo>+</mo><mi>…</mi><mo>+</mo><msub><mi>𝑥</mi><mi>𝑛</mi></msub><mfrac><mn>1</mn><mi>𝑛</mi></mfrac></math></p><p>We want to measure the distance from each data point to the middle point. The distance of each variable to that middle point is what we are counting. We square them because the difference might be positive or negative, so it makes them all 0.</p><p>What happens if we don’t square it?</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo>−</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mn>0</mn></math></p><p>If you do some simple arithmetics, you can see the simple binomial expansion as</p><p><math><mo stretchy=\"false\">(</mo><mi>𝑎</mi><mo>+</mo><mi>𝑏</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo>=</mo><msup><mi>𝑎</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><mi>𝑎</mi><mi>𝑏</mi><mo>+</mo><msup><mi>𝑏</mi><mn>2</mn></msup></math></p><p>and if we apply this to our variance, we get</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo>−</mo><mn>2</mn><mi>𝑋</mi><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>+</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo stretchy=\"false\">]</mo></math></p><p>expected value of an expected value is the same thing because it’s just a constant</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mn>2</mn><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>+</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo>≥</mo><mn>0</mn></math></p><p>This is Jensen’s inequality, which shows the convexity of variance.</p><p>There are two operations, we take square, then expectation, and for the other, we take expectation first, then square. And this difference must be greater than or equal to 0.</p><p>Eventually, everything becomes calculus.</p><p>Definition 4.12 is of standard deviation, or std dev.</p><p><math><mi>𝜎</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><msqrt><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo stretchy=\"false\">)</mo></msqrt><mo>=</mo><msqrt><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></msqrt></math></p><p>This identity is very important:</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>+</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></math></p><p>This is very convenient for our calculations. Let’s think about calculating the variance for the cases format. Assuming this format, we can represent</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><msubsup><mi>𝑎</mi><mi>𝑖</mi><mn>2</mn></msubsup><msub><mi>𝑝</mi><mi>𝑖</mi></msub><mo>−</mo><msup><mrow><mo>(</mo><mrow><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><msub><mi>𝑎</mi><mi>𝑖</mi></msub><msub><mi>𝑝</mi><mi>𝑖</mi></msub></mrow><mo>)</mo></mrow><mn>2</mn></msup></math></p><p>That’s it. This is the formula to use on homework. USEFUL</p><p>This has all been theoretical, abstract concepts. From now on we are going to talk about examples of discrete random variables.</p><p>We are going to go through several classes of random variables.</p><h5>Discrete Uniform Distribution</h5><p>The discrete uniform distribution has all the values being the same.</p><p><math><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mrow><mo>{</mo><mrow><msub><mi>𝑥</mi><mn>1</mn></msub><mo>,</mo><msub><mi>𝑥</mi><mn>2</mn></msub><mo>,</mo><mi>…</mi><mo>,</mo><msub><mi>𝑥</mi><mi>𝑛</mi></msub></mrow><mo>}</mo></mrow></math> and pmf is given by</p><p><math><msub><mi>𝑝</mi><mi>𝑖</mi></msub><mo>=</mo><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><msub><mi>𝑥</mi><mi>𝑖</mi></msub><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo>,</mo><mo form=\"prefix\">∀</mo><mi>𝑖</mi><mo>∈</mo><mrow><mo>{</mo><mrow><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mi>…</mi><mo>,</mo><mi>𝑛</mi></mrow><mo>}</mo></mrow></math></p><p>we denote this as</p><p><math><mi>𝑋</mi><mo>∼</mo><mi>𝐷</mi><mi>𝑈</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo stretchy=\"false\">)</mo></math> If you roll a fair die, the outcome of a die is a discrete uniform distribution. What is our cdf?</p><p><math><mi>𝐹</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑡</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">{</mo><mn>0</mn><mspace width=\"0.2222em\"></mspace><mtext>if </mtext><mspace width=\"0.2222em\"></mspace><mi>𝑡</mi><mo>&lt;</mo><mn>1</mn><mspace width=\"0.2222em\"></mspace><mfrac><mi>𝑖</mi><mn>6</mn></mfrac><mspace width=\"0.2222em\"></mspace><mtext>if </mtext><mspace width=\"0.2222em\"></mspace><mi>𝑖</mi><mo>≤</mo><mi>𝑡</mi><mo>≤</mo><mi>𝑖</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>𝑖</mi><mo>=</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mn>3</mn><mo>,</mo><mn>4</mn><mo>,</mo><mn>5</mn><mspace width=\"0.2222em\"></mspace><mn>1</mn><mspace width=\"0.2222em\"></mspace><mtext>if </mtext><mspace width=\"0.2222em\"></mspace><mi>𝑡</mi><mo>≥</mo><mn>6</mn></math> Let’s look at expected value (in general, not just for fair die)</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑖</mi><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac></math></p><p>Let’s make this clear that the image set is <math><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi mathvariant=\"normal\">Ω</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mrow><mo>{</mo><mrow><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mn>3</mn><mo>,</mo><mi>…</mi><mo>,</mo><mi>𝑛</mi></mrow><mo>}</mo></mrow></math></p><p>Then we can determine the high school mathematics by taking the variable outside.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>+</mo><mn>2</mn><mo>+</mo><mn>3</mn><mo>+</mo><mi>…</mi><mo>+</mo><mi>𝑛</mi><mo stretchy=\"false\">)</mo></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mfrac><mrow><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mn>2</mn></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></math></p><p>Now let’s look at the variance.</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><msup><mi>𝑖</mi><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo>=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><msubsup><mo form=\"prefix\">∑</mo><mrow><mi>𝑖</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><msup><mi>𝑖</mi><mn>2</mn></msup></math></p><p>By the same summation property</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mo form=\"prefix\" stretchy=\"false\">(</mo><msup><mn>1</mn><mn>2</mn></msup><mo>+</mo><msup><mn>2</mn><mn>2</mn></msup><mo>+</mo><mi>…</mi><mo>+</mo><msup><mi>𝑛</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mfrac><mn>1</mn><mi>𝑛</mi></mfrac><mfrac><mrow><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>2</mn><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mn>6</mn></mfrac><mo>=</mo><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>2</mn><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mn>6</mn></mfrac></math></p><p>To get the full variance we have</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo>=</mo><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>2</mn><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mn>6</mn></mfrac><mo>−</mo><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></mrow><mn>4</mn></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mrow><mn>2</mn><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>2</mn><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>3</mn><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></mrow><mn>12</mn></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mn>1</mn><mn>12</mn></mfrac><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>4</mn><msup><mi>𝑛</mi><mn>2</mn></msup><mo>+</mo><mn>6</mn><mi>𝑛</mi><mo>+</mo><mn>2</mn><mo>−</mo><mn>3</mn><msup><mi>𝑛</mi><mn>2</mn></msup><mo>−</mo><mn>6</mn><mi>𝑛</mi><mo>−</mo><mn>3</mn><mo stretchy=\"false\">)</mo></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mn>1</mn><mn>12</mn></mfrac><mo form=\"prefix\" stretchy=\"false\">(</mo><msup><mi>𝑛</mi><mn>2</mn></msup><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></math></p><h5>Bernoulli Distribution</h5><p><math><mi>𝑋</mi><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">{</mo><mn>1</mn><mi>𝑝</mi><mspace width=\"0.2222em\"></mspace><mn>0</mn><mn>1</mn><mo>−</mo><mi>𝑝</mi></math> We will denote <math><mi>𝑋</mi><mspace width=\"0.2222em\"></mspace><mtext> Bernoulli</mtext><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math>.</p><p>The most obvious example is flipping a coin. Our expectation is very simple.</p><p><math><mi>𝕡</mi><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac></math></p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mn>1</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mi>𝑝</mi><mo>+</mo><mn>0</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑝</mi></math></p><p>For variance, it is</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msup><mn>1</mn><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mi>𝑝</mi><mo>+</mo><msup><mn>0</mn><mn>2</mn></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝑝</mi></math></p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo>=</mo><mi>𝑝</mi><mo>−</mo><msup><mi>𝑝</mi><mn>2</mn></msup><mo>=</mo><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math></p><h5>Binomial Distribution</h5><p>This can be thought of as the sum of independent Bernoulli random variables. We will consider our pmf as</p><p><math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">{</mo><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup><mspace width=\"0.2222em\"></mspace><mtext>if </mtext><mspace width=\"0.2222em\"></mspace><mi>𝑘</mi><mo>∈</mo><mrow><mo>{</mo><mrow><mn>0</mn><mo>,</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mi>…</mi><mo>,</mo><mi>𝑛</mi></mrow><mo>}</mo></mrow><mspace width=\"0.2222em\"></mspace><mn>0</mn><mspace width=\"0.2222em\"></mspace><mtext>otherwise</mtext></math></p><p>Denote <math><mi>𝑋</mi><mo>∼</mo><mtext> Binom</mtext><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>,</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math></p><p><math><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow></math> is the combinatorial number, selecting <math><mi>𝑘</mi></math> items out of <math><mi>𝑛</mi></math> without caring about order</p><p>The formula is</p><p><math><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow><mo>=</mo><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mi>𝑘</mi><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac></math></p><p>The factorial is</p><p><math><mi>𝑛</mi><mo form=\"postfix\">!</mo><mo>=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mi>…</mi><mn>2</mn><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mn>1</mn></math></p><p>There is a property of the factorial that</p><p><math><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><mo>=</mo><mi>𝑛</mi></math></p><p>which comes from the definition of the factorial.</p><p>We will consider more generally that</p><p><math><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><mo>=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mi>…</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mi>𝑘</mi><mo>+</mo><mn>1</mn><mo stretchy=\"false\">)</mo></math></p><p>This fact will become more important.</p><p>The binomial expansion formula is that</p><p><math><mo stretchy=\"false\">(</mo><mi>𝑎</mi><mo>+</mo><mi>𝑏</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mi>𝑛</mi></msup><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>𝑛</mi></msubsup><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow><msup><mi>𝑎</mi><mi>𝑘</mi></msup><msup><mi>𝑏</mi><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>We will use this in many places.</p><p>The expectation of the binomial distribution</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mi>𝑛</mi><mi>𝑝</mi></math></p><p>Let’s prove this.</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>We will use the technique of factoring out what we want to prove, and then showing that the rest is equal to 1. This is a common and powerful technique. By definition of choose,</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mi>𝑘</mi><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>Now we can factor out <math><mi>𝑛</mi><mi>𝑝</mi></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><msubsup><mo form=\"prefix\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow><mrow><mi>𝑘</mi><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><msup><mi>𝑝</mi><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>We can simplify out that <math><mi>𝑘</mi></math> and rewrite our <math><mi>𝑛</mi><mo>−</mo><mi>𝑘</mi></math> for future rearranging and rewrite our for future rearranging</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><msubsup><mo form=\"prefix\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>𝑛</mi></msubsup><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><msup><mi>𝑝</mi><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow></msup></math></p><p>Next technique will be the change of variables in summations. Wherever I see <math><mi>𝑘</mi><mo>−</mo><mn>1</mn></math>, I will change it to a dummy variable.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><msubsup><mo form=\"prefix\">∑</mo><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msubsup><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><msup><mi>𝑘</mi><mo>′</mo></msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><msup><mi>𝑘</mi><mo>′</mo></msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><msup><mi>𝑘</mi><mo>′</mo></msup></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><msup><mi>𝑘</mi><mo>′</mo></msup></mrow></msup></math></p><p>We’re almost there, now we can rewrite as a choose</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><msubsup><mo form=\"prefix\" rspace=\"0em\">∑</mo><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msubsup><mrow><mo>(</mo><mfrac linethickness=\"0\"><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow><msup><mi>𝑘</mi><mo>′</mo></msup></mfrac><mo>)</mo></mrow><msup><mi>𝑝</mi><msup><mi>𝑘</mi><mo>′</mo></msup></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><msup><mi>𝑘</mi><mo>′</mo></msup></mrow></msup></math></p><p>We can now use the binomial expansion formula here.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑝</mi><mo>+</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi></math></p><p>For variance we will use a slightly different formulation.</p><p>We will consider <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo stretchy=\"false\">]</mo></math>, which is equivalent to <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><msup><mi>𝑋</mi><mn>2</mn></msup><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo stretchy=\"false\">]</mo></math>, because I want to cancel the factorial in a certain way., which is equivalent to , because I want to cancel the factorial in a certain way.</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mrow><mo>(</mo><mfrac linethickness=\"0\"><mi>𝑛</mi><mi>𝑘</mi></mfrac><mo>)</mo></mrow><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>I can safely start from 2 because of this minus 1 I’m using. Now let’s do some cancellations/substitutions.</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>𝑛</mi></msubsup><mi>𝑘</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mi>𝑘</mi><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>Now we can divide <math><mi>𝑘</mi></math> into its factorial.</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>𝑛</mi></msubsup><mfrac><mrow><mi>𝑛</mi><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><mi>𝑘</mi></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑘</mi></mrow></msup></math></p><p>Let me take out the thing I want to prove, and use the <math><mi>𝑛</mi><mo>−</mo><mi>𝑘</mi></math> technique. technique.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑝</mi><mn>2</mn></msup><msubsup><mo form=\"prefix\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>𝑛</mi></msubsup><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn></mrow></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo stretchy=\"false\">)</mo></mrow></msup></math></p><p>Using the <math><msup><mi>𝑘</mi><mo>′</mo></msup></math> technique for <math><mi>𝑘</mi><mo>−</mo><mn>2</mn></math>.</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑝</mi><mn>2</mn></msup><msubsup><mo form=\"prefix\">∑</mo><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn></mrow></msubsup><mfrac><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo form=\"postfix\">!</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><msup><mi>𝑘</mi><mo>′</mo></msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>!</mo></mrow></mfrac><msup><mi>𝑝</mi><msup><mi>𝑘</mi><mo>′</mo></msup></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mo stretchy=\"false\">(</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0em\" rspace=\"0em\">−</mo><msup><mi>𝑘</mi><mo>′</mo></msup></mrow></msup></math></p><p>By the binomial expansion formula this is</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑝</mi><mn>2</mn></msup><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑝</mi><mo>+</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn></mrow></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑝</mi><mn>2</mn></msup></math></p><p>Plugging this back into variance, we can show that</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>+</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑝</mi><mn>2</mn></msup><mo>+</mo><mi>𝑛</mi><mi>𝑝</mi><mo>−</mo><msup><mi>𝑛</mi><mn>2</mn></msup><msup><mi>𝑝</mi><mn>2</mn></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><msup><mi>𝑛</mi><mn>2</mn></msup><msup><mi>𝑝</mi><mn>2</mn></msup><mo>−</mo><mi>𝑛</mi><msup><mi>𝑝</mi><mn>2</mn></msup><mo>+</mo><mi>𝑛</mi><mi>𝑝</mi><mo>−</mo><msup><mi>𝑛</mi><mn>2</mn></msup><msup><mi>𝑝</mi><mn>2</mn></msup></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑛</mi><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math></p><p>You have to cancel a few things, use a change of variable, and group the sum into the binomial expansion formula. Those are the main techniques.</p><p>Stochastic calculus is less tedious but more conceptually difficult.</p><p>We have proposition 4.22: if <math><mi>𝑋</mi><mo>∈</mo><mtext>Bin</mtext><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>,</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math>, <math><mi>𝑌</mi><mo>∼</mo><mtext>Bin</mtext><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑚</mi><mo>,</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math>, and <math><mi>𝑋</mi></math> and <math><mi>𝑌</mi></math> are independent, then their sum is binomial:</p><p><math><mi>𝑋</mi><mo>+</mo><mi>𝑌</mi><mo>∼</mo><mtext>Bin</mtext><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>+</mo><mi>𝑚</mi><mo>,</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></math></p><h5>Geometric Distribution</h5><p>The distribution has no cap, can go to infinity.</p><p><math><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>=</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mi>𝑝</mi><mo>,</mo><mi>𝑘</mi><mo>=</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mn>3</mn><mo>,</mo><mi>…</mi></math></p><p>We can verify that this is in fact a probability distribution. We want to prove that</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>=</mo><mi>𝑘</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><msubsup><mo form=\"prefix\" rspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mi>𝑝</mi><mo>=</mo><mi>𝑝</mi><msubsup><mo form=\"prefix\" rspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup></math></p><p>We can expand this summation to</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>+</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo>+</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mn>2</mn></msup><mo>+</mo><mi>…</mi><mo stretchy=\"false\">)</mo></math></p><p>Based on the geometric formula, we can show that</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑝</mi><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></mrow></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mn>1</mn></math></p><p>We will show some lemmas here, some results.</p><p>The power series is</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>∞</mi></msubsup><msup><mi>𝑥</mi><mi>𝑛</mi></msup><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi></mrow></mfrac><mo>,</mo><mo form=\"prefix\">∀</mo><mn>0</mn><mo>&lt;</mo><mi>𝑥</mi><mo>&lt;</mo><mn>1</mn></math></p><p>This is calculus:</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mi>𝑛</mi><msup><mi>𝑥</mi><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo>=</mo><mfrac><mi>𝑑</mi><mrow><mi>𝑑</mi><mi>𝑥</mi></mrow></mfrac><mrow><mo>(</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi></mrow></mfrac><mo>)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mrow><mo stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi><msup><mo stretchy=\"false\">)</mo><mn>2</mn></msup></mrow></mfrac></math></p><p>We can also show</p><p><math><msubsup><mo lspace=\"0em\">∑</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>∞</mi></msubsup><mi>𝑛</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><msup><mi>𝑥</mi><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn></mrow></msup><mo>=</mo><mfrac><mrow><mn>0</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">×</mo><mn>2</mn><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mo form=\"prefix\">−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mrow><mo stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi><msup><mo stretchy=\"false\">)</mo><mn>4</mn></msup></mrow></mfrac><mo>=</mo><mfrac><mn>2</mn><mrow><mo stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑥</mi><msup><mo stretchy=\"false\">)</mo><mn>3</mn></msup></mrow></mfrac></math></p><p>We can start calculating the expected value now, this is from proposition 4.26</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>∞</mi></msubsup><mi>𝑃</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>&gt;</mo><mi>𝑛</mi><mo stretchy=\"false\">)</mo></math></p><p><math><mi>𝑃</mi><mrow><mo>(</mo><mrow><mi>𝑋</mi><mo>&gt;</mo><mi>𝑛</mi></mrow><mo>)</mo></mrow><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mi>𝑃</mi><mrow><mo>(</mo><mrow><mi>𝑋</mi><mo>=</mo><mi>𝑘</mi></mrow><mo>)</mo></mrow><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup><mo>=</mo><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mn>1</mn></mrow><mi>∞</mi></msubsup><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup></math></p><p>I want to make this formula into my power series. Let <math><msup><mi>𝑘</mi><mo>′</mo></msup><mo>=</mo><mi>𝑘</mi><mo>−</mo><mi>𝑛</mi><mo>−</mo><mn>1</mn></math>. Then <math><mi>𝑃</mi><mrow><mo>(</mo><mrow><mi>𝑋</mi><mo>&gt;</mo><mi>𝑛</mi></mrow><mo>)</mo></mrow><mo>=</mo><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>∞</mi></msubsup><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><msup><mi>𝑘</mi><mo>′</mo></msup></msup><mo>=</mo><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mrow><mo>(</mo><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow></mrow></mfrac><mo>=</mo><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup></math>.</p><p><math><mi>𝑃</mi><mrow><mo>(</mo><mrow><mi>𝑋</mi><mo>&gt;</mo><mi>𝑛</mi></mrow><mo>)</mo></mrow><mo>=</mo><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><msup><mi>𝑘</mi><mo>′</mo></msup><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>∞</mi></msubsup><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><msup><mi>𝑘</mi><mo>′</mo></msup></msup><mo>=</mo><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mrow><mo>(</mo><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow></mrow></mfrac><mo>=</mo><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup></math>.</p><p><math><mi>𝑝</mi><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">×</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mrow><mo>(</mo><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow></mrow></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><msup><mrow><mo>(</mo><mrow><mn>1</mn><mo>−</mo><mi>𝑝</mi></mrow><mo>)</mo></mrow><mi>𝑛</mi></msup></math></p><p>Then we have expected value as the infinite sum of this</p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\" rspace=\"0em\">∑</mo><mrow><mi>𝑛</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>0</mn></mrow><mi>∞</mi></msubsup><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo form=\"postfix\" stretchy=\"false\">)</mo><mi>𝑛</mi></msup><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mi>𝑝</mi></mfrac></math></p><p>For variance, we will use the same intermediate value of <math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo stretchy=\"false\">]</mo></math></p><p><math><mi>𝔼</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑋</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><msubsup><mo form=\"prefix\" lspace=\"0em\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>∞</mi></msubsup><mi>𝑘</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo lspace=\"0.2222222222222222em\" rspace=\"0.2222222222222222em\">⋅</mo><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow></msup></math></p><p>Take out what we want</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><msubsup><mo form=\"prefix\">∑</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">=</mo><mn>2</mn></mrow><mi>∞</mi></msubsup><mi>𝑘</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mi>𝑘</mi><mo>−</mo><mn>1</mn><mo form=\"postfix\" stretchy=\"false\">)</mo><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><msup><mo stretchy=\"false\">)</mo><mrow><mi>𝑘</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn></mrow></msup></math></p><p>This follows from our third power series lemma</p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mi>𝑝</mi><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo>−</mo><mi>𝑝</mi><mo form=\"postfix\" stretchy=\"false\">)</mo><mfrac><mn>2</mn><msup><mi>𝑝</mi><mn>3</mn></msup></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mrow><mn>2</mn><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></mrow><msup><mi>𝑝</mi><mn>2</mn></msup></mfrac></math></p><p>So for our variance, we get</p><p><math><mi>𝕍</mi><mo form=\"prefix\" stretchy=\"false\">[</mo><mi>𝑋</mi><mo form=\"postfix\" stretchy=\"false\">]</mo><mo>=</mo><mfrac><mrow><mn>2</mn><mo form=\"prefix\" stretchy=\"false\">(</mo><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi><mo stretchy=\"false\">)</mo></mrow><msup><mi>𝑝</mi><mn>2</mn></msup></mfrac><mo>+</mo><mfrac><mn>1</mn><mi>𝑝</mi></mfrac><mo>−</mo><mfrac><mn>1</mn><msup><mi>𝑝</mi><mn>2</mn></msup></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mrow><mn>2</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>2</mn><mi>𝑝</mi><mo lspace=\"0em\" rspace=\"0em\">+</mo><mi>𝑝</mi><mo lspace=\"0em\" rspace=\"0em\">−</mo><mn>1</mn></mrow><msup><mi>𝑝</mi><mn>2</mn></msup></mfrac></math></p><p><math><mo form=\"infix\" lspace=\"0em\">=</mo><mfrac><mrow><mn>1</mn><mo lspace=\"0em\" rspace=\"0em\">−</mo><mi>𝑝</mi></mrow><msup><mi>𝑝</mi><mn>2</mn></msup></mfrac></math></p><p>Poisson will be beginning of next class</p>","contentSourceFormat":"typst","contentTypst":"== Week 4\n<week-4>\n=== Lecture Notes\n<lecture-notes>\nWe will be covering discrete random variables this week.\n\nA discrete random variable is one whose image $X\\(Omega\\)$ is a finite/countable subset of $bb(R)$.\n\nFirst thing we introduce is the probability mass function (pmf).\n\nIt is basically the probability measure assigned to a single value: $P_X\\({ x }\\)= P\\(X = x\\)$\n\nBecause of the law of total probability, the probability of all outcomes must sum to 1:\n\n$sum_(x in X\\(Omega\\)) P\\(X = x\\)= 1 .$\n\nNext thing is the cumulative distribution function (cdf).\n\nUsually use the capital F to denote this: $F\\(t\\)= P\\(X lt.eq t\\)= sum_(x in X\\(Omega\\)inter x lt.eq t) P\\(X = x\\)$\n\nA simple example for a discrete random variable is that if you roll a die, the outcome of the die will give you a discrete random variable. If I'm interested in $F\\(3\\)= P\\(X lt.eq 3\\)= P\\(X = 1\\)+ P\\(X = 2\\)+ P\\(X = 3\\)$\n\nAnother example:\n\nWe denote $X$ as the number of times we roll the die until we get the outcome 6. If we're lucky and roll the die once to get a 6, what's the probability? For a fair die it's $1 / 6$. For the second roll, $P\\(X = 2\\)= 5 / 6 times 1 / 6 = 5 / 36$: the first roll is not 6 and the second roll is 6.\n\nThe outcome of the first roll does not affect the second roll.\n\nMore difficult one, $P\\(X = 3\\)$\n\n$P\\(X = 3\\)= 5 / 6 times 5 / 6 times 1 / 6$\n\nYou can prove by induction that the formula is\n\n$P\\(X = n\\)= (5 / 6)^(n - 1) times 1 / 6\\,1 lt.eq n$\n\nThis is a simple example.\n\nI want to say a property of the cdf:\n\nIf you have $X : Omega arrow.r bb(R)$ is a discrete r.v., the cdf $F\\(t\\)$ is piecewise constant and has finite/countable jumps.\n\nIf you think about cdf, it's a probability that lies from 0 to 1.\n\nThe graph of discrete cdf is exclusive coming from the right side, so the hole is on the bottom of the jump, not the top. We accumulate in a discrete ways, which makes it like a staircase. Each piece corresponds to a constant value, and there are finite jumps.\n\nFor simplicity, we will denote the following notations:\n\n$X\\(Omega\\)= { a_1\\,a_2\\,a_3\\,dots.h }$\n\n$p_i = P\\(X = a_i\\)\\,i = 1$\n\n==== Moments\n<moments>\nMoments are expectations, expectations are kind of like intervals in calculus. Here we are talking about discrete random variables, so our integration is basically a summation. In the next class we are going to talk about continuous, where the integral is an integral. Integrals is approximated by the Riemann sum, and there are many techniques for evaluating them. But right now we are sticking to summations.\n\nLet's define the expectation, by definition 4.7.\n\nIf you have a discrete r.v. $X$, we say $X$ is integrable if\n\n$sum_(x in X\\(Omega\\))\\|x\\|dot.op P\\(X = x\\)< oo$\n\nIf you map this to what you learned in calculus, this is #strong[absolute integrability]. You know that if you are absolutely integrable, you are regular integrable. Why absolute value? This $x$ can take positive or negative values. If this holds, we can define expectation as\n\n$bb(E)\\[X\\]= sum_(x in X\\(Omega\\)) x P\\(X = x\\)$\n\nIn order to help you understand this from a discrete random variable notation, you can put this in a table format.\n\n$X = {upright(\"outcome\") & upright(\"probability\") med a_1 & p_1 med a_2 & p_2$\n\nThis will be a handy tool when doing calculations.\n\nThis summation is purely rigorous.\n\nWe need the non-absolute value sum to be less, because the probability cannot be negative. I'm not just saying that the expectation is finite. I'm saying that the expectation is bounded by something finite. $X < oo$ is very different from $X < Y < oo$. The second one means that the value is bounded away from infinity, where $Y$ is the ceiling. The first one means you can approach infinity. This is important for mathematical analysis.\n\nProposition 4.8 says a property of the expectation is that expectation is linear. If you learn functional analysis (calculus on functions), you understand that expectation is a linear operator. The statement is this: $bb(e)\\[a X + b Y\\]= a E\\[X\\]+ b E\\[Y\\]$ where $a$ and $b$ are constants in $bb(R)$.\n\nHow do we prove this?\n\nWe want to first establish that $bb(E)\\[a X\\]= a bb(E)\\[X\\]$\n\nThere are two cases. When $a = 0$, this is trivial because $X$ becomes 0. How do you prove for $a eq.not 0$?\n\nWe will define $Z = a X$. From the definition of a discrete random variable, its image set must be a countable subset of $bb(R)$. Therefore, $Z$ is a discrete random variable. This implies that $Z\\(Omega\\)$ is countable. This is important because anything countable can be represented as a sum. $pi$ is uncountable and cannot be represented by a summation.\n\n$bb(E)\\[\\|Z\\|\\]= sum_(x in X\\(Omega\\))\\|a x\\|P\\(Z = a x\\)$\n\nby the simple definition of expectation.\n\n$= sum_(x in X\\(Omega\\))\\|a x\\|P\\(a X = a x\\)$\n\nI'm going to factor out the $a$, which we can do because we know $a eq.not 0$\n\n$=\\|a\\|sum_(x in X\\(Omega\\))\\|x\\|dot.op P\\(X = x\\)$\n\nBased on our definition 4.7, we can say that this is less than infinity.\n\nThen we can formally write down $Z$ without absolute value, since it's bounded finitely.\n\n$bb(E)\\[Z\\]= sum_(x in X\\(Omega\\)) a x P\\(Z = a x\\)= a sum_(x in X\\(Omega\\)) x P\\(X = x\\)= a dot.op bb(E)\\[X\\]$\n\nThis might seem silly, but we need to be rigorous in math when proving things.\n\nNow we want to prove $bb(E)\\[a X + b Y\\]= bb(E)\\[a X\\]+ bb(E)\\[a Y\\]$\n\nThe proof is too long, has too much rigor, uses some techniques of interchanging the summation signs.\n\nSecond part of proposition is that if $X gt.eq 0$, then $bb(E)\\[X\\]gt.eq 0$. If the random variable is greater than 0, then the expectation is greater than 0. The simple proof is that\n\n$bb(E)\\[X\\]= sum_(x in X\\(Omega\\)) x P\\(X = x\\)gt.eq 0$\n\nIf $X > Y$, then $bb(E)\\[X\\]gt.eq bb(E)\\[Y\\]$, where we can show that the difference is positive\n\nTheorem 4.9 the transfer formula says that for $X$ discrete r.v., where $phi : bb(R) arrow.r bb(R)$ is a measurable function, then $phi\\(X\\)$ is a r.v. and is integrable iff\n\n$sum_(x in X\\(Omega\\))\\|phi\\(x\\)\\|P\\(X = x\\)< oo$\n\nIn this case I can formally write down the expectation to be the sum\n\n$bb(E)\\[phi\\(X\\)\\]= sum_(x in X\\(Omega\\)) phi\\(x\\)P\\(X = x\\)$\n\n==== Examples\n<examples>\nHere are some examples:\n\nIf we have a discrete r.v.\n\n$X = {1 & 0.2 med 2 & 0.3 med 3 & 0.5\\,bb(E)\\[X\\]= ?$\n\nYou multiply horizontally and add them all up.\n\nRepresented in the cases format,\n\n$bb(E)\\[X\\]= sum_(i = 1)^oo a_i p_i$\n\nFor a measurable function $phi$,\n\n$bb(E)\\[phi\\(X\\)\\]= sum_(i = 1)^oo phi\\(a_i\\)p_i$\n\nYou only change the outcome, not the probability.\n\nIn this example,\n\n$bb(E)\\[X\\]= 1 times 0.2 + 2 times 0.3 + 3 times 0.5 = 2.3$.\n\nWhat if we take $bb(E)\\[X^2\\]$?\n\nThe square is a measurable function, so we can consider $phi\\(X\\)= X^2$\n\n$bb(E)\\[phi\\(X\\)\\]= 1^2 times 0.2 + 2^2 times 0.3 + 3^2 times 0.5 = 5.9$\n\nWe can go a little crazier and talk about $phi = sin X$\n\nIn all our examples, all of our functions are measurable. In terms of mathematical analysis, you might be interested in functions that are not measurable. But we don't have to worry about that in our class.\n\n==== Variance\n<variance>\nThe variance of a r.v. is defined to be\n\n$bb(V)\\(X\\)= bb(E) [\\( X - bb(E) \\[ X \\] \\)^2]$\n\nThere is an intuitive explanation for this definition. How do you measure the variability if numbers in a set? What you do is take the expected value of the numbers in the set.\n\nLet's say we have a sequence $\\(x_1\\,x_2\\,dots.h\\,x_n\\)$\n\n$bb(E)\\[X\\]= x_1 dot.op 1 / n + x_2 1 / n + dots.h + x_n 1 / n$\n\nWe want to measure the distance from each data point to the middle point. The distance of each variable to that middle point is what we are counting. We square them because the difference might be positive or negative, so it makes them all 0.\n\nWhat happens if we don't square it?\n\n$bb(E)\\[X - bb(E)\\[X\\]\\]= bb(E)\\[X\\]- bb(E)\\[X\\]= 0$\n\nIf you do some simple arithmetics, you can see the simple binomial expansion as\n\n$\\(a + b\\)^2= a^2 + 2 a b + b^2$\n\nand if we apply this to our variance, we get\n\n$bb(V)\\[X\\]= bb(E)\\[X^2 - 2 X bb(E)\\[X\\]+\\(bb(E)\\[X\\]\\)^2\\]$\n\nexpected value of an expected value is the same thing because it's just a constant\n\n$= bb(E)\\[X^2\\]- 2 bb(E)\\[X\\]bb(E)\\[X\\]+\\(bb(E)\\[X\\]\\)^2$\n\n$= bb(E)\\[X^2\\]-\\(bb(E)\\[X\\]\\)^2gt.eq 0$\n\nThis is Jensen's inequality, which shows the convexity of variance.\n\nThere are two operations, we take square, then expectation, and for the other, we take expectation first, then square. And this difference must be greater than or equal to 0.\n\nEventually, everything becomes calculus.\n\nDefinition 4.12 is of standard deviation, or std dev.\n\n$sigma\\(X\\)= sqrt(bb(V)\\(X\\)) = sqrt(bb(E)\\[X^2\\]-\\(bb(E)\\[X\\]\\)^2)$\n\nThis identity is very important:\n\n$bb(E)\\[X^2\\]= bb(V)\\(X\\)+\\(bb(E)\\[X\\]\\)^2$\n\nThis is very convenient for our calculations. Let's think about calculating the variance for the cases format. Assuming this format, we can represent\n\n$bb(V)\\[X\\]= bb(E)\\[X^2\\]-\\(bb(E)\\[X\\]\\)^2$\n\n$= sum_(i = 1)^oo a_i^2 p_i - (sum_(i = 1)^oo a_i p_i)^2$\n\nThat's it. This is the formula to use on homework. USEFUL\n\nThis has all been theoretical, abstract concepts. From now on we are going to talk about examples of discrete random variables.\n\nWe are going to go through several classes of random variables.\n\n==== Discrete Uniform Distribution\n<discrete-uniform-distribution>\nThe discrete uniform distribution has all the values being the same.\n\n$X\\(Omega\\)= { x_1\\,x_2\\,dots.h\\,x_n }$ and pmf is given by\n\n$p_i = P\\(X = x_i\\)= 1 / n\\,forall i in { 1\\,2\\,dots.h\\,n }$\n\nwe denote this as\n\n$X tilde.op D U\\(n\\)$ If you roll a fair die, the outcome of a die is a discrete uniform distribution. What is our cdf?\n\n$F\\(t\\)= {0 & upright(\"if \") t < 1 med i / 6 & upright(\"if \") i lt.eq t lt.eq i + 1\\,i = 1\\,2\\,3\\,4\\,5 med 1 & upright(\"if \") t gt.eq 6$ Let's look at expected value (in general, not just for fair die)\n\n$bb(E)\\[X\\]= sum_(i = 1)^n i dot.op 1 / n$\n\nLet's make this clear that the image set is $X\\(Omega\\)= { 1\\,2\\,3\\,dots.h\\,n }$\n\nThen we can determine the high school mathematics by taking the variable outside.\n\n$= 1 / n\\(1 + 2 + 3 + dots.h + n\\)$\n\n$= 1 / n frac(n\\(n + 1\\), 2)$\n\n$= frac(n + 1, 2)$\n\nNow let's look at the variance.\n\n$bb(E)\\[X^2\\]= sum_(i = 1)^n i^2 dot.op 1 / n = 1 / n sum_(i = 1)^n i^2$\n\nBy the same summation property\n\n$= 1 / n\\(1^2 + 2^2 + dots.h + n^2\\)= 1 / n frac(n\\(n + 1\\)\\(2 n + 1\\), 6) = frac(\\(n + 1\\)\\(2 n + 1\\), 6)$\n\nTo get the full variance we have\n\n$bb(V)\\[X\\]= bb(E)\\[X^2\\]-\\(bb(E)\\[X\\]\\)^2= frac(\\(n + 1\\)\\(2 n + 1\\), 6) - frac(\\(n + 1\\)^2, 4)$\n\n$= frac(2\\(n + 1\\)\\(2 n + 1\\)- 3\\(n + 1\\)^2, 12)$\n\n$= 1 / 12\\(4 n^2 + 6 n + 2 - 3 n^2 - 6 n - 3\\)$\n\n$= 1 / 12\\(n^2 - 1\\)$\n\n==== Bernoulli Distribution\n<bernoulli-distribution>\n$X = {1 & p med 0 & 1 - p$ We will denote $X med upright(\" Bernoulli\")\\(p\\)$.\n\nThe most obvious example is flipping a coin. Our expectation is very simple.\n\n$bb(p) = 1 / 2$\n\n$bb(E)\\[X\\]= 1 times p + 0 times\\(1 - p\\)= p$\n\nFor variance, it is\n\n$bb(E)\\[X^2\\]= 1^2 times p + 0^2 times\\(1 - p\\)= p$\n\n$bb(V)\\[X\\]= bb(E)\\[X^2\\]-\\(bb(E)\\[X\\]\\)^2= p - p^2 = p\\(1 - p\\)$\n\n==== Binomial Distribution\n<binomial-distribution>\nThis can be thought of as the sum of independent Bernoulli random variables. We will consider our pmf as\n\n$P\\(X = k\\)= {binom(n, k) p^k\\(1 - p\\)^(n - k) & upright(\"if \") k in { 0\\,1\\,2\\,dots.h\\,n } med 0 & upright(\"otherwise\")$\n\nDenote $X tilde.op upright(\" Binom\")\\(n\\,p\\)$\n\n$binom(n, k)$ is the combinatorial number, selecting $k$ items out of $n$ without caring about order\n\nThe formula is\n\n$binom(n, k) = frac(n !, k !\\(n - k\\)!)$\n\nThe factorial is\n\n$n ! = n\\(n - 1\\)\\(n - 2\\)dots.h 2 times 1$\n\nThere is a property of the factorial that\n\n$frac(n !, \\(n - 1\\)!) = n$\n\nwhich comes from the definition of the factorial.\n\nWe will consider more generally that\n\n$frac(n !, \\(n - k\\)!) = n\\(n - 1\\)\\(n - 2\\)dots.h\\(n - k + 1\\)$\n\nThis fact will become more important.\n\nThe binomial expansion formula is that\n\n$\\(a + b\\)^n= sum_(k = 0)^n binom(n, k) a^k b^(n - k)$\n\nWe will use this in many places.\n\nThe expectation of the binomial distribution\n\n$bb(E)\\[X\\]= n p$\n\nLet's prove this.\n\n$bb(E)\\[X\\]= sum_(k = 0)^n k P\\(X = k\\)= sum_(k = 0)^n k dot.op binom(n, k) p^k\\(1 - p\\)^(n - k)$\n\nWe will use the technique of factoring out what we want to prove, and then showing that the rest is equal to 1. This is a common and powerful technique. By definition of choose,\n\n$= sum_(k = 1)^n k dot.op frac(n !, k !\\(n - k\\)!) p^k\\(1 - p\\)^(n - k)$\n\nNow we can factor out $n p$\n\n$= n p sum_(k = 1)^n k dot.op frac(\\(n - 1\\)!, k !\\(n - k\\)!) dot.op p^(k - 1)\\(1 - p\\)^(n - k)$\n\nWe can simplify out that $k$ and rewrite our $n - k$ for future rearranging and rewrite our for future rearranging\n\n$= n p sum_(k = 1)^n frac(\\(n - 1\\)!, \\(k - 1\\)!\\(\\(n - 1\\)-\\(k - 1\\)\\)!) dot.op p^(k - 1)\\(1 - p\\)^(\\(n - 1\\)-\\(k - 1\\))$\n\nNext technique will be the change of variables in summations. Wherever I see $k - 1$, I will change it to a dummy variable.\n\n$= n p sum_(k' = 0)^(n - 1) frac(\\(n - 1\\)!, \\(k'\\)!\\(n - 1 - k'\\)!) p^(k')\\(1 - p\\)^(\\(n - 1\\)- k')$\n\nWe're almost there, now we can rewrite as a choose\n\n$= n p sum_(k' = 0)^(n - 1) binom(n - 1, k') p^(k')\\(1 - p\\)^(\\(n - 1\\)- k')$\n\nWe can now use the binomial expansion formula here.\n\n$= n p\\(p + 1 - p\\)^(n - 1)$\n\n$= n p$\n\nFor variance we will use a slightly different formulation.\n\nWe will consider $bb(E)\\[X\\(X - 1\\)\\]$, which is equivalent to $bb(E)\\[X^2\\]- bb(E)\\[X\\]$, because I want to cancel the factorial in a certain way., which is equivalent to , because I want to cancel the factorial in a certain way.\n\n$bb(E)\\[X\\(X - 1\\)\\]= sum_(k = 0)^n k\\(k - 1\\)binom(n, k) p^k\\(1 - p\\)^(n - k)$\n\nI can safely start from 2 because of this minus 1 I'm using. Now let's do some cancellations/substitutions.\n\n$sum_(k = 2)^n k\\(k - 1\\)frac(n !, k !\\(n - k\\)!) p^k\\(1 - p\\)^(n - k)$\n\nNow we can divide $k$ into its factorial.\n\n$sum_(k = 2)^n frac(n !, \\(k - 2\\)!\\(n - k\\)!) p^k\\(1 - p\\)^(n - k)$\n\nLet me take out the thing I want to prove, and use the $n - k$ technique. technique.\n\n$= n\\(n - 1\\)p^2 sum_(k = 2)^n frac(\\(n - 2\\)!, \\(k - 2\\)!\\(\\(n - 2\\)-\\(k - 2\\)\\)!) p^(k - 2)\\(1 - p\\)^(\\(n - 2\\)-\\(k - 2\\))$\n\nUsing the $k'$ technique for $k - 2$.\n\n$= n\\(n - 1\\)p^2 sum_(k' = 0)^(n - 2) frac(\\(n - 2\\)!, k' !\\(n - 2 - k'\\)!) p^(k')\\(1 - p\\)^(\\(n - 2\\)- k')$\n\nBy the binomial expansion formula this is\n\n$= n\\(n - 1\\)p^2\\(p + 1 - p\\)^(n - 2)$\n\n$= n\\(n - 1\\)p^2$\n\nPlugging this back into variance, we can show that\n\n$bb(V)\\(X\\)= bb(E)\\[X\\(X - 1\\)\\]+ bb(E)\\[X\\]-\\(bb(E)\\[X\\]\\)^2$\n\n$= n\\(n - 1\\)p^2 + n p - n^2 p^2$\n\n$= n^2 p^2 - n p^2 + n p - n^2 p^2$\n\n$= n p\\(1 - p\\)$\n\nYou have to cancel a few things, use a change of variable, and group the sum into the binomial expansion formula. Those are the main techniques.\n\nStochastic calculus is less tedious but more conceptually difficult.\n\nWe have proposition 4.22: if $X in upright(\"Bin\")\\(n\\,p\\)$, $Y tilde.op upright(\"Bin\")\\(m\\,p\\)$, and $X$ and $Y$ are independent, then their sum is binomial:\n\n$X + Y tilde.op upright(\"Bin\")\\(n + m\\,p\\)$\n\n==== Geometric Distribution\n<geometric-distribution>\nThe distribution has no cap, can go to infinity.\n\n$P\\(X = k\\)=\\(1 - p\\)^(k - 1)dot.op p\\,k = 1\\,2\\,3\\,dots.h$\n\nWe can verify that this is in fact a probability distribution. We want to prove that\n\n$sum_(k = 1)^oo P\\(X = k\\)sum_(k = 1)^oo\\(1 - p\\)^(k - 1)p = p sum_(k = 1)^oo\\(1 - p\\)^(k - 1)$\n\nWe can expand this summation to\n\n$= p\\(1 +\\(1 - p\\)+\\(1 - p\\)^2+ dots.h\\)$\n\nBased on the geometric formula, we can show that\n\n$= p frac(1, 1 -\\(1 - p\\))$\n\n$= 1$\n\nWe will show some lemmas here, some results.\n\nThe power series is\n\n$sum_(n = 0)^oo x^n = frac(1, 1 - x)\\,forall 0 < x < 1$\n\nThis is calculus:\n\n$sum_(n = 1)^oo n x^(n - 1) = frac(d, d x) (frac(1, 1 - x)) = frac(1, \\(1 - x\\)^2)$\n\nWe can also show\n\n$sum_(n = 2)^oo n\\(n - 1\\)x^(n - 2) = frac(0 - 1 times 2\\(1 - x\\)\\(- 1\\), \\(1 - x\\)^4) = frac(2, \\(1 - x\\)^3)$\n\nWe can start calculating the expected value now, this is from proposition 4.26\n\n$bb(E)\\[X\\]= sum_(n = 0)^oo P\\(X > n\\)$\n\n$P(X > n) = sum_(k = n + 1)^oo P(X = k) = sum_(k = n + 1)^oo p (1 - p)^(k - 1) = p (1 - p)^n times sum_(k = n + 1)^oo (1 - p)^(k - n - 1)$\n\nI want to make this formula into my power series. Let $k' = k - n - 1$. Then $P(X > n) = p (1 - p)^n times sum_(k' = 0)^oo (1 - p)^(k') = p (1 - p)^n times frac(1, 1 - (1 - p)) = (1 - p)^n$.\n\n$P(X > n) = p (1 - p)^n times sum_(k' = 0)^oo (1 - p)^(k') = p (1 - p)^n times frac(1, 1 - (1 - p)) = (1 - p)^n$.\n\n$p (1 - p)^n times frac(1, 1 - (1 - p))$\n\n$= (1 - p)^n$\n\nThen we have expected value as the infinite sum of this\n\n$bb(E)\\[X\\]= sum_(n = 0)^oo\\(1 - p\\)^n= frac(1, 1 -\\(1 - p\\)) = 1 / p$\n\nFor variance, we will use the same intermediate value of $bb(E)\\[X\\(X - 1\\)\\]$\n\n$bb(E)\\[X\\(X - 1\\)\\]= sum_(k = 2)^oo k\\(k - 1\\)dot.op p\\(1 - p\\)^(k - 1)$\n\nTake out what we want\n\n$= p\\(1 - p\\)sum_(k = 2)^oo k\\(k - 1\\)\\(1 - p\\)^(k - 2)$\n\nThis follows from our third power series lemma\n\n$= p\\(1 - p\\)2 / p^3$\n\n$= frac(2\\(1 - p\\), p^2)$\n\nSo for our variance, we get\n\n$bb(V)\\[X\\]= frac(2\\(1 - p\\), p^2) + 1 / p - 1 / p^2$\n\n$= frac(2 - 2 p + p - 1, p^2)$\n\n$= frac(1 - p, p^2)$\n\nPoisson will be beginning of next class","dataUrl":"https://sharifhsn.dev/api/posts/discrete-distributions-and-moments.json","date":"2024-09-23","datePublished":"2024-09-23","description":"We will be covering discrete random variables this week. A discrete random variable is one whose image 𝑋 ( Ω ) is a finite/countable subset of ℝ . First thing we introduce is the…","site":"https://sharifhsn.dev","slug":"discrete-distributions-and-moments","source":"FE-540 | Probability Theory","sourceUrl":null,"tags":["Probability Theory","Discrete Distributions","Moments"],"title":"Discrete Distributions and Moments","url":"https://sharifhsn.dev/blog/discrete-distributions-and-moments/","version":"1","wordCount":4394}