Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes...

Post on 15-Jul-2020

2 views 0 download

Transcript of Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes...

Bernoulli and Binomial Distributions

Bernoulli Distribution Binomial Distribution Exercises

Bernoulli Distribution

a flipped coin turns up either heads or tailsan item on an assembly line is either defective or not defectivea piece of fruit is either damaged or not damageda cow is either pregnant or not pregnanta child is either female or male

X =

{1, if the outcome of the trial is a success0, if the outcome of the trial is a failure

X =

{1, w.p. p0, w.p. q = 1− p

We can write the pmf as

p(x) = px(1− p)1−x, x = 0, 1

Arthur Berg Bernoulli and Binomial Distributions 2/ 9

Bernoulli Distribution Binomial Distribution Exercises

Bernoulli Distribution

a flipped coin turns up either heads or tailsan item on an assembly line is either defective or not defectivea piece of fruit is either damaged or not damageda cow is either pregnant or not pregnanta child is either female or male

X =

{1, if the outcome of the trial is a success0, if the outcome of the trial is a failure

X =

{1, w.p. p0, w.p. q = 1− p

We can write the pmf as

p(x) = px(1− p)1−x, x = 0, 1

Arthur Berg Bernoulli and Binomial Distributions 2/ 9

Bernoulli Distribution Binomial Distribution Exercises

Bernoulli Distribution

a flipped coin turns up either heads or tailsan item on an assembly line is either defective or not defectivea piece of fruit is either damaged or not damageda cow is either pregnant or not pregnanta child is either female or male

X =

{1, if the outcome of the trial is a success0, if the outcome of the trial is a failure

X =

{1, w.p. p0, w.p. q = 1− p

We can write the pmf as

p(x) = px(1− p)1−x, x = 0, 1

Arthur Berg Bernoulli and Binomial Distributions 2/ 9

Bernoulli Distribution Binomial Distribution Exercises

Bernoulli Distribution

a flipped coin turns up either heads or tailsan item on an assembly line is either defective or not defectivea piece of fruit is either damaged or not damageda cow is either pregnant or not pregnanta child is either female or male

X =

{1, if the outcome of the trial is a success0, if the outcome of the trial is a failure

X =

{1, w.p. p0, w.p. q = 1− p

We can write the pmf as

p(x) = px(1− p)1−x, x = 0, 1

Arthur Berg Bernoulli and Binomial Distributions 2/ 9

Bernoulli Distribution Binomial Distribution Exercises

Expectation and Variance of Bernoulli(p)

E(X) =1∑

x=0

xp(x) = 0p(0) + 1p(1) = 0(1− p) + 1(p) = p

Noting that when X ∼ Bernoulli(p), X2 ∼ X, i.e. “X2 has the same distributionas X”.

var(X) = E(X2)− [E(X)]2 = p− p2 = p(1− p) = pq

Arthur Berg Bernoulli and Binomial Distributions 3/ 9

Bernoulli Distribution Binomial Distribution Exercises

Expectation and Variance of Bernoulli(p)

E(X) =1∑

x=0

xp(x) = 0p(0) + 1p(1) = 0(1− p) + 1(p) = p

Noting that when X ∼ Bernoulli(p), X2 ∼ X, i.e. “X2 has the same distributionas X”.

var(X) = E(X2)− [E(X)]2 = p− p2 = p(1− p) = pq

Arthur Berg Bernoulli and Binomial Distributions 3/ 9

Bernoulli Distribution Binomial Distribution Exercises

Expectation and Variance of Bernoulli(p)

E(X) =1∑

x=0

xp(x) = 0p(0) + 1p(1) = 0(1− p) + 1(p) = p

Noting that when X ∼ Bernoulli(p), X2 ∼ X, i.e. “X2 has the same distributionas X”.

var(X) = E(X2)− [E(X)]2 = p− p2 = p(1− p) = pq

Arthur Berg Bernoulli and Binomial Distributions 3/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Binomial Distribution

We are typically interested in n independent Bernoulli trials, each with aprobability p of success.Let Y1, Y2, . . . , Yn denote independent and identically-distributed (iid)Bernoulli(p) random variables.The sum X =

∑ni=1 Yi denotes the number of successes among n sampled items.

X is defined to be the binomial distribution with n trials and probability p ofsuccess, i.e. X ∼ binomial(n, p).The pmf of the binomial(n, p) is

p(x) =(

nx

)px(1− p)n−x =

(nx

)pxqn−x

Arthur Berg Bernoulli and Binomial Distributions 4/ 9

Bernoulli Distribution Binomial Distribution Exercises

Checking the Probability Mass Function Sums to One

The pmf of any discrete random variable should sum to one.Recall the binomial theorem:

(x + y)n =n∑

i=0

(ni

)xnyn−i

Thereforen∑

x=0

p(x) =n∑

x=0

(nx

)px(1− p)n−x = p + (1− p)n = 1n = 1

Arthur Berg Bernoulli and Binomial Distributions 5/ 9

Bernoulli Distribution Binomial Distribution Exercises

Checking the Probability Mass Function Sums to One

The pmf of any discrete random variable should sum to one.Recall the binomial theorem:

(x + y)n =n∑

i=0

(ni

)xnyn−i

Thereforen∑

x=0

p(x) =n∑

x=0

(nx

)px(1− p)n−x = p + (1− p)n = 1n = 1

Arthur Berg Bernoulli and Binomial Distributions 5/ 9

Bernoulli Distribution Binomial Distribution Exercises

Checking the Probability Mass Function Sums to One

The pmf of any discrete random variable should sum to one.Recall the binomial theorem:

(x + y)n =n∑

i=0

(ni

)xnyn−i

Thereforen∑

x=0

p(x) =n∑

x=0

(nx

)px(1− p)n−x = p + (1− p)n = 1n = 1

Arthur Berg Bernoulli and Binomial Distributions 5/ 9

Bernoulli Distribution Binomial Distribution Exercises

Checking the Probability Mass Function Sums to One

The pmf of any discrete random variable should sum to one.Recall the binomial theorem:

(x + y)n =n∑

i=0

(ni

)xnyn−i

Thereforen∑

x=0

p(x) =n∑

x=0

(nx

)px(1− p)n−x = p + (1− p)n = 1n = 1

Arthur Berg Bernoulli and Binomial Distributions 5/ 9

Bernoulli Distribution Binomial Distribution Exercises

Mean and Variance of Binomial(n, p)

Recall X ∼ binomial(n, p) can be written as X =∑n

i=1 Yi where

Y1, . . . , Yniid∼ Bernoulli(p).

Therefore

E(X) = E

(n∑

i=1

Yi

)=

n∑i=1

E(Yi) =n∑

i=1

p = np

And because of the independence, we similarly calculate the variance to be

var(X) = var

(n∑

i=1

Yi

)=

n∑i=1

var(Yi) =n∑

i=1

pq = npq

Arthur Berg Bernoulli and Binomial Distributions 6/ 9

Bernoulli Distribution Binomial Distribution Exercises

Mean and Variance of Binomial(n, p)

Recall X ∼ binomial(n, p) can be written as X =∑n

i=1 Yi where

Y1, . . . , Yniid∼ Bernoulli(p).

Therefore

E(X) = E

(n∑

i=1

Yi

)=

n∑i=1

E(Yi) =n∑

i=1

p = np

And because of the independence, we similarly calculate the variance to be

var(X) = var

(n∑

i=1

Yi

)=

n∑i=1

var(Yi) =n∑

i=1

pq = npq

Arthur Berg Bernoulli and Binomial Distributions 6/ 9

Bernoulli Distribution Binomial Distribution Exercises

Mean and Variance of Binomial(n, p)

Recall X ∼ binomial(n, p) can be written as X =∑n

i=1 Yi where

Y1, . . . , Yniid∼ Bernoulli(p).

Therefore

E(X) = E

(n∑

i=1

Yi

)=

n∑i=1

E(Yi) =n∑

i=1

p = np

And because of the independence, we similarly calculate the variance to be

var(X) = var

(n∑

i=1

Yi

)=

n∑i=1

var(Yi) =n∑

i=1

pq = npq

Arthur Berg Bernoulli and Binomial Distributions 6/ 9

Bernoulli Distribution Binomial Distribution Exercises

Problem From Last Time

discrete r.v.’s with mean 0 and variance 1Consider the discrete random variable

X =

{a, w.p. pb, w.p. 1− p

In class, we saw that a = ±1, b = ∓1, and p = 1/2 we have E(X) = 0 andvar(X) = 1.Are there other choices of a, b, and p that will give E(X) = 0 and var(X) = 1?

Arthur Berg Bernoulli and Binomial Distributions 7/ 9

Bernoulli Distribution Binomial Distribution Exercises

Exercise 4.45 (p.147)

Arthur Berg Bernoulli and Binomial Distributions 8/ 9

Bernoulli Distribution Binomial Distribution Exercises

Exercise 4.55 (p.149)

Arthur Berg Bernoulli and Binomial Distributions 9/ 9