Chapter 6: Probability and Simulation, the study of randomness.

Post on 29-Mar-2015

236 views 3 download

Tags:

transcript

Chapter 6: Probability and Simulation, the study of randomness

6.1 – Simulation

Simulation:

The imitation of chance behavior, based on a model that accurately reflects the experiment under consideration.

Independent:

One event doesn’t influence the outcome of another event. (tossing a coin)

5 steps of simulation:

1. State the problem or describe the random phenomenon

2. State the assumptions.

3. Assign digits to represent outcomes.

4. Simulate many repetitions

5. State your conclusions

Example #1Describe how you would simulate the following problems.

a. Boy or girl? There is an equally likely chance of delivering a boy or a girl at birth. What is the likelihood of having a girl among their first four children?

Flip a coin

Roll Die: 1-3 girl, 4-6 boy

Use # table, 0-4 girl and 5-9 boy

Example #1Describe how you would simulate the following problems.

b. Choose one person at random from a group of which 50% are employed, 20% are unemployed, and 30% are not in the labor force.

Use # table,

0-4 employed, 5-6 unemployed, 7-9 not in labor force

Calculator Tip: Random Integers

Math – Prob – RandInt (smallest #, largest #, n)

Example #2What is the likelihood of tossing a coin 5 times and getting at least 3 consecutive heads or 3 consecutive tails?

Simulation Steps:

1. State the problem or describe the random phenomenon

Find the likelihood of tossing a coin 5 times and getting 3 consecutive heads or tails

2. State the assumptions

Probability of a heads or tails is 50%

Coin tosses are independent

Example #2What is the likelihood of tossing a coin 5 times and getting at least 3 consecutive heads or 3 consecutive tails?

Simulation Steps:

3. Assign digits to represent outcomes

0-4 heads, 5-9 tails

4. Simulate many repetitions

Random digit table: Line 101

1 9 2 2 3First time:

9 5 0 3 4Second:

0 5 7 5 6Third:

2 8 7 1 3Fourth:

H T H H H

T T H H H

H T T T T

9 6 4 0 9Fifth:

1 2 5 3 1Sixth:

H T T H H

T T H H T

H H T H H

4 2 5 4 4Seventh:

8 2 8 5 3Eighth:

H H T H H

T H T T H

Example #2What is the likelihood of tossing a coin 5 times and getting at least 3 consecutive heads or 3 consecutive tails?

Simulation Steps:

5. State your conclusions

P(3 consecutive heads or tails) = 38

After 8 simulations, the probability of flipping a coin 5 times and getting at least 3 consecutive heads or tails is approximately 37.5%

Example #4A basketball player makes 70% of her free throws in a long season. In a tournament game she shoots 5 free throws late in the game and misses 3 of them. The fans think she was nervous, but the misses may simply be chance. You will shed some light by estimating the probability.

a. Describe how to simulate a single shot if the probability of making each shot is 70%. Then describe how to simulate 5 independent shots.

Assign numbers to represent baskets and misses.

0-6 basket, 7-9 miss

Use Random Number table to choose 5 numbers

Example #4A basketball player makes 70% of her free throws in a long season. In a tournament game she shoots 5 free throws late in the game and misses 3 of them. The fans think she was nervous, but the misses may simply be chance. You will shed some light by estimating the probability.

b. Use the calculator to simulate 20 repetitions of the 5 shots and record the number missed on each repetition. What is the approximate likelihood that the player will miss 3 or more of the 5 shots?

randInt(0, 9, 5)

14

6

# of times she didn’t miss 3 out of 5:

# of times she did miss 3 out of 5:

P(missing 3 out of 5 shots) = 620 = 30%

6.2 – Probability Models

Probability:

Chance behavior is unpredictable in the short run but has a regular and predictable pattern in the long run. Probability of an event equals the proportion of times it occurs in a long series of repetitions.

P(Event) = # of successesTotal #

Random:

An event is random if individual outcomes are uncertain, but there is a regular distribution of outcomes in a large number of repetitions.

Probability Model:

Mathematical description of a random phenomenon that has two parts:

• Sample Space

• Way of assigning probabilities to events

Sample Space:

Set of all possible outcomes

S = { … }

Event:

Any outcome or set of outcomes. Subset of the sample space

E = { … }

Example #4Fill in the answers below for each situation

1. Tossing a single die:

a. List the sample space.

S = {1, 2, 3, 4, 5, 6}

b. Event A: an odd number

E = {1, 3, 5}

Example #4Fill in the answers below for each situation

1. Tossing a single die:

c. P(A) = probability of A occurring:

P(A) = 36 = 50%

Example #4Fill in the answers below for each situation

2. In a standard deck of playing cards there are 52 cards total.

a. Drawing one card, P(Heart)

P(Heart) = 1352 = 25%

Example #4Fill in the answers below for each situation

2. In a standard deck of playing cards there are 52 cards total.

b. Drawing one card, P(King)

P(King) = 4 .

52 = 8%

Example #4Fill in the answers below for each situation

2. In a standard deck of playing cards there are 52 cards total.

c. If I continue to draw cards from the deck, will the trials be independent? Why or why not?

No, the first card influences the probability of the next card

There are two ways to find the total number of outcomes in a sample space:

1. Tree Diagram: Branches off to represent each possibility

2. Multiplication Principle:

If you can do one task in a number of ways and a second task in b number of ways, then both tasks can be done in a x b number of ways.

Example #5Draw a tree diagram for flipping a coin and then rolling die. Then determine the size of the sample space.

H

T

1

23456

1

23456

# of outcomes:

12

Or Mult. Principle:

a x b

2 x 612

6.2 - continued

Probability Rules:

• The probability P(A) of any event A satisfies 0 ≤ P(A) ≤ 1

• The sum of the probabilities of all possible outcomes is 1.

• P(A) = 1 means the event will always occur

• P(A) = 0 means the event will never occur

• An event is empty if it has no outcomes in it.

Venn Diagram:

A picture representation of a sample space.

S

A B

Example #1Make a Venn diagram for the following situation:45% of kids like Barney25% of kids like Blue55% of kids like Pooh15% of kids like Blue and Pooh25% of kids like Barney and Pooh5% of kids like Blue but not Barney or Pooh5% of kids like Barney, Blue, and Pooh

Things kids like

Barney Pooh

Blue

.05

.05

.20

.10

.20

.05

.15

.25

The probability that event A does NOT occur

Written: Ac

P(Ac) = 1 – P(A)

Complement Rule:

S

A

Union:

A B

Either event A or event B occurs A B

S

Intersection:

A B

Event A and Event B occurs A B

S

Disjoint: (mutually exclusive)

Two events A and B are disjoint if they have no outcomes in common, so never can occur simultaneously.

A B

S

Addition Rule (for disjoint events only!!!!!):

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

A B

S

Note: P(A and B) = 0

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

a. P(A) = Probability of drawing a spade

P(A) = 1352

= 25%

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

b. P(B) = Probability of drawing a King

P(B) = 4 .

52= 8%

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

c. P(C) = Probability of drawing an Ace

P(C) = 4 .

52= 8%

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

d. P(Bc) =

P(Bc) = 4 .

52= 92%1 –

Probability of not drawing an King

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

e. P(B C) =

P(B C) = 8 .

52= 15%

Probability of Ace or King

P(B) + P(C) = 4 .

52+

4 .

52=

Example #2You have drawn one card from a standard deck of cards. Find the following probabilities:

f. P(B C) =

P(B C) =

Probability of Ace and King

0

What is the difference between disjoint and independent?

Independence is when one event doesn’t influence the probability of the next event.

Disjoint means the two events have no outcomes in common, so never can occur simultaneously.

Example #3Determine if the given example is independent, disjoint, or neither.

a. Drawing one card and getting a black King.

Black King

Deck of cards

independent

Example #3Determine if the given example is independent, disjoint, or neither.

b. Drawing two cards and getting a black King, without replacement.

Black King

Deck of cards

neither

c. Can you have a disjoint event be independent? Explain.

A B

Knowing event A happens means event B cannot

Multiplication Rule (for independent events only!!!!!):

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

Example #4The following table gives the gender and political party of the 100 delegates at a political convention. Suppose you encounter a delegate at random. The proportion of each person is given.

Women Men

Republicans 0.21 0.28

Democrats 0.25 0.16

Independents 0.06 0.04

a. Find the marginal percents.

0.52 0.48

0.490.41

0.10

1.0

b. Is it a valid probability distribution? How do you know?

Example #4The following table gives the gender and political party of the 100 delegates at a political convention. Suppose you encounter a delegate at random. The proportion of each person is given.

Women Men

Republicans 0.21 0.28

Democrats 0.25 0.16

Independents 0.06 0.04

0.52 0.48

0.490.41

0.10

1.0

Yes, the probabilities add to one

c. What is the probability that the delegate will not be a man?

Example #4The following table gives the gender and political party of the 100 delegates at a political convention. Suppose you encounter a delegate at random. The proportion of each person is given.

Women Men

Republicans 0.21 0.28

Democrats 0.25 0.16

Independents 0.06 0.04

0.52 0.48

0.490.41

0.10

1.0

P(not man) = 1 – P(man) = 1 – 0.48 = 0.52

d. What is the probability that the delegate will not be an Independent?

Example #4The following table gives the gender and political party of the 100 delegates at a political convention. Suppose you encounter a delegate at random. The proportion of each person is given.

Women Men

Republicans 0.21 0.28

Democrats 0.25 0.16

Independents 0.06 0.04

0.52 0.48

0.490.41

0.10

1.0

P(not ind.) = 1 – P(ind.) = 1 – 0.10 = 0.90

e. What is the probability that the delegate will be a Republican woman?

Example #4The following table gives the gender and political party of the 100 delegates at a political convention. Suppose you encounter a delegate at random. The proportion of each person is given.

Women Men

Republicans 0.21 0.28

Democrats 0.25 0.16

Independents 0.06 0.04

0.52 0.48

0.490.41

0.10

1.0

P(Rep. and Woman) = 0.21

Note: not independent!

Example #5

A gambler wants to know the probability of rolling one die twice and getting a 3 both times.

P(3 3) =

Note: Independent

1 .

36= 3%

16

=16

P(3) P(3) =

Example #6A string of Christmas lights contains 20 lights. The lights are wired in a series, so that if any light fails the whole string will go dark. Each light has probability 0.02 of failing during a 3 year period. The lights fail independently of each other. What is the probability the strings of lights will remain bright for 3 years?

Note: Independent

P(all 20 lights not fail for 3yrs) = (1 – .02)20 = (.98)20

0.6676

6.3 – General Probability Rules

Problem: Addition Rule only works for disjoint events

Solution:

A B

S

Subtract P(A and B) from both probabilities

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

P(A B) = P(A) + P(B) – P(A B)

Conditional Probability:

The probability of an event occurring, given another event occurred

P(AB) = P(A) happens given that B occurs

P(BA) = P(B) happens given that A occurs

A B

S

P(AB) = P(A and B) P(B)

P(BA) = P(A and B) P(A)

A B

S

P(AB) = P(A and B) P(B)

P(A and B) = P(B) P(AB)

General Multiplication Rule:

If Independent: P(A and B) = P(A) P(B)

In General:

Determining Independence:

Two events A and B are independent if

P(AB) = P(A)

P(BA) = P(B)OR:

Example #1The Adams Corporation stores spare parts at two warehouses, one in Baltimore and one in Plattsburgh. The number of defective and acceptable spare parts at each warehouse is given below:

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

If one of the 500 spare parts kept by the firm is chosen at random let D and A denote the events that the spare part is defective or acceptable, while B and P denote the events that it comes from Baltimore or Plattsburgh. Calculate the following probabilities:

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

a. P(B) = 300500

= 0.60

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

b. P(A B) = 272500

= 0.544

Using Rule: P(A and B) = P(B) P(AB)

P(A and B) = 300500

272300

= 0.544

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

c. P(Bc) = 1 – P(B) = 1 – 300500

= 0.40

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

d. P(A B) =

300500

0.924 + .6 – .544

P(A) + P(B) – P(A and B)

+462500

272500

=

=

= 0.98

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

e. P(AB) = 272300

= 0.9067

P(A and B) P(B)

Using Rule:

P(AB) = =

272500

300500

=272500

500300

=272300

= 0.9067

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

f. P(PD) = 1038

= 0.2632

P(P and D) P(D)

Using Rule:

P(PD) = =

10 .

500

38 .

500

= 10 .

500500 38

1038

= 0.2632=

Number of Spare Parts

Warehouse Defective Acceptable Total

Baltimore 28 272

Plattsburgh 10 190

Total 38 462 500

200

300

g. Determine if coming from Plattsburgh and being defective are independent.

P(PD) = P(P)

0.2632 = 10 .

200

0.2632 0.05

No, they are not

Tree Diagram:

Some conditional probabilities can be solved by drawing a schematic way of looking at all possible outcomes.

Example #2Suppose a computer company has manufacturing plants in three states. 50% of their computers are manufactured in California and 85% of these are desktops, 30% of computers are manufactured in Washington, and 40% of these are laptops, and 20% of computers are manufactured in Oregon, and 40% of these are desktops. All computers are first shipped to a distribution site in Nebraska before being sent out to stores. If you picked a computer at random from the Nebraska distribution center, what is the probability that it is a laptop?

CA

OR

State WA

laptop

desktop

laptop

desktop

laptop

desktop

0.50

0.30

0.20

0.15

0.85

0.40

0.60

0.60

0.40

(.5.15) = 0.075

(.5.85) = 0.425

(.3.4) = 0.12

(.3.6) = 0.18

(.2.6) = 0.12

(.2.4) = 0.08

P(laptop) = 0.075 + 0.12 + 0.12 = 0.315