CSSS/SOC/STAT 321 Case-Based Statistics I. Random Variables & Probability Distributions I: Discrete Distributions

Similar documents
A useful modeling tricks.

Binomial and Normal Distributions

Statistical Methods in Practice STAT/MATH 3379

The Binomial Distribution

The Binomial Distribution

The normal distribution is a theoretical model derived mathematically and not empirically.

Essential Question: What is a probability distribution for a discrete random variable, and how can it be displayed?

The binomial distribution

2. Modeling Uncertainty

CHAPTER 4 DISCRETE PROBABILITY DISTRIBUTIONS

23.1 Probability Distributions

Chapter 3 Discrete Random Variables and Probability Distributions

Business Statistics 41000: Probability 4

Theoretical Foundations

Discrete Random Variables

The Binomial Probability Distribution

INF FALL NATURAL LANGUAGE PROCESSING. Jan Tore Lønning, Lecture 3, 1.9

Prof. Thistleton MAT 505 Introduction to Probability Lecture 3

Statistics Chapter 8

5.2 Random Variables, Probability Histograms and Probability Distributions

Version A. Problem 1. Let X be the continuous random variable defined by the following pdf: 1 x/2 when 0 x 2, f(x) = 0 otherwise.

ME3620. Theory of Engineering Experimentation. Spring Chapter III. Random Variables and Probability Distributions.

Probability. An intro for calculus students P= Figure 1: A normal integral

Law of Large Numbers, Central Limit Theorem

Basic Data Analysis. Stephen Turnbull Business Administration and Public Policy Lecture 4: May 2, Abstract

Chapter 3 - Lecture 5 The Binomial Probability Distribution

Stat 20: Intro to Probability and Statistics

Binomial Random Variable - The count X of successes in a binomial setting

Chapter 5: Discrete Probability Distributions

Probability Theory. Probability and Statistics for Data Science CSE594 - Spring 2016

Chapter 7. Sampling Distributions and the Central Limit Theorem

Chapter 6: Random Variables. Ch. 6-3: Binomial and Geometric Random Variables

Business Statistics 41000: Probability 3

4 Random Variables and Distributions

4: Probability. Notes: Range of possible probabilities: Probabilities can be no less than 0% and no more than 100% (of course).

MA : Introductory Probability

Section 0: Introduction and Review of Basic Concepts

STA 6166 Fall 2007 Web-based Course. Notes 10: Probability Models

Contents. The Binomial Distribution. The Binomial Distribution The Normal Approximation to the Binomial Left hander example

Point Estimation. Some General Concepts of Point Estimation. Example. Estimator quality

Part V - Chance Variability

Probability mass function; cumulative distribution function

4: Probability. What is probability? Random variables (RVs)

Statistics and Probability

Chapter 7. Sampling Distributions and the Central Limit Theorem

MA 1125 Lecture 12 - Mean and Standard Deviation for the Binomial Distribution. Objectives: Mean and standard deviation for the binomial distribution.

***SECTION 8.1*** The Binomial Distributions

What do you think "Binomial" involves?

Week 7. Texas A& M University. Department of Mathematics Texas A& M University, College Station Section 3.2, 3.3 and 3.4

Random variables The binomial distribution The normal distribution Other distributions. Distributions. Patrick Breheny.

2011 Pearson Education, Inc

3. Probability Distributions and Sampling

Math489/889 Stochastic Processes and Advanced Mathematical Finance Homework 5

MA 1125 Lecture 14 - Expected Values. Wednesday, October 4, Objectives: Introduce expected values.

Chapter 3 Class Notes Intro to Probability

4.1 Probability Distributions

4.3 Normal distribution

Back to estimators...

The Central Limit Theorem

Simple Random Sample

STAT 201 Chapter 6. Distribution

Normal Approximation to Binomial Distributions

Random variables The binomial distribution The normal distribution Sampling distributions. Distributions. Patrick Breheny.

The following content is provided under a Creative Commons license. Your support

AP Statistics Ch 8 The Binomial and Geometric Distributions

Statistics 6 th Edition

Distributions and Intro to Likelihood

Section Sampling Distributions for Counts and Proportions

The Binomial Distribution

Probability Models. Grab a copy of the notes on the table by the door

MATH 118 Class Notes For Chapter 5 By: Maan Omran

CH 5 Normal Probability Distributions Properties of the Normal Distribution

4.2 Bernoulli Trials and Binomial Distributions

AP Statistics Section 6.1 Day 1 Multiple Choice Practice. a) a random variable. b) a parameter. c) biased. d) a random sample. e) a statistic.

Statistics 431 Spring 2007 P. Shaman. Preliminaries

Experimental Probability - probability measured by performing an experiment for a number of n trials and recording the number of outcomes

Section Random Variables and Histograms

Math 243 Section 4.3 The Binomial Distribution

5. In fact, any function of a random variable is also a random variable

The Binomial Distribution

A probability distribution shows the possible outcomes of an experiment and the probability of each of these outcomes.

Section Distributions of Random Variables

Discrete Random Variables and Probability Distributions. Stat 4570/5570 Based on Devore s book (Ed 8)

We use probability distributions to represent the distribution of a discrete random variable.

Module 4: Probability

Point Estimation. Stat 4570/5570 Material from Devore s book (Ed 8), and Cengage

VIDEO 1. A random variable is a quantity whose value depends on chance, for example, the outcome when a die is rolled.

9 Expectation and Variance

A random variable is a quantitative variable that represents a certain

Normal distribution Approximating binomial distribution by normal 2.10 Central Limit Theorem

Random Variables CHAPTER 6.3 BINOMIAL AND GEOMETRIC RANDOM VARIABLES

Lecture 8. The Binomial Distribution. Binomial Distribution. Binomial Distribution. Probability Distributions: Normal and Binomial

A random variable (r. v.) is a variable whose value is a numerical outcome of a random phenomenon.

Chapter 5. Sampling Distributions

Central Limit Theorem, Joint Distributions Spring 2018

A Derivation of the Normal Distribution. Robert S. Wilson PhD.

Binomial Random Variables. Binomial Random Variables

MANAGEMENT PRINCIPLES AND STATISTICS (252 BE)

Chapter 4 and 5 Note Guide: Probability Distributions

Lecture 3: Probability Distributions (cont d)

Transcription:

CSSS/SOC/STAT 321 Case-Based Statistics I Random Variables & Probability Distributions I: Discrete Distributions Christopher Adolph Department of Political Science and Center for Statistics and the Social Sciences University of Washington, Seattle Chris Adolph (UW) Discrete Distributions 1 / 80

Two examples Flipping coins In the play Rosenscratz and Guildenstern are dead, R & G flip a coin repeatedly, and get heads 89 times. How likely is this outcome? In general, how likely is it get X or more heads out of N flips? Can you think of real-world situations like this one? Chris Adolph (UW) Discrete Distributions 2 / 80

Two examples Flipping coins In the play Rosenscratz and Guildenstern are dead, R & G flip a coin repeatedly, and get heads 89 times. How likely is this outcome? In general, how likely is it get X or more heads out of N flips? Can you think of real-world situations like this one? Anticipating a landslide A Democrat-controlled state legislature redistricts a 55% Democratic state so that they have a 55% majority in every district. They say they expect to win all 20 Congressional seats in the state. Majority rules, after all. Are they right? Chris Adolph (UW) Discrete Distributions 2 / 80

Sample spaces & sets One way to understand sample spaces is to list every outcome These lists are sets, or collections of elements, which could be numbers A = {23, 5.3, 1000, 4} Chris Adolph (UW) Discrete Distributions 3 / 80

Sample spaces & sets One way to understand sample spaces is to list every outcome These lists are sets, or collections of elements, which could be numbers A = {23, 5.3, 1000, 4} But they need not be quantitative at all, A = {Democrat, Republican, Green} Chris Adolph (UW) Discrete Distributions 3 / 80

Sample spaces & sets One way to understand sample spaces is to list every outcome These lists are sets, or collections of elements, which could be numbers A = {23, 5.3, 1000, 4} But they need not be quantitative at all, A = {Democrat, Republican, Green} And we will for now leave them as mathematical objects A = {a 1, a 2, a 3 } Chris Adolph (UW) Discrete Distributions 3 / 80

Sample spaces & sets One way to understand sample spaces is to list every outcome These lists are sets, or collections of elements, which could be numbers A = {23, 5.3, 1000, 4} But they need not be quantitative at all, A = {Democrat, Republican, Green} And we will for now leave them as mathematical objects A = {a 1, a 2, a 3 } a 1 is an element of A, which we write a 1 A Chris Adolph (UW) Discrete Distributions 3 / 80

Sample spaces & sets One way to understand sample spaces is to list every outcome These lists are sets, or collections of elements, which could be numbers A = {23, 5.3, 1000, 4} But they need not be quantitative at all, A = {Democrat, Republican, Green} And we will for now leave them as mathematical objects A = {a 1, a 2, a 3 } a 1 is an element of A, which we write a 1 A A set may also be empty, e.g., B = = {} Chris Adolph (UW) Discrete Distributions 3 / 80

Sample space for the coin flip example Suppose we toss a coin twice and record the results. We can use a set to record this complex event. For example, we might see a head and a tail, or H, T. Chris Adolph (UW) Discrete Distributions 4 / 80

Sample space for the coin flip example Suppose we toss a coin twice and record the results. We can use a set to record this complex event. For example, we might see a head and a tail, or H, T. The sample space, or universe of possible results, is in this case a set of sets: Ω = {{H, H}, {H, T}, {T, H}, {T, T}} Note that our sample space has separate entries for every ordering of heads or tails we could see. Chris Adolph (UW) Discrete Distributions 4 / 80

Sample space for two dice Now suppose that we roll two dice. The sample space is: (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) (5,1) (5,2) (5,3) (5,4) (5,5) (5,6) (6,1) (6,2) (6,3) (6,4) (6,5) (6,6) Chris Adolph (UW) Discrete Distributions 5 / 80

Sample space for two dice Now suppose that we roll two dice. The sample space is: (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) (5,1) (5,2) (5,3) (5,4) (5,5) (5,6) (6,1) (6,2) (6,3) (6,4) (6,5) (6,6) The sum of the dice rolls for each event: 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 Note that many sums repeat Chris Adolph (UW) Discrete Distributions 5 / 80

Sample spaces and complex events sum of the dice rolls for each event 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 What are the odds? Outcome 2 3 4 5 6 7 Frequency Probability Outcome 8 9 10 11 12 Frequency Probability Chris Adolph (UW) Discrete Distributions 6 / 80

Sample spaces and complex events sum of the dice rolls for each event 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 What are the odds? Outcome 2 3 4 5 6 7 1 2 3 4 5 Frequency 36 36 36 36 36 Probability Outcome 8 9 10 11 12 5 4 3 2 1 Frequency 36 36 36 36 36 Probability 6 36 Chris Adolph (UW) Discrete Distributions 7 / 80

Sample spaces and complex events sum of the dice rolls for each event 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 Each event (a, b) is equally likely. But each sum, a + b, is not. Outcome 2 3 4 5 6 7 1 2 3 4 5 6 Frequency 36 36 36 36 36 36 Probability 0.028 0.056 0.115 0.111 0.139 0.167 Outcome 8 9 10 11 12 5 4 3 2 1 Frequency 36 36 36 36 36 Probability 0.139 0.111 0.083 0.056 0.028 Chris Adolph (UW) Discrete Distributions 8 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process coin flips Events in sample space is all combinations of: each coin s result Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process coin flips military casualties Events in sample space is all combinations of: each coin s result each soldier s status Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process coin flips military casualties education outcomes Events in sample space is all combinations of: each coin s result each soldier s status each student s passing status Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process Events in sample space is all combinations of: coin flips each coin s result military casualties each soldier s status education outcomes each student s passing status presidential popularity each citizen s opinion...... How can we reduce the space to something manageable? Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process Events in sample space is all combinations of: coin flips each coin s result military casualties each soldier s status education outcomes each student s passing status presidential popularity each citizen s opinion...... How can we reduce the space to something manageable? map the sample space Ω to one or more random variables: Ω for coin flips X = # of heads Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process Events in sample space is all combinations of: coin flips each coin s result military casualties each soldier s status education outcomes each student s passing status presidential popularity each citizen s opinion...... How can we reduce the space to something manageable? map the sample space Ω to one or more random variables: Ω for coin flips X = # of heads Ω for military casualties D = # of deaths Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process Events in sample space is all combinations of: coin flips each coin s result military casualties each soldier s status education outcomes each student s passing status presidential popularity each citizen s opinion...... How can we reduce the space to something manageable? map the sample space Ω to one or more random variables: Ω for coin flips X = # of heads Ω for military casualties D = # of deaths Ω for education outcomes Y = # of students passing Ω for presidential popularity S = # support pres Chris Adolph (UW) Discrete Distributions 9 / 80

The trouble with sample spaces For most processes we could study, the sample space of all events is huge: Process Events in sample space is all combinations of: coin flips each coin s result military casualties each soldier s status education outcomes each student s passing status presidential popularity each citizen s opinion...... How can we reduce the space to something manageable? map the sample space Ω to one or more random variables: Ω for coin flips X = # of heads Ω for military casualties D = # of deaths Ω for education outcomes Y = # of students passing Ω for presidential popularity S = # support pres This mapping can produce discrete or continous variables, and each will have a different distribution of probabilities Chris Adolph (UW) Discrete Distributions 9 / 80

Probability for random variables Consider the random variable X = # of heads in M coin flips Five things we d like to know about the theoretical distribution of X: Pr(X) = f (X) How do we summarize the random distribution of X? Chris Adolph (UW) Discrete Distributions 10 / 80

Probability for random variables Consider the random variable X = # of heads in M coin flips Five things we d like to know about the theoretical distribution of X: Pr(X) = f (X) How do we summarize the random distribution of X? Pr(X = x) What is the probability X is some specific value like x = 1? Chris Adolph (UW) Discrete Distributions 10 / 80

Probability for random variables Consider the random variable X = # of heads in M coin flips Five things we d like to know about the theoretical distribution of X: Pr(X) = f (X) How do we summarize the random distribution of X? Pr(X = x) What is the probability X is some specific value like x = 1? Pr(X x) What is the probability that X is at least equal to some specific value, like x = 1? Chris Adolph (UW) Discrete Distributions 10 / 80

Probability for random variables Consider the random variable X = # of heads in M coin flips Five things we d like to know about the theoretical distribution of X: Pr(X) = f (X) How do we summarize the random distribution of X? Pr(X = x) What is the probability X is some specific value like x = 1? Pr(X x) What is the probability that X is at least equal to some specific value, like x = 1? E(X) What is the expected number of heads we will see on average? Chris Adolph (UW) Discrete Distributions 10 / 80

Probability for random variables Consider the random variable X = # of heads in M coin flips Five things we d like to know about the theoretical distribution of X: Pr(X) = f (X) How do we summarize the random distribution of X? Pr(X = x) What is the probability X is some specific value like x = 1? Pr(X x) What is the probability that X is at least equal to some specific value, like x = 1? E(X) What is the expected number of heads we will see on average? sd(x) On average, how much do we expect a given random outcome to differ from the expected result? Chris Adolph (UW) Discrete Distributions 10 / 80

The probability distribution of a random variable We want to describe the behavior of a sum of coin fips Let s start smaller: a single coin flip, X = 1 if heads, and X = 0 if tails Chris Adolph (UW) Discrete Distributions 11 / 80

The probability distribution of a random variable We want to describe the behavior of a sum of coin fips Let s start smaller: a single coin flip, X = 1 if heads, and X = 0 if tails We start by defining a probability distribution, or mathematical function which the random variable should follow in theory Let Pr(X = x) = f (X = x) Note that we haven t yet spelled out what f ( ) looks like. Chris Adolph (UW) Discrete Distributions 11 / 80

The probability distribution of a random variable Pr(X = x) = f (X = x) Chris Adolph (UW) Discrete Distributions 12 / 80

The probability distribution of a random variable Pr(X = x) = f (X = x) Sometimes we will have a lot of choice in specifying f ( ); other times, based on our knowledge of X, we will have very little Chris Adolph (UW) Discrete Distributions 12 / 80

The probability distribution of a random variable Pr(X = x) = f (X = x) Sometimes we will have a lot of choice in specifying f ( ); other times, based on our knowledge of X, we will have very little Usually, there are some parameters of this function which help determine Pr(X): Pr(X θ) = f (X, θ) Note that the probability of X is now conditional on our parameters θ Chris Adolph (UW) Discrete Distributions 12 / 80

The probability distribution of a random variable Pr(X = x) = f (X = x) Sometimes we will have a lot of choice in specifying f ( ); other times, based on our knowledge of X, we will have very little Usually, there are some parameters of this function which help determine Pr(X): Pr(X θ) = f (X, θ) Note that the probability of X is now conditional on our parameters θ For coin flips, the obvious parameter is the probability a single flipped coin comes out as heads, or π Pr(X π) = f (X, π) Chris Adolph (UW) Discrete Distributions 12 / 80

The Bernoulli distribution The probability of a coin flip is described by a simple probability function known as the Bernoulli distribution: { 1 π if X = 0 f Bern (X π) = π if X = 1 Chris Adolph (UW) Discrete Distributions 13 / 80

The Bernoulli distribution The probability of a coin flip is described by a simple probability function known as the Bernoulli distribution: { 1 π if X = 0 f Bern (X π) = π if X = 1 If we are clever, we can write it much more conveniently: f Bern (X π) = π X (1 π) 1 X Another name for a probability distribution function is pdf, so this is also called the Bernoulli pdf Chris Adolph (UW) Discrete Distributions 13 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? The pdf above. Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? The pdf above. Pr(X = x) What is the probability X is some specific value like x = 1? Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? The pdf above. Pr(X = x) What is the probability X is some specific value like x = 1? Plug it in to the pdf. Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? The pdf above. Pr(X = x) What is the probability X is some specific value like x = 1? Plug it in to the pdf. Pr(X x) What is the probability that X is at least equal to some specific value, like x = 1? Sum up the pdf over all X x. Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(X) = f (X) How do we summarize the random distribution of X? The pdf above. Pr(X = x) What is the probability X is some specific value like x = 1? Plug it in to the pdf. Pr(X x) What is the probability that X is at least equal to some specific value, like x = 1? Sum up the pdf over all X x. The sum of a pdf over a range of values is the cumulative density We can write a cumulative density function (cdf) for any discrete distribution as F(X): F(X = x) = X x f (x) Chris Adolph (UW) Discrete Distributions 14 / 80

The Bernoulli distribution Pr(outcome) 1 Bernoulli pdf 1 Bernoulli cdf π π 1 π 1 π 0 tails 1 heads x 0 tails 1 heads x For the Bernoulli, the pdf and cdf are simple functions Note that both have support on the values 0, 1 only the probability of X is defined as 0 for any other X beside 0 and 1. Chris Adolph (UW) Discrete Distributions 15 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] = E [ (X π) 2] Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] = E [ (X π) 2] = (X i π) 2 f Bern (X i π) i Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] = E [ (X π) 2] = (X i π) 2 f Bern (X i π) i = (0 π) 2 f Bern (0 π) + (1 π) 2 f Bern (1 π) Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] = E [ (X π) 2] = (X i π) 2 f Bern (X i π) i = (0 π) 2 f Bern (0 π) + (1 π) 2 f Bern (1 π) = π 2 (1 π) + (1 π) 2 π Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution A distribution has an expected value and variance, just like a sample does, though they are now theoretical, pre-existing any data: E(X) = i X i f Bern (X i π) = 0 f Bern (0 π) + 1 f Bern (1 π) = 0 + π = π Var(X) = E [ (X E(X)) 2] = E [ (X π) 2] = (X i π) 2 f Bern (X i π) i = (0 π) 2 f Bern (0 π) + (1 π) 2 f Bern (1 π) = π 2 (1 π) + (1 π) 2 π = π(1 π) Chris Adolph (UW) Discrete Distributions 16 / 80

The Bernoulli distribution E(X) What is the expected number of heads we will see on average? E(X) = π Chris Adolph (UW) Discrete Distributions 17 / 80

The Bernoulli distribution E(X) What is the expected number of heads we will see on average? E(X) = π sd(x) On average, how much do we expect a given random outcome to differ from the expected result? We know Var(X) = π(1 π). Chris Adolph (UW) Discrete Distributions 17 / 80

The Bernoulli distribution E(X) What is the expected number of heads we will see on average? E(X) = π sd(x) On average, how much do we expect a given random outcome to differ from the expected result? We know Var(X) = π(1 π). So sd(x) = π(1 π). Chris Adolph (UW) Discrete Distributions 17 / 80

The Bernoulli distribution E(X) What is the expected number of heads we will see on average? E(X) = π sd(x) On average, how much do we expect a given random outcome to differ from the expected result? We know Var(X) = π(1 π). So sd(x) = π(1 π). Note that this is maximized at π = 0.5. Why? Chris Adolph (UW) Discrete Distributions 17 / 80

The binomial distribution Now let s go back to our original question: what is the distribution of the sum of M coin flips? Real world applications are many: rainy days in a month students our of a class who pass votes from a known population of voters (elections, Congressional votes) Chris Adolph (UW) Discrete Distributions 18 / 80

The binomial distribution Now let s go back to our original question: what is the distribution of the sum of M coin flips? Real world applications are many: rainy days in a month students our of a class who pass votes from a known population of voters (elections, Congressional votes) Suppose we observe several Bernoulli RVs and count the successes (might imagine that the underlying 1s and 0s are lost) Chris Adolph (UW) Discrete Distributions 18 / 80

The binomial distribution Now let s go back to our original question: what is the distribution of the sum of M coin flips? Real world applications are many: rainy days in a month students our of a class who pass votes from a known population of voters (elections, Congressional votes) Suppose we observe several Bernoulli RVs and count the successes (might imagine that the underlying 1s and 0s are lost) Key assumption: each trial is identically and independently distributed (iid) Bernoulli For the moment, take this to mean that each trial has the same π of success Chris Adolph (UW) Discrete Distributions 18 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π + (1 π)ππ Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π + (1 π)ππ = 3ππ(1 π) Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π + (1 π)ππ = 3ππ(1 π) = 3π 2 (1 π) 3 2 Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π + (1 π)ππ = 3ππ(1 π) = 3π 2 (1 π) 3 2 ( ) M Pr(X π, M) = π X (1 π) M X X Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution How do we come up with a pdf for these assumptions? Back to sample spaces for a moment Suppose we wanted to calculate the probability that e get two heads out of a total of three flips: Pr(X = 2 π, M = 3) There are three events in the sample space that meet these criteria: Pr(X = 2 π, M = 3) = Pr(H, H, T) + Pr(H, T, H) + Pr(T, H, H) = ππ(1 π) + π(1 π)π + (1 π)ππ = 3ππ(1 π) = 3π 2 (1 π) 3 2 ( ) M Pr(X π, M) = π X (1 π) M X X M! = X!(M X)! πx (1 π) M X Chris Adolph (UW) Discrete Distributions 19 / 80

The binomial distribution f Bin (X π, M) = M! X!(M X)! πx (1 π) M X Similarity to the Bernoulli evident, especially in the moments: Chris Adolph (UW) Discrete Distributions 20 / 80

The binomial distribution f Bin (X π, M) = M! X!(M X)! πx (1 π) M X Similarity to the Bernoulli evident, especially in the moments: E(x) = Mπ Chris Adolph (UW) Discrete Distributions 20 / 80

The binomial distribution f Bin (X π, M) = M! X!(M X)! πx (1 π) M X Similarity to the Bernoulli evident, especially in the moments: E(x) = Mπ Var(x) = Mπ(1 π) Chris Adolph (UW) Discrete Distributions 20 / 80

The binomial distribution: PDF This graph shows the probability of each outcome X Density f(x) at x 1.0 0.8 0.6 0.4 0.2 0 2 4 6 8 10 x The pdf of binomial sums over 10 trials, with each trial having an 0.5 probability of success Chris Adolph (UW) Discrete Distributions 21 / 80

The binomial distribution: CDF This graph shows the probability of seeing an outcome less than or equal to X Cum. dens. F(x) up to x 1.0 0.8 0.6 0.4 0.2 0 2 4 6 8 10 x The cdf of binomial sums over 10 trials, with each trial having an 0.5 probability of success Chris Adolph (UW) Discrete Distributions 22 / 80

Example: Rosencrantz and Guildenstern are still dead Rosencrantz and Guildenstern are minor characters in Shakespeare s Hamlet Claudius has killed his brother, the King, and married his sister-in-law, the Queen, to assume the throne He dispossesses Prince Hamlet, without ever explicitly acknowledging the fact Hamlet becomes depressed and sullen. Expecting Hamlet to eventually challenge him, Claudius summons two of Hamlet s childhood friends, R & G, to spy on the prince Claudius tricks R & G into delivering Hamlet to England for execution. Hamlet tricks the (none-too-bright) R & G into being executed in his place. Tom Stoppard s play Rosencrantz and Guildenstern are Dead retells this story through R & G s perspective, emphasizing their powerlessness and lack of real choice Chris Adolph (UW) Discrete Distributions 23 / 80

Example: Rosencrantz and Guildenstern are still dead At the start of Stoppard s play, Rosenstern and Guildencrantz have flipped a coin 89 times, getting heads every time How unlikely is this event? Chris Adolph (UW) Discrete Distributions 24 / 80

Example: Rosencrantz and Guildenstern are still dead At the start of Stoppard s play, Rosenstern and Guildencrantz have flipped a coin 89 times, getting heads every time How unlikely is this event? Apply the binomial pdf: Pr(X π, M) = f Bin (X π, M) Chris Adolph (UW) Discrete Distributions 24 / 80

Example: Rosencrantz and Guildenstern are still dead At the start of Stoppard s play, Rosenstern and Guildencrantz have flipped a coin 89 times, getting heads every time How unlikely is this event? Apply the binomial pdf: Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X Chris Adolph (UW) Discrete Distributions 24 / 80

Example: Rosencrantz and Guildenstern are still dead At the start of Stoppard s play, Rosenstern and Guildencrantz have flipped a coin 89 times, getting heads every time How unlikely is this event? Apply the binomial pdf: Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 Chris Adolph (UW) Discrete Distributions 24 / 80

Example: Rosencrantz and Guildenstern are still dead At the start of Stoppard s play, Rosenstern and Guildencrantz have flipped a coin 89 times, getting heads every time How unlikely is this event? Apply the binomial pdf: Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 Working with large factorials might break your calculator. 89! has 136 digits before the decimal, for example Chris Adolph (UW) Discrete Distributions 24 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X π, M) = f Bin (X π, M) Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 In R, the above formula is implemented using the dbinom() command. (d stands for density, as in pdf) Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 In R, the above formula is implemented using the dbinom() command. (d stands for density, as in pdf) dbinom(89, size=89, prob=0.5) gives us: Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 In R, the above formula is implemented using the dbinom() command. (d stands for density, as in pdf) dbinom(89, size=89, prob=0.5) gives us: Pr(89 heads out of 89 fair coin) = 0.00000000000000000000000000162 Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 In R, the above formula is implemented using the dbinom() command. (d stands for density, as in pdf) dbinom(89, size=89, prob=0.5) gives us: Pr(89 heads out of 89 fair coin) = 0.00000000000000000000000000162 Or a 1 in 618,000,000,000,000,000,000,000,000 chance Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead Pr(X = 89 π = 0.5, M = 89) = Pr(X π, M) = f Bin (X π, M) = M! X!(M X)! πx (1 π) M X 89! 89!(89 89)! 0.589 (1 0.5) 89 89 In R, the above formula is implemented using the dbinom() command. (d stands for density, as in pdf) dbinom(89, size=89, prob=0.5) gives us: Pr(89 heads out of 89 fair coin) = 0.00000000000000000000000000162 Or a 1 in 618,000,000,000,000,000,000,000,000 chance Or one chance in 618 million trillion trillion tries Chris Adolph (UW) Discrete Distributions 25 / 80

Example: Rosencrantz and Guildenstern are still dead How small is one chance in 618 million trillion trillion tries? Chris Adolph (UW) Discrete Distributions 26 / 80

Example: Rosencrantz and Guildenstern are still dead How small is one chance in 618 million trillion trillion tries? For context, the universe began 432 thousand trillion seconds ago Chris Adolph (UW) Discrete Distributions 26 / 80

Example: Rosencrantz and Guildenstern are still dead How small is one chance in 618 million trillion trillion tries? For context, the universe began 432 thousand trillion seconds ago If a billion people each flippled a set of 89 coins once a second repeating this action every second since time began we would expect approximately one person to get a single set of all heads. Chris Adolph (UW) Discrete Distributions 26 / 80

Example: Rosencrantz and Guildenstern are still dead If you see such a freak occurrence in life you must ask yourself: Is it more likely that I saw 89 fair coins come up heads by chance, or that someone has changed the probability of a heads to something close to 1? Clearly, something is manipulating the coins, just like Claudius & Hamlet are manipulating R & G One way to use probability distributions: How likely is an event to have been mere chance? Chris Adolph (UW) Discrete Distributions 27 / 80

Random samples from the binomial Another way to get a handle on pdfs and cdfs is to just draw repeatedly from the distribution of interest Chris Adolph (UW) Discrete Distributions 28 / 80

Frequency 0.0 0.2 0.4 0.6 0.8 1.0 First 1 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Chris Adolph (UW) Discrete Distributions 29 / 80

Frequency 0.0 0.2 0.4 0.6 0.8 1.0 First 1 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 29 / 80

Frequency 0.0 0.2 0.4 0.6 0.8 1.0 First 2 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 30 / 80

Frequency 0.0 0.5 1.0 1.5 2.0 First 3 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 31 / 80

Frequency 0.0 1.0 2.0 3.0 First 4 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 32 / 80

Frequency 0.0 1.0 2.0 3.0 First 5 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 33 / 80

Frequency 0.0 1.0 2.0 3.0 First 6 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 34 / 80

Frequency 0.0 1.0 2.0 3.0 First 7 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 35 / 80

Frequency 0.0 1.0 2.0 3.0 First 8 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 36 / 80

Frequency 0.0 1.0 2.0 3.0 First 9 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 37 / 80

Frequency 0.0 1.0 2.0 3.0 First 10 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 38 / 80

Frequency 0 1 2 3 4 First 11 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 39 / 80

Frequency 0 1 2 3 4 5 First 12 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 40 / 80

Frequency 0 1 2 3 4 5 First 13 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 41 / 80

Frequency 0 1 2 3 4 5 6 First 14 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 42 / 80

Frequency 0 1 2 3 4 5 6 First 15 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 43 / 80

Frequency 0 1 2 3 4 5 6 First 16 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 44 / 80

Frequency 0 1 2 3 4 5 6 First 17 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 45 / 80

Frequency 0 1 2 3 4 5 6 First 18 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 46 / 80

Frequency 0 1 2 3 4 5 6 First 19 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 47 / 80

Frequency 0 1 2 3 4 5 6 First 20 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 48 / 80

Frequency 0 1 2 3 4 5 6 First 21 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 49 / 80

Frequency 0 1 2 3 4 5 6 First 22 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 50 / 80

Frequency 0 1 2 3 4 5 6 First 23 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 51 / 80

Frequency 0 1 2 3 4 5 6 First 24 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 52 / 80

Frequency 0 1 2 3 4 5 6 First 25 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 53 / 80

Frequency 0 1 2 3 4 5 6 First 26 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 54 / 80

Frequency 0 1 2 3 4 5 6 First 27 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 55 / 80

Frequency 0 1 2 3 4 5 6 First 28 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 56 / 80

Frequency 0 1 2 3 4 5 6 First 29 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 57 / 80

Frequency 0 1 2 3 4 5 6 First 30 draws from a Binomial(pi=0.5, N=30) 0 5 10 15 20 25 30 Binomial outcome Let s draw repeatedly from the Binomial with 30 trials, each with probability 0.5 of success, and save our results in a histogram Watch the scale of the vertical axis (frequency) closely Chris Adolph (UW) Discrete Distributions 58 / 80

First 50 draws from a Binomial(pi=0.5, N=30) Frequency 0 2 4 6 8 10 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 50 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 59 / 80

First 100 draws from a Binomial(pi=0.5, N=30) Frequency 0 5 10 15 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 100 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 60 / 80

First 200 draws from a Binomial(pi=0.5, N=30) Frequency 0 5 10 20 30 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 200 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 61 / 80

First 500 draws from a Binomial(pi=0.5, N=30) Frequency 0 20 40 60 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 500 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 62 / 80

First 1000 draws from a Binomial(pi=0.5, N=30) Frequency 0 50 100 150 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 1,000 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 63 / 80

First 2000 draws from a Binomial(pi=0.5, N=30) Frequency 0 50 150 250 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 2,000 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 64 / 80

First 5000 draws from a Binomial(pi=0.5, N=30) Frequency 0 200 400 600 Now that we have the basic idea, let s add more than one draw to the histogram at a time Now we re up to 5,000 draws 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 65 / 80

First 10000 draws from a Binomial(pi=0.5, N=30) Frequency 0 500 1000 1500 Now we re up to 10,000 draws Does this distribution remind you of any other distribution you ve read about? 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 66 / 80

First 20000 draws from a Binomial(pi=0.5, N=30) Frequency 0 500 1500 2500 0 5 10 15 20 25 30 Now we re up to 20,000 draws As the number of draws from the binomial gets large, it starts to look like a Normal, or bell-shaped distribution Binomial outcome Chris Adolph (UW) Discrete Distributions 67 / 80

First 50000 draws from a Binomial(pi=0.5, N=30) Frequency 0 2000 4000 6000 0 5 10 15 20 25 30 Now we re up to 50,000 draws Won t ever be exactly normal: it s still discrete (you can t get 10.5, for example), and it only has support on [0,30] Binomial outcome Chris Adolph (UW) Discrete Distributions 68 / 80

First 1e+05 draws from a Binomial(pi=0.5, N=30) Frequency 0 5000 10000 15000 Now we re up to 100,000 draws (Does this remind you of anything?) 0 5 10 15 20 25 30 Binomial outcome Chris Adolph (UW) Discrete Distributions 69 / 80

Example: Anticipating a landslide Every ten years, the states redraw the lines of Congressional districts Chris Adolph (UW) Discrete Distributions 70 / 80

Example: Anticipating a landslide Every ten years, the states redraw the lines of Congressional districts Why we have a decennial census: how many districts should each state get, and how should they be drawn to have equal numbers of residents Chris Adolph (UW) Discrete Distributions 70 / 80

Example: Anticipating a landslide Every ten years, the states redraw the lines of Congressional districts Why we have a decennial census: how many districts should each state get, and how should they be drawn to have equal numbers of residents Political parties use redistricting to strategically draw district boundaries that achieve their goals Key (conflicting!) goals: incumbent protection and maximizing total seats Called political gerrymandering. Currently quite legal. Chris Adolph (UW) Discrete Distributions 70 / 80

Example: Anticipating a landslide Imagine a state of 10 million people where the population is 55% Democratic, and 45% Republican. Suppose that every Democrat lives on the west side of the state, and every Republican on the east. Chris Adolph (UW) Discrete Distributions 71 / 80

Example: Anticipating a landslide Currently, there are 20 districts of 500,000 people each, draw in North-South strips. Each district has homogenous D or R population Chris Adolph (UW) Discrete Distributions 72 / 80

Example: Anticipating a landslide Normally in an election, the side that can get the most voters to turnout wins (approximately half of the eligible voters actual go to the polls) But if each district is homogenous, this doesn t matter: Every election, regardless of turnout, the D s win 11 seats, and R s win 9 seats Chris Adolph (UW) Discrete Distributions 73 / 80

Example: Anticipating a landslide The Democrats also control the state legislature, and have a clever idea. Chris Adolph (UW) Discrete Distributions 74 / 80

Example: Anticipating a landslide Let s redraw the map this year as a series of East-West districts, each 55% Democratic. We ll have a majority in every district, so we should expect to win 20 seats! Are these legislators correct? How many seats should they expect to win? Chris Adolph (UW) Discrete Distributions 75 / 80

Example: Anticipating a landslide The legislators have assumed the probability of victory is 100% in a district that is 55% Democratic and 45% Republican Not a good assumption. Let s instead assume the probability of victory is a healthy 75% Chris Adolph (UW) Discrete Distributions 76 / 80