chapter 6: probability and simulation - math with...

43
Chapter 6: Probability and Simulation The study of randomness

Upload: others

Post on 22-Mar-2020

18 views

Category:

Documents


2 download

TRANSCRIPT

Chapter 6:

Probability and

SimulationThe study of randomness

6.1 Randomness Probability describes the pattern of

chance outcomes.

Probability is the basis of inference

Meaning, the pattern of chance outcomes

influences the predictions made and

conclusions drawn in a scenario.

Handout: #1

From one trial to another, we cannot

predict the probability of an event.

However, when we perform more and

more trials, the probability stabilizes and

changes little.

Handout #2: Haphazard? While random is often a synonym for

haphazard in conversation, in statistics

with more and more repetitions, a

random phenomenon approaches a

long-term regularity.

We usually don’t have the opportunity to

see enough repetitions to see the

probabilities stabilize. Instead, with seeing

the event happen once or twice, we

interpret the occurrence as random,

which makes it seem haphazard.

Handout #3

(from pg 314) The idea of probability is

empirical, which means based on

observation.

Handout: #4 In attempt to estimate the empirical

probability of tossing a coin and counting

the proportion of heads, Count Buffon

(from the 18th century) tossed a coin 4040

times, Karl Pearson tossed a coin 24,000

times around 1900, and John Kerrich

tossed a coin 10,000 times while

imprisoned by the Germans during WWII.

Karl Pearson tossed a coin the most, but

each pioneer of coin-tossing got heads

about half the time (Buffon: 0.5069,

Pearson: 0.5005, Kerrich: 0.5067)

Handout #5: Randomness

The outcome of one trial must not influence

the outcome of an other…the trials must be

independent.

Probability is empirical (observed by many

trials)

Simulations lead us to probability; tools like

number generators can help make long

runs of trials.

Handout #6

Probability is used to describe life span,

measurements, traffic flow, genetic

makeup, spread of epidemics, setting

insurance rates, election

predictions…where does it stop?!

6.2 Probability Models

Note that probability models have two parts:

A list of possible outcomes

A probability for each outcome.

Sample Space

A sample space is the set of all possible

outcomes.

To specify S we must state what

constitutes an individual outcome, then

which outcomes can occur (can be

simple or complex)

Simple ex: coin tossing, S = {H, T}

Complex ex: US Census: If we draw a

random sample of 50,000 US households,

as the survey does, the S = (all 50,000

households}

Sample Space: Rolling two dice At a casino- 36 possible outcomes when

we roll 2 dice and record the up-faces in

order (first die, second die)

Gamblers care only about number of dots

face up so the sample space for that is:

S = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}

Sample Space: A deck of

cards

S = {you would list out all 52}

Techniques for

finding outcomes

Tree diagram: lists outcomes

in an organized way

For tossing a coin

then rolling a die

Starting from a point, each branch

represents the possible outcomes from the

occurrence of the given event.

Be sure to list the set of outcomes from the

series of events here: S = {H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6}

TREE DIAGRAM example

a. Create a tree diagram for flipping 2

coins. List the sample space as S = { }

a. Create a tree diagram for flipping 4

coins. List the sample space as S = { }

used if you want to calculate THE NUMBER

of outcomes…it doesn’t tell you what the

outcomes are

Ex: There are 12 outcomes when flipping a

coin and then rolling a die: 2 possible

outcomes when a coin is flipped, 6 possible

outcomes when rolling a die…so 2 x 6 = 12

Multiplication Principle

EXAMPLE of multiplication

principle

Confirm that there are 16 outcomes when

flipping 4 coins.

Your city has grown and has added a

new phone number. In addition to phone

numbers that start 434-, now your town

has phone numbers that start as 545. How

many phone numbers are added to your

town?

With/without replacement

Whether or not you replace an object

back into the population to sample from

again, affects the number of outcomes in

your sample space.

Ex: If you take a card from a deck of 52,

don’t put it back, then draw your 2nd card

etc., that’s without replacement.

If you take a card, write it down, put it

back, draw 2nd card etc., that’s with

replacement.

EXAMPLE of replacement

Your city has grown and has added a

new phone number. In addition to phone

numbers that start 434-, now your town

has phone numbers that start as 545. How

many phone numbers are added to your

town if you can’t have repeated digits in

the last four?

Event

An event is an outcome or set of

outcomes of a random phenomenon. It is

a subset of the sample space.

Ex: When flipping four coins, “exactly two

heads” is an event. So looking at the earlier

example, what outcomes constitute this

event? We’ll call the event A.

A = {HHTT, HTHT, HTTH, THHT, THTH, TTHH}

Probability Rules

In words and notation 1. Any probability is a number between 0 and 1

P(A) of any event A satisfies 0 ≤ P(A) ≤ 1

2. The sum of the probabilities of all possible outcomes = 1

If S = sample space in a probability model, then P(S) = 1

3. The probability that an event doesn’t occur (called the

complement of event A) is 1 minus the probability that it does

occur

P(A^c) = 1 – P(A)

4. If 2 events have no outcomes in common (called disjoint,

they can’t occur together), the probability that one OR the

other occurs is the sum of their individual probabilities

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

(This is called the addition rule for disjointed events)

Venn diagrams help visualize

the relationship between events

Disjoint events A and B

Complement A^c of an event A

Example of disjoint/complement Select a woman aged 25 – 29 years old at random

and record her marital status. At random means that we give every such woman the same chace to be the one we choose. We choose an SRS of size 1. The probability of any marital status is just the proportion of all women aged 25 to 29 who have that status; if we selected many women, this is the proportion we would get.

Here is the probability model

Find the probability that the woman we draw is not married, using The complement rule

The addition rule

Marital Status Never married Married Widowed Divorced

Probability 0.353 0.574 0.002 0.071

Probabilities in a finite space

Looking at the probability model re:

marital status of women, notice the sum

of the separate events.

The probabilities for the events ended up

being unique numbers, but if two events

have the same probability, they are

labeled as equally likely.

When to add, when to

multiply

The addition rule for disjointed events is

used when finding the probability of one

event occurring. Event A OR B.

If finding the probability that two events

occur, the probabilities of these events

are multiplied.

Independence &

the Multiplication Rule To find the probability for BOTH events A and B

occurring

The multiplication rule applies only to independent

events; can’t use it if events are not independent!

In a Venn diagram, the event {A and B}is represented in the overlap

Independent or not? Examples Coin toss

I: Coin has no memory and coin tossers cannot

influence fall of coin

Drawing from deck of cards

NI: First pick, probability of red is 26/52 or .5.

Once we see the first card is red, the probability

of a red card in the 2nd pick is now 25/51 = .49

Taking an IQ test twice in succession

NI

Multiplication Rule Example 1

A general can plan a campaign to fight

one major battle or three small battles.

He believes that he has probability 0.6 of

winning the large battle and probability

0.8 of winning each of the small battles.

Victories or defeats in the small battles are

independent. The general must win either

the large battle or all three small battles to

win the campaign. Which strategy should

he choose?

Multiplication Rule Example 2

A diagnostic test for the presence of the

AIDS virus has the probability of 0.005 of

producing a false positive. That is, when a

person free of the AIDS virus is tested, the

test has probability 0.005 of falsely

indicating that the virus is present. If all

140 employees of a medial clinic are

tested and all 140 are free of AIDS, what is

the probability that at least one false

positive will occur?

More applications of

Probability Rules

If two events A and B are independent,

then their complements are also

independent.

Ex: 75% of voters in a district are

Republicans. If an interviewer chooses 2

voters at random, the probability that the

first is a Republican and the 2nd is not a

republican is .75 x .25 = .1875

6.3 General Probability Rules

Addition Rule for Disjoint events

General Addition rule for

Unions of 2 events

Example:

Deb and Matt are waiting anxiously to hear if they’ve been promoted. Deb guesses her probability of getting promoted is .7 and Matt’s is .5, and both of them being promoted is .3. The probability that at least one is promoted = .7 + .5 - .3 which is .9. The probability neither is promoted is .1.

The simultaneous occurrence of 2 events (called a joint event, such as deb and matt getting promoted) is called a joint probability.

Conditional Probability The probability that we assign to an event

can change if we know some other event has occurred.

P(A|B): Probability that event A will happen under the condition that event B has occurred.

Ex: Probability of drawing an ace is 4/52 or 1/13. If your are dealt 4 cards and one of them is an ace, probability of getting an ace on the 5th

card dealt is 3/48 or 1/16 (conditional probability- getting an Ace given that one was dealt in the first 4).

In words, this says that for both of 2 events to occur,

first one must occur, and then, given that the first

event has occurred, the second must occur.

Remember: B is the event whose probability

we are computing and A represents the info

we are given.

Extended Multiplication rules

The union of a collection of events is the

event that ANY of them occur

The Intersection of any collection of

events is the event that ALL of them occur

Example Only 5% of male high school basketball, baseball, and football

players go on to play at the college level. Of these only 1.7% enter major league professional sports. About 40% of the athletes who compete in college and then reach the pros have a career of more than 3 years. Define these events: A = competes in college B = competes pro C = pro career longer than 3

years

P(A) = .05

P(B|A) = .017

P(C|A and B) = .400

What is the probability a HS athlete will have a pro career more than 3 years? The probability we want is therefore P(A and B and C) = P(A)P(B|A)P(C|A and B)

= .05 x .017 x .40 = .00034

So, only 3 of every 10,000 high school athletes can expect to compete in college and have a pro career of more than 3 years.

Extended tree diagram + chat

room example 47% of 18 to 29 age chat online, 21% of 30 to 49

and 7% of 50+

Also, need to know that 29% of all internet users are 18-29 (event A1), 47% are 30 to 49 (A2) and the remaining 24% are 50 and over (A3). What is the probability that a randomly chosen

user of the internet participates in chat rooms (event C)?

Tree diagram- probability written on each segment is the conditional probability of an internet user following that segment, given that he or she has reached the node from which it branches.

(final outcome is adding all the chatting probabilities which = .2518)

Bayes Rule Another question we might ask- what percent of

adult chat room participants are age 18 to 29?

P(A1|C) = P(A1 and C) / P(C)

= .1363/.2518 = .5413

*since 29% of internet users are 18-29, knowing that someone chats increases the probability that they are young!

Formula sans tree diagram:

P(C) = P(A1)P(C|A1) + P(A2)P(C|A2) + P(A3)P(C|A3)

6.3 Need to Know summary(print) Complement of an event A contains all outcomes not in A

Union (A U B) of events A and B = all outcomes in A, in B, or in both A and B

Intersection(A^B) contains all outcomes that are in both A and B, but not in A alone or B alone.

General Addition Rule: P(AUB) = P(A) + P(B) – P(A^B)

Multiplication Rule: P(A^B) = P(A)P(B|A)

Conditional Probability P(B|A) of an event B, given that event A has occurred: P(B|A) = P(A^B)/P(A) when P(A) > 0

If A and B are disjoint (mutually exclusive) then P(A^B) = 0 and P(AUB) = P(A) + P(B)

A and B are independent when P(B|A) = P(B)

Venn diagram or tree diagrams useful for organization.