Chapter 12 · Relative Frequencies and Probability Early, we saw the the relative frequency or...

Preview:

Citation preview

Chapter 12From Randomness to Probability

D. Raffle

5/27/2015

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

1 of 31 06/01/2015 11:26 PM

Review

Recall from Chapter 9:

In this chapter, we will:

When a situation is random, we know what outcomes can possibly occur, butnot which outcome will happen next

Randomness is uncertain in the short term, but well-behaved in the long term

·

·

Formalize the concepts of randomness

Introduce the ideas of probability

·

·

2/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

2 of 31 06/01/2015 11:26 PM

Random Phenomena

A random phenomena is a situation in which we know what outcomes canpossibly occur, but not which one will occur next.

Examples:

Approaching a stoplight

Flipping a coin

Rolling a die

Seeing how long it will take for a bus to arrive

·

·

·

·

3/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

3 of 31 06/01/2015 11:26 PM

Vocabulary

A trial:

Outcome:

Event:

Sample Space:

Each occasion where we observe the outcome of a random phenomena·

The value that we observe for a trial·

Any combinations of possible outcomes (or a single outcome)·

The list of all possible outcomes·

4/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

4 of 31 06/01/2015 11:26 PM

Example: Flipping Two Coins

The Trial:

The Outcomes:

Events:

The Sample Space:

Every time we flip the two coins, it is one trial·

The result of flipping the coins, e.g. or · HH HT

Any combination of results, e.g. getting at least one heads· {HH, HT , TH}

· S = {HH, HT , TH, TT}

5/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

5 of 31 06/01/2015 11:26 PM

Relative Frequencies and Probability

Early, we saw the the relative frequency or sample proportion of a categoricalvariable was:

The relative frequency is often used to estimate the probability of an eventoccuring. If we flip a coin ten times and see 4 heads,

When studying probability, the sample size is the number of trials

· = =p̂# of successes

sample sizexn

· = = = 0.4 = 40%p̂ xn

410

n

6/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

6 of 31 06/01/2015 11:26 PM

The Long Term

We say that random events are well behaved in the long term. What do wemean?

If we flip a coin once, we get 100% or 0% heads.

If we flip a coin 10 times, we would expect about 5 heads

Getting 4 or 6 heads is less likely, but not uncommon

3 or 7 would be even less likely, but nothing to write home about

2 or 8; 1 or 9; and 0 or 10 are pretty rare, but might happen every once in awhile

As we flip the coin more, the proportion of heads should be close to

The more times we flip the coin, getting away from 50% gets harder

·

·

·

·

·

· 12

·

7/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

7 of 31 06/01/2015 11:26 PM

The Law of Large Numbers (LLN)

We call the long term probability the empirical probability (but it is still anobserved probability, )

The Law of Large Numbers says

As we increase the number of trials, the relative frequency settles towards theempirical probability

·

8/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

8 of 31 06/01/2015 11:26 PM

LLN Requirements

Identical Probabilities:

Independence

The probability of successes does not change from trial to trial

The probability of getting heads when flipping a coin is always

·

· 12

The outcome of one trial does not effect the outcome of any others

Phenomena that meet this requirement are sometimes called memoryless

A coin doesn't remember what came up last time

·

·

·

9/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

9 of 31 06/01/2015 11:26 PM

LLN Example: Flipping Coins, n = 100

10/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

10 of 31 06/01/2015 11:26 PM

LLN Example: Flipping Coins, n = 1000

11/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

11 of 31 06/01/2015 11:26 PM

LLN Example: Flipping Coins, n = 10000

12/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

12 of 31 06/01/2015 11:26 PM

LLN Example: Rolling 10000 Dice

13/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

13 of 31 06/01/2015 11:26 PM

The Law of Averages

If I flip a coin 5 times and get heads each time, am I due for a tails?

If you lose twenty poker hands in a row, are you due for some good luck?

If San Francisco averages a major earthquake every 100 years, and they haven'thad one since 1906, are they due for another this year?

NO. If the trials are independent, you are never due for a particular outcome

The "law of averages" doesn't exist– in the short term we can never know whatwill happen next

·

·

Absolutely not.

The "law of averages" is also called the gambler's fallacy

·

·

Again, no. The average is only in the long term, it says nothing about this year.·

14/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

14 of 31 06/01/2015 11:26 PM

Modeling Probability

So far, we've discussed the probabilities of event's we've already observed. Nowwe'll shift to theoretical probabilities.

Notation

If all outcomes are equally likely, the probability of event can be calculated as:

Describing Probability

We call the probability of event occuring · A P(A)

A

· P(A) = # of ways A can occurTotal # of outcomes

Probabilities are generally written as proportions/decimals

They can also be written as percent chances

·

·

15/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

15 of 31 06/01/2015 11:26 PM

Examples

Consider flipping a coin twice. What's the sample space?

Let be getting one heads. What is ?

Let be getting at least one heads. What is ?

· S = HH, HT , TH, HH

A P(A)

can occur 2 ways: · A HT , TH

· P(A) = =24

12

B P(B)

can occur 3 ways: · B HH, HT , TH

· P(B) = 34

16/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

16 of 31 06/01/2015 11:26 PM

Equally Likely

Say we pick two people randomly. What's the probability we select twoleft-handed people?

Using our formula from before,

Does this hold up?

· S = LL, LR, RL, RR

· P(LL) = 14

There are way more right handed people than left-handed, so

For more complicated probability models, we need better methods

We will discuss these in detail in Chapter 14

For now, I'll give you probabilities of events

· P(LL) ≠ 14

·

·

·

17/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

17 of 31 06/01/2015 11:26 PM

Formal Probability

Now we can start using probability to solve more interesting problem. For now,we'll focus on simple cases:

Disjoint events

Independent events

Events and have no outcomes in common.

They cannot occur in the same trial.

E.g., heads and tails on a coin flip

· A B

·

·

Events and are independent if knowing that happened, it doesn't tellus about

If traffic is the same every day of the week, knowing what day it is doesn't tellme if I'll make it to work on time

· A B BA

·

18/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

18 of 31 06/01/2015 11:26 PM

Rules 1 and 2

Rule 1:

Rule 2:

0 ≤ P(A) ≤ 1

Probabilities cannot be less than 0 or above 1

You can't have a 125% chance of winning a game

A percent chance of -45% is just as non-sensical

·

· (P(A) = 1.25)· (P(A) = −0.45)

P(S) = 1

is the sample space, and describes all possible outcomes

One of these outcomes needs to have happened

There must be a 100% chance of one of the outcomes happening

· S

·

·

19/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

19 of 31 06/01/2015 11:26 PM

Rule 3: The Complement Rule

The complement of an event is its opposite.

If we roll a six-sided die, the probability of getting a 1 is . What is the probability

of not rolling a 1?

We write the complement of as

If is the probability of , is the probability of not occuring

will either occur or not occur, so

The complement rule:

· A AC

· P(A) A P( )AC A

· A P(A) + P( ) = 1AC

· P( ) = 1 − P(A)AC

16

· P(A) = 16

· P( ) = 1 − = − = =AC 16

66

16

6−16

56

20/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

20 of 31 06/01/2015 11:26 PM

Visualizing the Complement Rule

21/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

21 of 31 06/01/2015 11:26 PM

Complement Rule Example

Say that the probability of getting a greenlight at a particular intersection is 0.35.What is the probability of not getting a green light?

There is a 65% chance of getting a yellow or red light at the intersection.

· P(not green) = P( )greenC

= 1 − P(green)= 1 − 0.35= 0.65

·

22/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

22 of 31 06/01/2015 11:26 PM

Rule 4: The Addition Rule

If two events are disjoint, the probability of or is given as:

AB

We will discuss handing events that are notdisjoint in the next chapter

· P(A or B) = P(A) + P(B)·

23/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

23 of 31 06/01/2015 11:26 PM

Addition Rule Example

Say the there is a 35% chance of a particular stoplight being green, and a 4%chance of it being yellow. What is the probability we get through the light?

We make it through if the light is green or yellow

There is a 39% chance of making it through the light

·

· P(G) = 0.35· P(Y ) = 0.04· P(Y or G) = 0.35 + 0.04· P(Y or G) = 0.39·

24/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

24 of 31 06/01/2015 11:26 PM

Addition Rule – Not Disjoint

Say there is a 65% chance of a person owning a smartphone and a 40% chancethat they own a laptop. What's the chance that they own a smartphone or alaptop?

Using the rules we know:

This means that there is a 105% chance they own on or the other

This violates rule 1

We run into problems because people can own both, so they're not disjointevents

We'll learn how to handle this situation in Chapter 13

· P(smartphone) = 0.65· P(laptop) = 0.40· P(smartphone or laptop) = 0.65 + 0.40 = 1.05·

·

·

·

25/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

25 of 31 06/01/2015 11:26 PM

Combining Rules

Using our intersection from before, where and ,what is the probability that we don't make it through the intersection? We needto find the probability of seeing a redlight, which we'll call

P(G) = 0.35 P(Y ) = 0.04

P(R)

There is a 61% chance of missing the light

· P(R) = 1 − P( )RC

= 1 − P(G or Y )= 1 − [P(G) + P(Y )]= 1 − [0.35 + 0.04]= 1 − 0.39= 0.61

·

26/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

26 of 31 06/01/2015 11:26 PM

Rule 5: The Multiplication Rule

If two events are independent, knowing thatone event occured does not influence theprobability of the other event. In this case,

This extends to more than two independentevents

We will see how to deal with dependentevents in the next chapter.

· P(A and B) = P(A) × P(B)·

· P(A and B AND C)= P(A) × P(B) × P(C)

·

27/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

27 of 31 06/01/2015 11:26 PM

Multiplication Rule Example

Say our stoplight behaves the same way every day of the week. This means thatday of the week is independent of the color of the light when we approach theintersection. What is the probability of getting a greenlight on Monday, a yellowlight on Tuesday, and a redlight on Wednesday?

Because day and light are independent, given day =

There is a 0.8% chance of getting this sequence of lights on consecutive days.

Note that, because this is multiplication, the order of the lights doesn't matter.

· P(color) P(color)

· P(G Mon. AND Y Tues. AND R Weds.) = P(R) × P(Y ) × P(R)= 0.65 × 0.04 × 0.31= 0.008

·

·

28/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

28 of 31 06/01/2015 11:26 PM

Combining Rules

What is the probability that, in a given week, we get at least one redlight?

There is about a 99.86% chance of hitting a redlight at least once in a week.

· P(at least 1 red) = 1 − P( )at least 1 redC

= 1 − P(no reds)= 1 − P(not red)7

= 1 − ( (we found P( ) earlier)RC)7 RC

= 1 − ×0.397

= 1 − 0.0014≈ 0.9986

·

29/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

29 of 31 06/01/2015 11:26 PM

What can go wrong?

Check that probabilities that don't add up to exactly one

Don't just add probabilities of events if they're not disjoint

If they add up to less than one, you're missing an outcome

If they add up to over one, you don't have disjoint events

·

·

We have a better rule for this situation·

30/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

30 of 31 06/01/2015 11:26 PM

What can go wrong?

Don't just multiply events that aren't independent:

Don't confuse disjoint and independent

We have a better rule for this

· P(Over 6' and on basketball team)≠ P(over 6') × P(on basketball team)

·

Getting heads and tails are disjoint

If its heads, it cannot be tails

heads and tails cannot be independent because knowing that a coin flipended in tails means the probability of it being heads is zero

·

·

·

31/31

Chapter 12 http://stat.wvu.edu/~draffle/111/week3/ch12/ch12...

31 of 31 06/01/2015 11:26 PM

Recommended