34
1 Binomial Random Variables Lecture 5 Many experiments are like tossing a coin a fixed number of times and recording the up-face. The two possible outcomes are Heads and Tails. Each outcome has an associated probability. For a fair coin, P(Heads) = P(Tails) = .50 X = # of Heads (or Tails) in n trials. X constitutes a Binomial Random Variable

1 Binomial Random Variables Lecture 5 Many experiments are like tossing a coin a fixed number of times and recording the up-face. The two possible

Embed Size (px)

DESCRIPTION

3 Binomial Random Variables Lecture 5  The logic on the previous slide works with experiments similar to a series of coin tosses.  Here, the Binomial Random Variable is the # of times an outcome of interest occurs.  Example: we ask a sample of UWO students whether they favor canceling all midterms.  The BRV would be X, the number of students in favor out of n students in the sample.

Citation preview

Page 1: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

1Binomial Random Variables

Lecture 5

Many experiments are like tossing a coin a fixed number of times and recording the up-face. The two possible outcomes are Heads and

Tails. Each outcome has an associated

probability. For a fair coin, P(Heads) = P(Tails) = .50 X = # of Heads (or Tails) in n trials. X constitutes a Binomial Random Variable

Page 2: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

2Binomial Random Variables

Lecture 5

X is binomial because there are only two possible outcomes. In a coin toss, these outcomes are Heads,

Tails. X is random because the outcome is not

predictable in advance (at least in practice) X is a variable: the outcome of interest

(e.g., the # of Heads in n tosses) varies from one set of n tosses to the next set of n tosses.

Page 3: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

3Binomial Random Variables

Lecture 5

The logic on the previous slide works with experiments similar to a series of coin tosses.

Here, the Binomial Random Variable is the # of times an outcome of interest occurs.

Example: we ask a sample of UWO students whether they favor canceling all midterms.

The BRV would be X, the number of students in favor out of n students in the sample.

Page 4: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

4Necessary Conditions for a BRV

Lecture 5

1. The experiment consists of n identical trials2. There are only 2 possible outcomes, called

success (S) & failure (F) (labels are arbitrary)3. P(S) = p. P(F) = q = (1-p). P and q are

constant across trials.4. Trials are independent of each other

(because p and q are constant across trials)5. BRV X = # of successes in n trials.

Page 5: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

53 ways to compute a binomial probability

Lecture 5

It is often of interest to know the probability of obtaining X successes in n trials of a binomial experiment. There are 3 ways to determine that probability.

1. Table look-up2. Binomial expansion formula3. Normal approximation to the Binomial

Page 6: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

6BRV – Method #1

Lecture 5

Our preferred method of determining a binomial probability is to look it up in the Binomial Probability Table, found in Table II, Appendix A, in the text.

Table II contains cumulative probabilities – that is, for any X, the table gives the probability of observing X or fewer successes in n trials.

Page 7: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

7BRV – Method #2

Lecture 5

Expansion Formula: P(X) = ( )pxq(n-x) (X = 0, 1, 2,

… n)

p = probability of success on a single trial

q = 1 – p n = number of trials observed x = # of successes in those n trials

nx

Page 8: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

8BRV – Method #2

Lecture 5

Why use this ugly expansion formula instead of a table? Table II applies only for values of n = 5, 6,

7, 8, 9, 10, 15, 20, 25, and for a particular set of p values.

In other cases: When n is small, use the expansion formula. When n is large, use the normal

approximation to the binomial (discussed later this term).

Page 9: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

9BRV – Example 1

Lecture 5

Air Canada keeps telling us that arrival and departure times at Pearson International are improving. Right now, the statistics show that 60% of the Air Canada planes coming into Pearson do arrive on time. (This actually is an improvement over 10 years ago when only 42% of the Air Canada planes arrived on time at Pearson.) The problem is that when a plane arrives on time, it often has to circle the airport because there’s still a plane in its gate (a plane which didn’t leave on time). Statistics also show that 50% of the planes that arrive on time have to circle at least once, while only 35% of the planes that arrive late have to circle at least once.

Page 10: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

10BRV – Example 1

Lecture 5

a). Of the next 15 Air Canada planes that arrive at Pearson, what’s the probability that fewer than 5 of them arrive late?

P(late) = .40 (because P(on time) = .60)

P(X < 5) = P(X ≤ 4) = .217 (from Table for n=15)

Page 11: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

11BRV – Example 1

Lecture 5

b) Of the next 8 Air Canada planes that arrive late at Pearson, what’s the probability that no more than 6 of them can land without having to circle at least once?

P(Land │Late) = .65 P(X ≤ 6) = 1 – P(X > 6) = 1 – P(X = 7 or X = 8) = 1 – 8 (.65)7 (.35) – 8 (.65)8

(.35)0 7 8( ) ( )

Page 12: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

12BRV – Example 1

Lecture 5

P (X ≤ 6) = 1 - .1373 - .0319 = .8308

Page 13: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

13Introduction to Hypothesis Testing

Lecture 5

As scientists, we often want to make inferences from what is true of a sample to what is true of the population it came from.

Logic of this approach:1. Make a hypothesis (“X”) about a population2. Say, if “X” (the hypothesis) is true in the

population, then something very much like “X” should be true in the sample

Page 14: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

14Introduction to Hypothesis Testing

Lecture 5

Logic of this approach (continued):

3. Measure the sample and find out if “X” is true in the sample. This gives you a FACT.

4. Make a decision as to whether “X” is true in the population. This is a CONCLUSION.

Note the distinction between FACT and CONCLUSION.

Page 15: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

15Hypothesis Testing Example

Lecture 5

A bag contains 100 marbles. Each marble is either red or blue. One of two conditions exists with respect to the numbers of red and blue marbles.

HO: There are equal numbers of red & blue marbles

HA: 60% of the marbles are blue.

Page 16: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

16Hypothesis Testing Example

Lecture 5

HO: There are equal numbers of red & blue marbles

We call this hypothesis the Null Hypothesis. HO is the hypothesis of no effect, no difference. In this example, no difference in # of red vs. # of

blue marbles in the bag. Real-life application: we administer a new therapy

to patient group A and a placebo to group B. HO says that the two groups are not different in the severity of their disorder afterwards – that is, the therapy has no effect.

Page 17: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

17Hypothesis Testing Example

Lecture 5

HA: 60% of the marbles are blue.

HA – the Alternative Hypothesis – says that there is a difference (in this case, the difference is specified) In this example, a difference between the #

of red and the # of blue marbles in the bag. Real-life application: HA predicts a difference

in disorder severity between group that got new therapy and group that got placebo.

Page 18: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

18Hypothesis Testing Example

Lecture 5

Which hypothesis is true (HO or HA)?

You do an experiment: you randomly select 10 marbles one at a time,

with replacement, and record X = the # of blue marbles.

You have a decision rule: You decide that if 7 or more of the 10 marbles

are blue, you will conclude that HA is true.

Page 19: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

19Hypothesis Testing Example

Lecture 5

Again, note this decision rule:

You decide that if 7 or more of the 10 marbles are blue, you will conclude that HA is true.

That is, if X ≥ 7, you conclude that HA is true.

Our conclusion depends upon a number (an observation).

Page 20: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

20Hypothesis Testing Example

Lecture 5

a. Suppose that HO is true. What is the probability that you WRONGLY conclude that HA is true?

HO: P(Blue) = .5 HA: P(Blue) > .5 (note: sometimes we specify

HA)

What is P(X ≥ 7 │P(Blue) = .5)? (What is X?) We call that value α (“Alpha”) – the probability

of falsely rejecting HO.

Page 21: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

21Hypothesis Testing Example

Lecture 5

Notice what we’re doing here. Suppose that – unbeknownst to us – HO is true.

We take 10 marbles out of the bag. Even though red and blue marbles are equal in number, we might by bad luck get more blue ones than red ones. We might even get 7 or more blue ones. What is the probability that we do that?

Page 22: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

22Hypothesis Testing Example

Lecture 5

P(X ≥ 7 │P(Blue)=.5) = 1 – P(X ≤ 6) = 1 - .828 (from

Table) = .172

Page 23: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

23Hypothesis Testing Example

Lecture 5

A bag contains 100 marbles. Each marble is either red or blue. One of two conditions exists with respect to the numbers of red and blue marbles.

HO: There are equal numbers of red & blue marbles

HA: 60% of the marbles are blue.

Page 24: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

24Hypothesis Testing Example

Lecture 5

b. If, in fact, HA is true, what is the probability that you WRONGLY conclude that HO is true? This value is called β (“Beta”) β is the probability that you fail to reject HO

when you should in fact reject it. You will reject HO if fewer than 7 of the 10

marbles taken from the bag are blue. P(X ≤ 6 │P(Blue)=.6) = .618 (from

Table)

Why is p = .6 here?

Page 25: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

25BRV – Example 3

Lecture 5

Records for the last 5 years at UWO show that only 20% of students taking an Honors degree in Psychology fail to get a full time job within 6 months of graduating.

a) I send out a survey to 4 randomly selected Honors Psychology graduates from last year. What is the probability that all are employed full time?

b) In a random sample of 15 previous graduates, what is the probability that more than 5 are not employed full time?

Page 26: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

26BRV – Example 3

Lecture 5

a. n and x are small, so use Expansion Formula

n = 4 and x = 4, so:

4! (.8)4 (2)0 = .4096 4! 0!

Page 27: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

27BRV – Example 3

Lecture 5

b. Here, n = 15, and the question is, what is the probability that X > 5?

P(X > 5) = P(X ≥ 6) = 1- P(X ≤ 5)

We’re told that p = .20 We remember that Table II gives cumulative probabilities, so…

P(X > 5) = 1 - .939 (from Table II) = .061

Page 28: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

28BRV – Example 4

Lecture 5

There’s a new game in Las Vegas in which a customer is handed a fair coin and allowed to flip it 25 times. If she gets 15 or more heads, she wins. You are hired by the Las Vegas Police to check out this game.

You watch the game in the morning. Only 8 people played, and they all lost. What is the probability that this happened by chance?

Page 29: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

29BRV – Example 4

Lecture 5

In answering this question, keep in mind the following distinctions:

A. 1 flip of the coinB. 1 play of the game (= 1 experiment)C. How you win when you play this game

Page 30: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

Lecture 5

One flip of the coin

25 flips = 1 play (1 trial of the experiment)

8 people play the game once each

Page 31: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

31BRV – Example 4

Lecture 5

To answer this question, we need:

1. The probability of getting heads when you flip the coin once.2. The probability of one person getting 14 or fewer heads when they flip the coin 25 times (and thus losing).3. The probability that 8 out of 8 people get 14 or fewer heads when they each flip the coin 25 times.

Page 32: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

32BRV – Example 4

Lecture 5

1. P(Heads) on any flip = .5 (if coin is fair).

2. With 25 flips, from Table II,P(X ≤ 14) = P(losing game) = .788

Therefore, P(losing) for any one person is .788

Page 33: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

33What is p that 8 out of 8 players lose?

Lecture 5

What is the probability that 8 out of 8 customers lose? (We define “success” as losing here.)

P(X = 8) = ( ) (.7888) (.2120) = .1487

So, you might be suspicious that the game is fixed – because it’s very unlikely that 8 out of 8 players would lose. (Not impossible, but unlikely).

88

What’s this? Why 0?

Page 34: 1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible

Lecture 5

P(Heads) = .5P(losing) = .788

P(8 out 8 people lose) = .1487