a zoo of (discrete) random variables

Similar documents
a zoo of (discrete) random variables

random variables T T T T H T H H

CSE 312, 2011 Winter, W.L.Ruzzo. 6. random variables

CSE 312, 2012 Autumn, W.L.Ruzzo. 6. random variables T T T T H T H H

Binomial in the Limit

Lecture 08: Poisson and More. Lisa Yan July 13, 2018

Poisson Chris Piech CS109, Stanford University. Piech, CS106A, Stanford University

Bernoulli and Binomial

Mathematical Statistics 1 Math A 6330

Chapter 3 Discrete Random Variables

ST 371 (V): Families of Discrete Distributions

Discrete Distributions

Common Discrete Distributions

Binomial and Poisson Probability Distributions

Random variables (discrete)

Discrete Random Variables

Math/Stat 352 Lecture 8

CMPSCI 240: Reasoning Under Uncertainty

Fundamental Tools - Probability Theory II

Debugging Intuition. How to calculate the probability of at least k successes in n trials?

Continuous Variables Chris Piech CS109, Stanford University

More on Distribution Function

Lecture 3. Discrete Random Variables

More Discrete Distribu-ons. Keegan Korthauer Department of Sta-s-cs UW Madison

CS 237: Probability in Computing

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

More discrete distributions

SDS 321: Introduction to Probability and Statistics

Suppose that you have three coins. Coin A is fair, coin B shows heads with probability 0.6 and coin C shows heads with probability 0.8.

Topic 3: The Expectation of a Random Variable

n px p x (1 p) n x. p x n(n 1)... (n x + 1) x!

Chapters 3.2 Discrete distributions

Chapter 2: Random Variables

1 Bernoulli Distribution: Single Coin Flip

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019

Lecture 14. Text: A Course in Probability by Weiss 5.6. STAT 225 Introduction to Probability Models February 23, Whitney Huang Purdue University

Random Variables. Will Perkins. January 11, 2013

Things to remember when learning probability distributions:

3 Multiple Discrete Random Variables

Class 26: review for final exam 18.05, Spring 2014

Probability Theory and Simulation Methods. April 6th, Lecture 19: Special distributions

MATH 151, FINAL EXAM Winter Quarter, 21 March, 2014

Notes for Math 324, Part 17

What is a random variable

p. 4-1 Random Variables

Relationship between probability set function and random variable - 2 -

Lecture 13. Poisson Distribution. Text: A Course in Probability by Weiss 5.5. STAT 225 Introduction to Probability Models February 16, 2014

STAT2201. Analysis of Engineering & Scientific Data. Unit 3

2. Suppose (X, Y ) is a pair of random variables uniformly distributed over the triangle with vertices (0, 0), (2, 0), (2, 1).

Conditional distributions

7. Be able to prove Rules in Section 7.3, using only the Kolmogorov axioms.

Topic 9 Examples of Mass Functions and Densities

Discrete Random Variable

Analysis of Engineering and Scientific Data. Semester

DEFINITION: IF AN OUTCOME OF A RANDOM EXPERIMENT IS CONVERTED TO A SINGLE (RANDOM) NUMBER (E.G. THE TOTAL

MATH 3510: PROBABILITY AND STATS July 1, 2011 FINAL EXAM

Conditional distributions (discrete case)

STAT 430/510 Probability Lecture 7: Random Variable and Expectation

1 Random Variable: Topics

Random Variables. Definition: A random variable (r.v.) X on the probability space (Ω, F, P) is a mapping

Example 1. The sample space of an experiment where we flip a pair of coins is denoted by:

CSE 312: Foundations of Computing II Quiz Section #10: Review Questions for Final Exam (solutions)

Notes 12 Autumn 2005

Lecture 2: Discrete Probability Distributions

Bernoulli Trials, Binomial and Cumulative Distributions

Solutionbank S1 Edexcel AS and A Level Modular Mathematics

Lecture 12. Poisson random variables

CSE 312: Foundations of Computing II Random Variables, Linearity of Expectation 4 Solutions

Review of Probability. CS1538: Introduction to Simulations

Random Variables Example:

Discrete Distributions

Lecture 10: Bayes' Theorem, Expected Value and Variance Lecturer: Lale Özkahya

It can be shown that if X 1 ;X 2 ;:::;X n are independent r.v. s with

Randomized Load Balancing:The Power of 2 Choices

3.4. The Binomial Probability Distribution

Some Special Discrete Distributions

Stochastic Models of Manufacturing Systems

CSC Discrete Math I, Spring Discrete Probability

n(1 p i ) n 1 p i = 1 3 i=1 E(X i p = p i )P(p = p i ) = 1 3 p i = n 3 (p 1 + p 2 + p 3 ). p i i=1 P(X i = 1 p = p i )P(p = p i ) = p1+p2+p3

University of Illinois ECE 313: Final Exam Fall 2014

Lecture 13: Covariance. Lisa Yan July 25, 2018

Topic 3: The Expectation of a Random Variable

continuous random variables

the law of large numbers & the CLT

Discrete Random Variables

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Notice how similar the answers are in i,ii,iii, and iv. Go back and modify your answers so that all the parts look almost identical.

CS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing)

An-Najah National University Faculty of Engineering Industrial Engineering Department. Course : Quantitative Methods (65211)

18.175: Lecture 13 Infinite divisibility and Lévy processes


Statistics for Economists. Lectures 3 & 4

EE 505 Introduction. What do we mean by random with respect to variables and signals?

Joint Distribution of Two or More Random Variables

Applied Statistics I

Probability: Why do we care? Lecture 2: Probability and Distributions. Classical Definition. What is Probability?

Chapter 5. Chapter 5 sections

Conditional Probability

Example 1. Assume that X follows the normal distribution N(2, 2 2 ). Estimate the probabilities: (a) P (X 3); (b) P (X 1); (c) P (1 X 3).

Chapter 4 : Discrete Random Variables

Transcription:

discrete uniform random variables A discrete random variable X equally liely to tae any (integer) value between integers a and b, inclusive, is uniform. Notation: X ~ Unif(a,b) a zoo of (discrete) random variables Probability: Mean, Variance: 1 2 discrete uniform random variables A discrete random variable X equally liely to tae any (integer) value between integers a and b, inclusive, is uniform. Notation: Probability: Mean, Variance: X ~ Unif(a,b) Bernoulli random variables An experiment results in Success or Failure X is an indicator random variable (1 = success, 0 = failure) P(X=1) = p and P(X=0) = 1-p X is called a Bernoulli random variable: X ~ Ber(p) E[X] = E[X 2 ] = p Var(X) = E[X 2 ] (E[X]) 2 = p p 2 = p(1-p) Example: value shown on one roll of a fair die is Unif(1,6): P(X=i) = 1/6 E[X] = 7/2 Var[X] = 35/12 P(X=i) 0.10 0.16 0.22 0 1 2 3 4 5 6 7 3 4 i

Bernoulli random variables An experiment results in Success or Failure X is an indicator random variable (1 = success, 0 = failure) P(X=1) = p and P(X=0) = 1-p X is called a Bernoulli random variable: X ~ Ber(p) Examples: coin flip random binary digit whether a dis drive crashed binomial random variables Consider n independent random variables Yi ~ Ber(p) X = Σi Yi is the number of successes in n trials X is a Binomial random variable: X ~ Bin(n,p) Examples # of heads in n coin flips # of 1 s in a randomly generated length n bit string # of dis drive crashes in a 1000 computer cluster 5 6 binomial pmfs binomial pmfs PMF for X ~ Bin(10,0.5) PMF for X ~ Bin(10,0.25) PMF for X ~ Bin(30,0.5) PMF for X ~ Bin(30,0.1) P(X=) 0.00 0.05 0.10 0.15 0.20 0.25 0.30 P(X=) 0.00 0.05 0.10 0.15 0.20 0.25 0.30 P(X=) 0.00 0.05 0.10 0.15 0.20 0.25 P(X=) 0.00 0.05 0.10 0.15 0.20 0.25 0 2 4 6 8 10 0 2 4 6 8 10 0 5 10 15 20 25 30 0 5 10 15 20 25 30 7 8

mean, variance of the binomial (II) geometric distribution In a series X1, X2,... of Bernoulli trials with success probability p, let Y be the index of the first success, i.e., X1 = X2 =... = XY-1 = 0 & XY = 1 Then Y is a geometric random variable with parameter p. Examples: Number of coin flips until first head Number of blind guesses on SAT until I get one right Number of darts thrown until you hit a bullseye Number of random probes into hash table until empty slot Number of wild guesses at a password until you hit it 9 10 In a series X1, X2,... of Bernoulli trials with success probability p, let Y be the index of the first success, i.e., X1 = X2 =... = XY-1 = 0 & XY = 1 Then Y is a geometric random variable with parameter p. P(Y=) = (1-p) -1 p; Mean 1/p; Variance (1-p)/p 2 geometric distribution geometric distribution Flip a (biased) coin repeatedly until 1 st head observed How many flips? Let X be that number. P(X=1) = P(H) = p P(X=2) = P(TH) = (1-p)p P(X=3) = P(TTH) = (1-p) 2 p... Chec that it is a valid probability distribution: 1) memorize me! 2) 11 12

Let X be the number of flips up to & including 1 st head observed in repeated flips of a biased coin. P (H) = p; P (T )=1 p = q p(i) = pq i 1 E[X] = P i 1 ip(i) =P i 1 ipqi 1 = p P i 1 iqi 1 ( ) A calculus tric: PMF So (*) becomes: E[X] =p X iq i 1 p = (1 q) 2 = p p 2 = 1 p i 1 E.g.: p=1/2; on average head every 2 nd flip p=1/10; on average, head every 10 th flip. geometric random variable Geo(p) dy 0 /dy = 0 13 models & reality Sending a bit string over the networ n = 4 bits sent, each corrupted with probability 0.1 X = # of corrupted bits, X ~ Bin(4, 0.1) In real networs, large bit strings (length n 10 4 ) Corruption probability is very small: p 10-6 X ~ Bin(10 4, 10-6 ) is unwieldy to compute Extreme n and p values arise in many cases # bit errors in file written to dis # of typos in a boo # of elements in particular bucet of large hash table # of server crashes per day in giant data center # faceboo login requests sent to a particular server 14 Poisson random variables poisson random variables Suppose events happen, independently, at an average rate of λ per unit time. Let X be the actual number of events happening in a given time unit. Then X is a Poisson r.v. with parameter λ (denoted X ~ Poi(λ)) and has distribution (PMF): Siméon Poisson, 1781-1840 Examples: # of alpha particles emitted by a lump of radium in 1 sec. # of traffic accidents in Seattle in one year # of babies born in a day at UW Med center # of visitors to my web page today See B&T Section 6.2 for more on theoretical basis for Poisson. 15 P(X=i) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 λ = 0.5 λ = 3 0 1 2 3 4 5 6 16 i

poisson random variables X is a Poisson r.v. with parameter λ if it has PMF: poisson random variables X is a Poisson r.v. with parameter λ if it has PMF: Is it a valid distribution? Recall Taylor series: Is it a valid distribution? Recall Taylor series: So So 17 18 expected value of poisson r.v.s X ~ Binomial(n,p) binomial > Poisson in the limit i = 0 term is zero Poisson approximates binomial when n is large, p is small, and λ = np is moderate j = i-1 As expected, given definition in terms of average rate λ (Var[X] = λ, too; proof similar, see B&T example 6.20) 19 20

binomial poisson in the limit binomial random variable is poisson in the limit X ~ Binomial(n,p) Poisson approximates binomial when n is large, p is small, and λ = np is moderate Different interpretations of moderate, e.g. n > 20 and p < 0.05 n > 100 and p < 0.1 Formally, Binomial is Poisson in the limit as n (equivalently, p 0) while holding np = λ I.e., Binomial Poisson for large n, small p, moderate i, λ. Handy: Poisson has only 1 parameter the expected # of successes 21 22 sending data on a networ binomial vs poisson Consider sending bit string over a networ Send bit string of length n = 10 4 Probability of (independent) bit corruption is p = 10-6 X ~ Poi(λ = 10 4 10-6 = 0.01) What is probability that message arrives uncorrupted? Using Y ~ Bin(10 4, 10-6 ): P(Y=0) 0.990049829 I.e., Poisson approximation (here) is accurate to ~5 parts per billion P(X=) 0.00 0.10 0.20 Binomial(10, 0.3) Binomial(100, 0.03) Poisson(3) 0 2 4 6 8 10 23 24

Recall: if Y ~ Bin(n,p), then: E[Y] = pn Var[Y] = np(1-p) expectation and variance of a poisson And if X ~ Poi(λ) where λ = np (n, p 0) then E[X] = λ = np = E[Y] Var[X] = λ λ(1-λ/n) = np(1-p) = Var[Y] Recall: if Y ~ Bin(n,p), then: E[Y] = pn Var[Y] = np(1-p) expectation and variance of a poisson And if X ~ Poi(λ) where λ = np (n, p 0) then E[X] = λ = np = E[Y] Var[X] = λ λ(1-λ/n) = np(1-p) = Var[Y] Expectation and variance of Poisson are the same (λ) Expectation is the same as corresponding binomial Variance almost the same as corresponding binomial Note: when two different distributions share the same mean & variance, it suggests (but doesn t prove) that one may be a good approximation for the other. 25 26 balls in urns the hypergeometric distribution Draw n balls (without replacement) from an urn containing N, of which m are white, the rest blac. n Let X = number of white balls drawn m N m N i n i P (X = i) = N n some important (discrete) distributions Name PMF E(X) E[] E(X E[ 2 ) 2 ] 2 1 Uniform(a, b) f() = (b a+1), = a, a +1,...,b a+b 2 Bernoulli(p) f() = ( 1 p if =0 p if =1 (b a+1) 2 1 12 p p p(1 p) Binomial(p, n) f() = n p (1 p) n, =0, 1,...,n np np(1 p) Poisson( ) f() =e!, =0, 1,... ( + 1) E[X] = np, where p = m/n (the fraction of white balls) Geometric(p) f() =p(1 p) 1, =1, 2,... 1 p 2 p 1 p p 2 p 2 proof: Let Xj be 0/1 indicator for j-th ball is white, X = Σ Xj The Xj are dependent, but E[X] = E[Σ Xj] = Σ E[Xj] = np Var[X] = np(1-p)(1-(n-1)/(n-1)) Hypergeometric(n, N, m) f() = (m )( N ( N n) m n ), =0, 1,...,N nm N nm (n 1)(m 1) nm N N 1 +1 N lie binomial (almost) 27 28