stats chapter 6

77
Chapter 6 Probability and Simulation

Upload: richard-ferreria

Post on 01-Nov-2014

3.351 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Stats chapter 6

Chapter 6

Probability and Simulation

Page 2: Stats chapter 6

6.1 SIMULATION

Page 3: Stats chapter 6

What is Simulation (stats)

• Define a scenario whose probabilistic outcomes are know

• Use a mathematical model to carry out a number of likely outcomes for the scenario

• Compare the distribution of the outcomes with “alternative models”

Page 4: Stats chapter 6

Steps to Simulation

1. State the problem and the random phenomenon(What are we trying to determine?)

2. State assumptions(what are the probabilities involved?)

3. Create a mathematical model(use your calculator or table B)

4. Carry out many repetitions of trial(don’t forget to record outcomes!)

5. State your conclusions

Page 5: Stats chapter 6

Creating a mathematical model

• Using a calculator, most probabilities can be computed with the outcomes 1-100– RandInt(1,100)

• Using the table, probabilities can be computed with digits 00-99– Like with exp design, you should use ID’s with

the same number of digits– You may treat 00 as 100

• You may want to simplify your model into two outcomes– ‘Success’ or ‘Failure’

Page 6: Stats chapter 6

Penultimate Last thoughts

• Make sure you follow through all 5 steps when you perform a simulation

• It may be helpful to list all possible outcomesCoin 1 Coin 2 OutcomeHeads Heads HHHeads Tails HTTails Heads THTails Tails TT

Page 7: Stats chapter 6

Last thoughts

• You will not receive credit for calculator notation– Record your mathematical model

(i.e. #1-32 is a success, #33-99 and 00 are failures)– Record your method of producing random integers

“I will use my calculator”“I will use line 131 from table B”

• Record your observations (when possible)– Create a table with ‘trial #’ ‘observation’ and

‘outcome’trial# observation outcome16 42 failure17 12 success

Page 8: Stats chapter 6

Assignment 6.1

Pg. 397 #1, 3, 5, 9, 13, 19

Page 9: Stats chapter 6

6.2 PROBABILITY MODELS

Page 10: Stats chapter 6

The idea of probability

• Random behavior does not mean “haphazard”

• Random behavior is:– Unpredictable in the short term– Has a regular and predictable pattern in the long

run

• Observation of random behavior to determine probability model is “empirical probability”

• Remember- the regular predictable pattern only appears after many repetitions

Page 11: Stats chapter 6

Probability Models

• A list of all possible outcomes of a random phenomenon is called the “Sample Space” or ‘S’

• An event is a one or more set of outcomes for the random phenomenon, it is a subset of the sample space– It’s helpful to think of events in terms of “success” or

“failure”

• A Probability Model describes the random phenomenon. Consists of two parts:– Sample Space (S)– Probability for each event (P)

Page 12: Stats chapter 6

Probability Model- Coins

S = {H, T}P(H) = 0.5, P(T) = 0.5• Notice that the sum of probabilities

for the sample space is 1.00• This model also assumes that the

coin is ‘fair’

Page 13: Stats chapter 6

Tree Diagrams

• Using a tree is helpful when there is more than one ‘event’ or mechanism for each event

• These outcomes must be independent– The outcome of one event does not

effect the outcome of the next event

Page 14: Stats chapter 6

Tree Diagram

Page 15: Stats chapter 6

Tree Diagram

Event #1‘Heads’ or ‘Tails’

Page 16: Stats chapter 6

Tree Diagram

Event #2#1 - #6Notice that each of the outcomes from Event #1 branches to all outcomes of Event #2

Page 17: Stats chapter 6

Tree Diagram

Sample Space

It does not matter what order the events are placed in the tree!

Page 18: Stats chapter 6

Probability Model

• Provided that the outcomes of each event are equally likely, then the probability of each outcome is the same: 1/n

• Multiplication Principle– If the Sample Space consists two events,

event 1 has n1 outcomes, event 2 has n2 outcomes,then the Sample Space has n1 x n2 outcomes

– I like to call this the menu principle

Page 19: Stats chapter 6

Confusions and Clarification

• The concepts of “events” and “outcomes” easily confused.

• Outcome– The product of some mechanism- dice,

cards, etc.

• Event– An outcome or set of outcomes with

significance

• Many times, the “event of interest” is the result of many outcomes

Page 20: Stats chapter 6

Assignment 6.2A

• Pg 411 #23, 24, 27-29, 33, 35, 36

Page 21: Stats chapter 6

With or Without Replacement

Many events involve some kind of repeated sampling- think of drawing cards from a deck

• Sampling with Replacement– After a sample, the card is put back into the deck– The probability model for the second card is the

same as the probability model for the first card

• Sampling without Replacement– The card is not put back in the deck– The probability model for the second card is not

the same as the probability model for the first card

Page 22: Stats chapter 6

Probability RULZ

Suppose a sample space ‘S’ has events ‘A’ and ‘B’

1. 0 < P(A) < 1-The probability of an event is between 0 and 1-P(A) = 0 means the event never happens-P(A) = 1 means the event always happens

Page 23: Stats chapter 6

Probability RULZ

Suppose a sample space ‘S’ has events ‘A’ and ‘B’

2. P(A) + P(B) + … +P(n) = 1-or-

P(S) = 1-The sum of all possible outcomes is 1. -One of the outcomes in the S must happen!

Page 24: Stats chapter 6

Probability RULZ

Suppose a sample space ‘S’ has events ‘A’ and ‘B’-Two events are ‘disjoint’ or ‘mutually exclusive’ if they have no common outcomes

3. If events A and B are disjoint, then P(A or B) = P(A) + P(B)(more on disjoint events later)

Page 25: Stats chapter 6

Probability RULZ

Suppose a sample space ‘S’ has events ‘A’ and ‘B’

4. P(A) + P(AC) = 1-The probability of an event occurring plus the probability that an event does not occur is ‘1’-“Either an event happens, or it doesn’t”-Also P(A) = 1 - P(AC)

Page 26: Stats chapter 6

Terminology

• “Union,” “OR,” “U”– “A U B”– “Either A or B or both”

• “Intersect,” “AND,” “∩”– “A∩B”– Both A and B occurred simultaneously

• Empty set – Event has no outcomes!– i.e. “A∩B = ” or “A∩B = { }”

Page 27: Stats chapter 6

THE FOUR RELATIONS

• Two events can be related in one of four ways:

1. Complimentary Events2. Disjoint Events3. Implied Events4. Independent Events

Page 28: Stats chapter 6

Terminology

Complimentary Events A and AC - Either A occurs or AC

occurs

B (or AC )

Page 29: Stats chapter 6

Terminology

Disjoint EventsIf A occurs, then B does not occur.If B occurs, then A does not occur.

Page 30: Stats chapter 6

Terminology

Implied Events• All the outcomes for one event are

contained in another event• If B happens, then A also happens

SA

B

Page 31: Stats chapter 6

Terminology

Independent Events• Events share outcomes• It is possible that an outcome

qualifies event A and event B

Page 32: Stats chapter 6

Terminology

Independent Events• Events share outcomes• It is possible that an outcome qualifies

event A and event B• I like this diagram:

A

BA and B

Ac and Bc

P(A) P(AC)

P(B)

P(BC)

Page 33: Stats chapter 6

Equally likely outcomes

• If a random phenomenon has k equally likely outcomes, then the probability of each outcome is 1/k.

• For an event A:

# of outcomes in AA

# of outcomes in S# of outcomes in A

P

k

Page 34: Stats chapter 6

Equally likely outcomes

• What is the probability of drawing a ‘King’ from a standard deck of cards

• Let A = drawing a kingA = {King of Spades, King of Diamonds, King of Clubs, King of Hearts}

# of outcomes in AA

# of outcomes in S4 1

52 13

P

Page 35: Stats chapter 6

Multiplication rule

• Two events are independent if the outcome of the first trial does not affect the outcome of the second trial.

• This is not the same as ‘disjoint’– If two events are disjoint, then by

definition the outcome of the first event affects the outcome of the second event

Page 36: Stats chapter 6

Multiplication Rule

• If A and B are independent events, thenP(A and B) = P(A) x P(B)

• Ex. A = 3 on a die, B = HeadsP(3 and Heads) = P(A and B)

=P(A) x P(B)=(1/6) x (1/2)=1/12

• Always check that the events are independent before using the multiplication rule!

Page 37: Stats chapter 6

Multiplication Rule

• If we think in terms of the Venn Diagram, then the probability for independent events is just the area of the appropriate rectangle

A

BA and B

Ac and Bc

P(A) P(AC)

P(B)

P(BC)

Page 38: Stats chapter 6

Using the diagram

• In fact, this diagram can be used for all four of the relations! (pay attention to the zeros)

• COMPLIMENTS:A

B0

0

P(A) P(AC)

P(B)

P(BC)

Page 39: Stats chapter 6

Using the diagram

• In fact, this diagram can be used for all four of the relations! (pay attention to the zeros)

• Disjoint:A

B0

AC and Bc

P(A) P(AC)

P(B)

P(BC)

Page 40: Stats chapter 6

Using the diagram

• In fact, this diagram can be used for all four of the relations! (pay attention to the zeros)

• Implied:

0

BA and B

AC and Bc

P(A) P(AC)

P(B)

P(BC)

Page 41: Stats chapter 6

Using the diagram

• This is the “Normal” diagram.• Multiply the edges to find the small

box probabilities

A

BA and B

AC and Bc

P(A) P(AC)

P(B)

P(BC)

Page 42: Stats chapter 6

Using the diagram

• This is the “Normal” diagram.• All four boxes add to 1

A and Bc

Ac and BA and B

AC and Bc

P(A) P(AC)

P(B)

P(BC)

Page 43: Stats chapter 6

Assignment 6.2B

• Pg 423 #37, 39, 43, 44

Page 44: Stats chapter 6

6.3 GENERAL PROBABILITY RULES

Page 45: Stats chapter 6

Rules of Probability

1. 0 < P(A) < 12. P(S) = 13. If A and B are disjoint,

P(A or B) = P(A) + P(B)4. P(AC) = 1 – P(A)5. If A and B are independent

P(A and B) = P(A) x P(B)

Page 46: Stats chapter 6

General Addition Rule

• For any two events:P(A or B) = P(A) + P(B) – P(A and B)

Let’s examine this by looking at the four possible event pairs

Page 47: Stats chapter 6

General Addition Rule

P(A or B) = P(A) + P(B) – P(A and B)If the events are disjoint or complimentary, P(A and B) = 0

B (or AC )

Page 48: Stats chapter 6

A

BA and B

Ac and Bc

P(A) P(AC)

P(B)

P(BC)

General Addition Rule

If A and B are overlapping setsP(A or B) = P(A) + P(B) – P(A and B)

Page 49: Stats chapter 6

A

BA and B

Ac and Bc

P(A) P(AC)

P(B)

P(BC)

General Addition Rule

If A and B are overlapping sets P(A or B) = P(A) + P(B) – P(A and B)

Page 50: Stats chapter 6

A

BA and B

Ac and Bc

P(A) P(AC)

P(B)

P(BC)

General Addition Rule

P(A or B) = P(A) + P(B) – P(A and B)If A and B are overlapping sets

Added twice!Need to subtract one of these!

Page 51: Stats chapter 6

General Addition Rule

• Implied eventsP(A or B) = P(A) + P(B) – P(A and B)

SA

B

Page 52: Stats chapter 6

General Addition Rule

• Implied eventsP(A or B) = P(A) + P(B) – P(A and B)

SA

B

Page 53: Stats chapter 6

General Addition Rule

• Implied eventsP(A or B) = P(A) + P(B) – P(A and B)

SA

B

Added Twice! We must subtract it out.

Page 54: Stats chapter 6

Assignment 6.3A

• Page 430 #45-49 odd, 61, 66, 67, 69

Page 55: Stats chapter 6

Conditional Probability

• When two events are not independent, then their probabilities are known as “conditional”

• Notation: P(A | B)reads “the probability of A given B”this is “the probability that event A occurs, if event B has already occurred”

Page 56: Stats chapter 6

Conditional Probability

• P(A and B) = P(A) x P(B|A)• This should make sense:

“the probability that A and B occurs is the probability of A occurs times the probability that B occurs if A has occurred.

• Really, this is just the multiplication principle again!

Page 57: Stats chapter 6

Conditional Probability

• After rearranging the previous equation, we arrive at the definition for conditional probability:

A and B(B | A)

A

PP

P

Page 58: Stats chapter 6

Conditional Probability

• We also surmise a mathematical definition for “independent events”

Two events are said to be independent if both of the following are true

(1) P(B|A) = P(B) and

(2) P(A|B) = P(A).

Page 59: Stats chapter 6

Tree Diagrams and Probability

• When multiple events occur, many times a tree diagram is helpful in computing the probabilities for each outcome of the sample space.

• Outcomes are written on the “nodes”• Probabilities are written on the “branches” • Probabilities for all branches from the same

node must add to ‘1’• Probabilities of each outcome in the sample

space is a product of each branch in the pathway

Page 60: Stats chapter 6

Tree Diagram and Probability

Of all high school male athletes who attend college, 1.7% will become professional athletes. Of the high school male athlete who does not go to college, .01% will go on to become professionals. 5% of all high school male athletes go to college. What percent of high school male athletes become professional athletes?

Page 61: Stats chapter 6

Tree Diagrams and Probability

• Let’s define events: A = “a high school male athlete goes to college”B = “becomes a professional”

• Notice what AC and BC are.

Page 62: Stats chapter 6

Tree Diagrams and Probability

Page 63: Stats chapter 6

Tree Diagrams and Probability

Branches from the samenode add to ‘1’

Page 64: Stats chapter 6

Probability is product of the branches

P(A and B).05 x .017.00085

P(A and BC).04915

P(ACand BC).949905

P(AC and B).000095

Page 65: Stats chapter 6

Tree Diagrams and Probability

• P(B) = P(A and B) + P(AC and B)P(B) = .00085 + .000095P(B) = .000945

summarize:“.09% of all high school male athletes become professionals”

Page 66: Stats chapter 6

Two way tables and probability

• An alternate way to work on these problems is to use a two way table.

• Choose a sufficiently large number for your population

• Use the multiplication property and the complementary sets to complete the table.

Page 67: Stats chapter 6

Two way tables and probability

A new test for disease “rawr” is developed. If a patient has rawr the test will give a positive result (the patient has rawr) 98% of the time. Unfortunately, if a patient does not have rawr, the test will give a positive 1% of the time. Approximately 4% of the population has rawr.

Page 68: Stats chapter 6

Two way tables and probability

1- What percent of the population will get a positive test result?

2- What is the probability that patient has rawr if he gets a positive result?

Page 69: Stats chapter 6

Two way tables and probability

• Lets assume our population is 10000!

Positive

Negative

Total

Rawr

No Rawr

Total 10000

Page 70: Stats chapter 6

Two way tables and probability

• 4% of the population has Rawr.

Positive

Negative

Total

Rawr 400

No Rawr 9600

Total 10000

Page 71: Stats chapter 6

Two way tables and probability

• 98% of the “Rawrs” will test positive

Positive

Negative

Total

Rawr 392 8 400

No Rawr 9600

Total 10000

Page 72: Stats chapter 6

Two way tables and probability

• 1% of the “no Rawrs” will test positive

Positive

Negative

Total

Rawr 392 8 400

No Rawr 96 9504 9600

Total 10000

Page 73: Stats chapter 6

Two way tables and probability

• Do some quick addition

Positive

Negative

Total

Rawr 392 8 400

No Rawr 96 9504 9600

Total 488 9512 10000

Page 74: Stats chapter 6

Two way tables and probability

1- What percent of the population will get a positive test result?488/10000 = .0488

Page 75: Stats chapter 6

Two way tables and probability

2- What is the probability that patient has rawr if he gets a positive result?

• P(rawr | positive result)– Look at the table!– 392/488 = .8033

• Conditional probability becomes conditional distribution problem from chapter 4!

• These results of this example should worry you. Why?

Page 76: Stats chapter 6

Assignment 6.3B

• P441 #70-73, 80-83, 86(a)-(d), 87, 90, 91

Page 77: Stats chapter 6