binomial distribution

35

Upload: baber-h-elahi

Post on 23-Oct-2014

429 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Binomial Distribution
Page 2: Binomial Distribution

Note 6 of 5E

Chapter 5Useful Discrete Probability

Distributions

Binomial Distribution

Page 3: Binomial Distribution

Note 6 of 5E

ReviewI. What’s in last lectures?

Experiment, Event, Sample space, Probability, Counting rules, Conditional probability, Bayes’s rule, random variables, Discrete and Continuous probability distributions, mean and variance and Normal distribution.

Chapter 1,2,3,4,6,7

II. What's in this lecture?• Binomial distribution and its applications.

Page 4: Binomial Distribution

Note 6 of 5E

Introduction

• Discrete random variables take on only a finite or countable number of values.

• There are several useful discrete probability distributions. We will learn Binomial,hypergeometric and Poisson distributions.

Page 5: Binomial Distribution

Note 6 of 5E

Events from experiments• While it is educational to learn about

general discrete and continuous random variables, such variables are not much use in describing real life events.

• The result of experiments usually can be expected to elaborate some distributions with special properties.

Page 6: Binomial Distribution

Note 6 of 5E

Bernoulli trials• In experiments where a certain process is carried

out repeatedly, with each process independent of the others, it is possible to deduce(to derive) the result of an event.

• In particular, if we can separate the outcomes of an experiment into two groups, one which is desirable, and we call it success, while the other a failure, then we have the case of a Bernoulli trial.

Page 7: Binomial Distribution

Note 6 of 5E

Success and failure• Take the weather. If we wish for a sunny day, then

we call a sunny day a success, and a rainy day a failure.

• A person may expect a grade B+ or better as a success, then anything less will be a failure.

• If you are expected to reach an office before 10.00 a.m. then arriving before then is a success, and being late will be a failure.

Page 8: Binomial Distribution

Note 6 of 5E

Examples of Bernoulli Variables

• Sex (male or female)

• Major (business or not business)

• Defective? (defective or non-defective)

• Response to a T-F question

(true or false)

• Where student lives

(on-campus or off-campus)

• Credit application result (accept or deny)

• Own home? (own or rent)

• Course result (Pass or Fail)

Page 9: Binomial Distribution

Note 6 of 5E

l Consider a situation where there are only two possible outcomes (a “Bernoulli trial”)

Example:u flipping a coin

The outcome is either a head or tailu rolling a dice

For example, 6 or not 6 (i.e. 1, 2, 3, 4, 5)

Label the possible outcomes by the variable kWe want to find the probability P(x) for event x to

occur Since k can take on only 2 values we define those values as:

x = 0 or x = 1u Let the probability for outcome “x” to occur be:

P(x = 0) = q (remember 0 ≤ q ≤ 1)

u something must happen so P(x = 0) + P(x = 1) = 1 (mutually

exclusive events) P(x = 1) = p = 1 - q

u We can write the probability distribution P(k) as:P(x) = px q1- x (Bernoulli distribution)

u coin toss: define probability for a head as P(1) P(x =1= head) = 0.5 and P(x=0=tail) =

0.5 too!u dice rolling: define probability for a six to be

rolled from a six sided dice as P(x =1) P(x=1) = 1/6 and P(x =0 =not a six) =

5/6.

James Bernoulli (Jacob I) born in Basel, SwitzerlandDec. 27, 1654-Aug. 16, 1705He is one 8 mathematicians in the Bernoulli family. (from Wikipedia)

Bernoulli & Binomial

Page 10: Binomial Distribution

Note 6 of 5E

Let’s do something more complicated:

Suppose we have N trials (e.g. we flip a coin N times) what is the probability to get x successes(= heads)?l Consider tossing a coin twice. The possible outcomes are:

no heads: P(x = 0) = q2

one head: P(x = 1) = qp + pq (toss 1 is a tail, toss 2 is a head or toss 1 is head, toss 2 is a tail)

= 2pq

two heads: P(x = 2) = p2

• We want the probability distribution P(x, N, p) where

Note: P(x =0)+P(x=1)+P(x=2)=q2+ qp + pq +p2= (p+q)2 = 1 (as it should!)

x = number of success (e.g. number of heads in a coin toss)N = number of trials (e.g. number of coin tosses)p = probability for a success (e.g. 0.5 for a head)

we don't care which of the tosses is a head so there are two outcomes that give one head

Page 11: Binomial Distribution

Note 6 of 5E

Binomial DistributionIf we repeat a Bernoulli trial many times, and count the number of successes using X, then we shall have a binomial distribution if

1. Each trial is independent of the other;2. The probability of each success remains the

same for each trial.• If the probability of each success is p, and we

run the experiment n times, then suppose we use X to represent the number of successes, we shall write X ~ Bin(n, p).

Page 12: Binomial Distribution

Note 6 of 5E

P(X= x) If X~Bin(n, p), then1. P(X=0) designates probability of no success at

all. This is equal to (1-p)n.2. P(X=n) means probability of getting all n

successes. This is equal to pn.

3. For any other x, P(X=x)=nCx px(1-p)n-x.

NOTE: For brevity, we usually use the symbol q to represent 1-p. Hence the formula is frequently written as P(X=x )=nCx px qn-x.

Page 13: Binomial Distribution

Note 6 of 5E

The Binomial Probability Distribution

For a binomial experiment with n trials and probability p of success on a given trial, the probability of x successes in n trials is

.1!0 and 1)2)...(2)(1(!with

)!(!

! Recall

.,...2,1,0for )!(!

!)(

nnnn

xnx

nC

nxqpxnx

nqpCkxP

nx

xnxxnxnx

Page 14: Binomial Distribution

Note 6 of 5E

The Binomial Random Variable The coin-tossing experiment is a

simple example of a binomial random variable. Toss a fair coin n = 3 times and record x = number of heads.

x p(x)

0 1/8

1 3/8

2 3/8

3 1/8

Page 15: Binomial Distribution

Note 6 of 5E

The Binomial Random Variable• Many situations in real life resemble the coin

toss, but the coin is not necessarily fair, so that P(H) 1/2.

• Example: A geneticist samples 10 people and counts the number who have a gene linked to Alzheimer’s disease(loss of mental ability)

Person• Coin:• Head:• Tail:

• Number of tosses:

• P(H):Has gene

Doesn’t have gene

n = 10

P(has gene) = proportion in the population who

have the gene.

Page 16: Binomial Distribution

Note 6 of 5E

The Binomial Experiment1. The experiment consists of n identical

trials.2. Each trial results in one of two outcomes,

success (S) or failure (F).3. The probability of success on a single trial

is p and remains constant from trial to trial. The probability of failure is q = 1 – p.

4. The trials are independent.5. We are interested in x, the number of

successes in n trials.

Page 17: Binomial Distribution

Note 6 of 5E

Binomial or Not? The independence is a key assumption

that often violated in real life applications

• Select two people from the U.S. population, and suppose that 15% of the population has the Alzheimer’s gene.• For the first person, p = P(gene) = .15• For the second person, p P(gene) = .15,

even though one person has been removed from the population.

Page 18: Binomial Distribution

Note 6 of 5E

Binomial or Not?

2 out of 20 PCs are defective. We randomly select 3 for testing. Is this a binomial experiment?

1. The experiment consists of n=3 identical trials2. Each trial result in one of two outcomes3. The probability of success (finding the defective) is

2/20 and remains the same4. The trials are not independent. For example, P( success on the 2nd trial | success on the 1st trial) =

1/19, not 2/20

Rule of thumb: if the sample size n is relatively large to the population size N, say n/N >= .05, the resulting experiment would not be binomial.

Page 19: Binomial Distribution

Note 6 of 5E

Bin(n, p) – ExampleIf a Bernoulli trial has a success rate of 0.2, and it is

carried out 7 times, what is the probability we get

(i) 4 successes?(ii) No success?Solution: Let X represent the number of successes.

Then X ~ Bin(7, 0.2).

(iii) So P(X=4) = 7C40.240.83 = 0.0287.(iv) P(X=0) = 0.87 = 0.2097.

Page 20: Binomial Distribution

Note 6 of 5E

Bin(n, p) – ExampleIt is known that in 35% of accidents involving motorcycles,

the rider dies. On a day when 10 such accidents are reported, what is the probability

(i) 2 riders die?(ii) At least 3 riders die?

Solution: Let D represent the number of deaths.

Then D ~ Bin(10, 0.35).(iii) So P(D=2) = 10C20.3520.658 = 0.17565.(iv) In this case, we want P(D3). This means we need to add

up P(D=3), P(D=4) … P(D=10). However, we note that the sum of all probabilities is 1. So, we may also obtain P(D3) as 1 – [P(D=0)+ P(D=1)+ P(D=2)] = 1 – [0.01346+0.07249+0.17565] =0.7384 (correct to 4 decimal places)

Page 21: Binomial Distribution

Note 6 of 5E

Example

25 trainees undergo a perseverance test. Based on records, it is known that 40% of them will drop off before completion. What is the probability that

(i) Up to 6 of them will drop?(ii) 4 to 8 of them will drop?Solution: Let X represent the number of trainees who drop.

Then X~Bin(25, 0.4)(iii) P(X6) = 0.0736 [Read from table](iv) P(4 X 8) = P(X 8) – P(X 3)

= 0.2735 – 0.0024 = 0.2711.Note that in (ii), we have to express the value as the

difference between two others.

Page 22: Binomial Distribution

Note 6 of 5E

Example

• The head of department calls a policy meeting among his 23 clerical staff. From experience, he knows that 15% of them will be absent. What is the probability

(i) 3 to 5 of them will be absent?

(ii) At least 3 of them will be absent?

Solution: A = number absent ~ Bin(23, 0.15)

(iii) We need P(3A5). In this case, we can read P(A5) = 0.8811, and P(A2) = 0.3080, so P(3A5) = P(A5) – P(A2) = 0.5731.

(contd)

Page 23: Binomial Distribution

Note 6 of 5E

Example (contd)(i) (contd) However, as P(3A5) = P(A=3) + P(A=4) +

P(A=5), it is just as easy to calculate the three values using the formula. Now

P(A=3) =23C30.1530.8520 = 0.23167;

P(A=4) =23C40.1540.8519 = 0.20442;

P(A=5) =23C50.1550.8518 = 0.13708;

So P(3A5) = 0.23167+0.20442+0.13708=0.6618 (4 d.p.)

(ii) The event of A 3 need to be interpreted as the event complement to A 2. Hence we decide that P(A3) = 1 – P(A2) = 1 – 0.3382 = 0.6618.

Page 24: Binomial Distribution

Note 6 of 5E

n = p = x =success =

ExampleA marksman hits a target 80% of the time. He fires five shots at the target. What is the probability that exactly 3 shots hit the target?

333)3( nn qpCxP

5 .8hit # of hits

353 )2(.)8(.!2!3

!5

2048.)2(.)8(.10 23

Page 25: Binomial Distribution

Note 6 of 5E

Example

What is the probability that more than 3 shots hit the target?

55555

45454)3( qpCqpCxP

0514 )2(.)8(.!0!5

!5)2(.)8(.

!1!4

!5

7373.)8(.)2(.)8(.5 54

Page 26: Binomial Distribution

Note 6 of 5E

Cumulative Probability Tables

You can use the cumulative probability tables to find probabilities for selected binomial distributions.

Find the table for the correct value of n.

Find the column for the correct value of p.

The row marked “r” gives the cumulative probability, P(x r) = P(x = 0) +…+ P(x = r)

Find the table for the correct value of n.

Find the column for the correct value of p.

The row marked “r” gives the cumulative probability, P(x r) = P(x = 0) +…+ P(x = r)

Page 27: Binomial Distribution

Note 6 of 5E

Example

k p = .80

0 .000

1 .007

2 .058

3 .263

4 .672

5 1.000

What is the probability that more than 3 shots hit the target?

P(x > 3) = 1 - P(x 3)= 1 - .263 = .737

P(x > 3) = 1 - P(x 3)= 1 - .263 = .737

Check from formula: P(x > 3) = .7373

Page 28: Binomial Distribution

Note 6 of 5E

Example Here is the probability

distribution for x = number of hits. What are the mean and standard deviation for x?

89.)2)(.8(.5

4)8(.5

npq

np

:deviation Standard

:Mean

m

Page 29: Binomial Distribution

Note 6 of 5E

Properties of binomial distribution

• p is small, its main values For X~Bin(n, p), the mean = np, and the variance 2 = npq.

• When p is close to 0.5, (say from 0.3 to 0.7) the distribution will be quite symmetric.

Page 30: Binomial Distribution

Note 6 of 5E

Bar charts for p=0.4 and p=0.9

Page 31: Binomial Distribution

Note 6 of 5E

Tables of binomial distributions

• In practice, it is not desirable to carry out calculations such as P(D=3), P(D=4) … P(D=10) as for the last example. Apart from time, this tedious work may lead to errors.

• Particularly when calculators are not available, statisticians find it more convenient to use ready-made tables of binomial distributions.

• The table provides probabilities cumulative from below. I.e. the table shows P(X r) for each r, not P(X=r).

Page 32: Binomial Distribution

Note 6 of 5E

Table for Binomial Distribution

• The binomial distribution table shows cumulative probabilities [P(X r)] for r = 0, … n. The table list the probabilities separately for n=1, 2, 20, 23, 25, 27, and 30.

• The table shows p=0.01, … 0.09 (first part) 0.10, 0.15, …0.50 (second part).

• For values of p beyond 0.5, we have to use complementary procedures. For values between the given p, and n=21, 22, 26, 28 and 29, we may use linear interpolation for approximate answers.

Page 33: Binomial Distribution

Note 6 of 5E

Use and Limitations of Table

• Going back to Example 2, we could have referred to the table, and read off P(D2) which is 0.2616, and hence obtain P(D3) as 1 – 0.2616 = 0.7384.

• However, space constraint means that only n30 can be accommodated in a small handbook, and we only have values of p=0.01, …0.09, 0.1, 0.15, …0.5. We have to deal with cases of other p values ourselves.

• In the following examples, you will learn to deal with each of the cases when the table can be used, and how to overcome the limitations when they occur.

Page 34: Binomial Distribution

Note 6 of 5E

Key Concepts The Binomial Random Variable

1. Five characteristics: n identical trials, each resulting in either success S or failure F; probability of success is p and remains constant from trial to trial; trials are independent; and x is the number of successes in n trials.

2. Calculating binomial probabilities

a. Formula:

b. Cumulative binomial tables

3. Mean of the binomial random variable: m = np

4. Variance and standard deviation: s 2 = npq and

xnxnx qpCxXP )(

npq

Page 35: Binomial Distribution

Note 6 of 5E

“Life is like a river which has many turns But these turns never return. So enjoy every turn of life & Welcome every day with a new joy & smile”

THANK YOU

Have a Nice Day