24
Bernoulli and Binomial Distributions

Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

Bernoulli and Binomial Distributions

Page 2: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 3: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 4: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 5: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 6: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 7: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 8: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 9: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 10: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 11: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 12: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 13: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 14: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 15: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 16: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 17: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 18: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 19: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 20: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 21: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 22: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

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

Page 23: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

Bernoulli Distribution Binomial Distribution Exercises

Exercise 4.45 (p.147)

Arthur Berg Bernoulli and Binomial Distributions 8/ 9

Page 24: Bernoulli and Binomial DistributionsBernoulli(p) random variables. The sum X = P n i=1 Y i denotes the number of successes among n sampled items. X is defined to be the binomial distribution

Bernoulli Distribution Binomial Distribution Exercises

Exercise 4.55 (p.149)

Arthur Berg Bernoulli and Binomial Distributions 9/ 9