Download document

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
Chapter 5
Modeling Variation
with Probability
Copyright © 2014 Pearson Education, Inc. All rights reserved
Learning Objectives
Understand that humans can’t reliably create
random numbers or sequences.
 Understand that a probability is a long-term
relative frequency.
 Know the difference between empirical and
theoretical probabilities— and know how to
calculate them.

5- 2
Copyright © 2014 Pearson Education, Inc. All rights reserved
Learning Objectives Continued
Be able to determine whether two events are
independent or associated and understand the
implications of making incorrect assumptions
about independent events.
 Understand that the Law of Large Numbers
allows us to use empirical probabilities to
estimate and test theoretical probabilities.
 Know how to design a simulation to estimate
empirical probabilities.

5- 3
Copyright © 2014 Pearson Education, Inc. All rights reserved
5.1
What Is Randomness?
Copyright © 2014 Pearson Education, Inc. All rights reserved
Randomness
If numbers are chosen at random, then no
predictable pattern occurs and no digit is more
likely to appear more often than another.
 In general, outcomes occur at random if every
outcome is just as likely to appear as any other
outcome and no predictable pattern of outcomes
occurs.

5- 5
Copyright © 2014 Pearson Education, Inc. All rights reserved
Psychology and Randomness
Pick a “random” number between 1 and 20.
 This may seem random, but due to cognitive
bias some numbers, e.g. 7, are more likely
than others. Odd numbers and especially
prime numbers “feel” more random.

5- 6
Copyright © 2014 Pearson Education, Inc. All rights reserved
Using a Random Number Table to
Simulate Rolling a Die 10 Times
1.
2.
3.
5- 7
Pick a line, say 30, on the table to begin.
Select numbers in order disregarding
0,7,8,9.
The “random” numbers are
5,4,5,3,4,6,2,5,3
Copyright © 2014 Pearson Education, Inc. All rights reserved
Troubles With Tables and Computers
The random number table only has a finite
list. If it is used many times, it will not be
random at all.
 Computers involve a random seed, typically
given by the time it is clicked to the nearest
millisecond.

5- 8
Copyright © 2014 Pearson Education, Inc. All rights reserved
Other Physical Techniques
Flip a coin to generate random 0’s and 1’s.
 Pick a card to generate random numbers.
 Roll a die to generate numbers from 1 to 6.
 Pick a number out of a hat.
 Warning: Skilled magicians can manipulate
coins, cards, dice, and hats to select a value
of their choice.

5- 9
Copyright © 2014 Pearson Education, Inc. All rights reserved
Empirical and Theoretical Probabilities
Probability measures the proportion or percent of
the time that a random event occurs.
 Theoretical probabilities are long run relative
frequencies based on theory.

 P(Heads)

= 0.5
Empirical probabilities are short run relative
frequencies base on an experiment.
A
coin was tossed 50 times and landed on heads 22
times. The empirical probability is 22/50 = 0.44.
5 - 10
Copyright © 2014 Pearson Education, Inc. All rights reserved
Using Theoretical and Empirical
Probabilities

Use Theoretical Probabilities when we can
mathematically determine them.
 Dice,

Cards, Coins, Genetics, etc.
Use Empirical Probabilities when they cannot
be mathematically determined. This is done
by sampling.
 Weather,
5 - 11
Politics, Business Success, etc.
Copyright © 2014 Pearson Education, Inc. All rights reserved
5.2
Finding Theoretical
Probabilities
Copyright © 2014 Pearson Education, Inc. All rights reserved
Probability Properties

0 ≤ P(A) ≤ 1
 There
can’t be a negative chance or more than a
100% chance of something occurring.

P(Ac) = 1 – P(A)
Ac the complement of A means that A does not
occur.
 If there is a 25% chance of winning, then there is
a 75% chance of not winning.

5 - 13
Copyright © 2014 Pearson Education, Inc. All rights reserved
Probability for Equally Likely Events

If all events are equally likely, then
Number of Outcomes in A
P( A) 
Number of All Possible Outcomes

Example: Find the probability of picking an
Ace from a 52 card deck.

5 - 14
4 Aces
1
P(Ace) 

52 Cards 13
Copyright © 2014 Pearson Education, Inc. All rights reserved
Sum of Dice

Roll 2 dice. Find P(Sum = 6).
Sum of 6: 5
 Possible Rolls: 36

1
2
5 - 15
Copyright © 2014 Pearson Education, Inc. All rights reserved
4
1
2
X
X
4
5
6
5
X
3
5
 P(Sum = 6) =
36
3
X
X
6
AND
The word “And” in Probability means both
must occur.
 Example: If you roll a die, find the
probability that it is even and less than 5.
 Solution: The die rolls that are both even
and less than 5 are: 2, 4.

2 1
P(Even AND <5)  
6 3
5 - 16
Copyright © 2014 Pearson Education, Inc. All rights reserved
OR
The word “OR” in probability means at least
one of the events must occur.
 Example: Find the probability of picking a
Spade Or a King from a 52 card deck.
 Solution: There are 13 spades in the deck.
There are 3 kings that are not spades. Thus,
there are 16 cards that are a spade or a king.

16 4
P(Spade OR King) 

52 13
5 - 17
Copyright © 2014 Pearson Education, Inc. All rights reserved
Mutually Exclusive Events
Two events are called Mutually Exclusive if
they cannot both occur.
 If A and B are Mutually Exclusive then
P(A AND B) = 0
 Example: A person is selected at random.
Let A be the event that the person is a
registered Democrat and let B be the event
that the person is a registered Republican.
Then A and B are mutually exclusive events.

5 - 18
Copyright © 2014 Pearson Education, Inc. All rights reserved
Some Probability Rules
1.
2.
3.
P(Ac) = 1 – P(A)
P(A OR B) = P(A) + P(B) – P(A AND B)
Mutually Exclusive:
a.
b.
5 - 19
P(A OR B) = P(A) + P(B)
P(A AND B) = 0
Copyright © 2014 Pearson Education, Inc. All rights reserved
Venn Diagrams
A Venn Diagram is a chart that organizes
outcomes.
 P(Hat AND Glasses) = 2/6
 P(Not Hat) = 1 – P(Hat) = 1 – 3/6 = 1/2

5 - 20
Copyright © 2014 Pearson Education, Inc. All rights reserved
Tables and Probability
Transportation to Class
Car
Bike
Walk
Bus
Total
Male
75
14
12
23
124
Female
90
7
25
32
154
Total
165
21
37
55
278
Find the probability that a randomly
selected student will:

Take a bus.


55/278
Be male and take a bike

5 - 21

14/278
Copyright © 2014 Pearson Education, Inc. All rights reserved
Be female or walk to class.

154/278 + 37/278 – 25/278
= 166/278
5.3
Associations in
Categorical Variables
Copyright © 2014 Pearson Education, Inc. All rights reserved
Conditional Probability
Conditional Probability is the probability of
an event occurring given some additional
knowledge.
 Find the probability that a person will vote
for a tax cut given that the person is
Republican.
 Find the probability that student who is a
psychology major is also a vegetarian.

5 - 23
Copyright © 2014 Pearson Education, Inc. All rights reserved
Tables and Conditional Probability

Car
Bike
Walk
Bus
Total
Male
75
14
12
23
124
Female
90
7
25
32
154
Total
165
21
37
55
278
P(Bus|Female) = Probability of riding the bus
given that the person is female.
 32/154

5 - 24
P(Bus AND Female) = 32/278
Copyright © 2014 Pearson Education, Inc. All rights reserved
Determining a Probability Statement


Let A be the event that a person is left handed and B
be the event that the person is over 30 year old. Write
symbolically: The probability that:
a left handed person will be over 30.


a person is a lefty and who is over 30.


P(A AND B)
a person over 30 years old is a righty.

5 - 25
P(B|A)
P(AC|B)
Copyright © 2014 Pearson Education, Inc. All rights reserved
The Formula for a Conditional
Probability
P( A AND B)
P( A | B) 
P( B)
Use this formula when explicitly given the
probabilities or percents.
 You do not need to use this formula when
given a contingency table.

5 - 26
Copyright © 2014 Pearson Education, Inc. All rights reserved
Variations of the Formula
P( A AND B)
P( A | B) 
P( B)
P( A AND B)
P( B | A) 
P( A)
P( A AND B)  P( A | B) P( B)
P( A | B)  P( B | A)
5 - 27
Copyright © 2014 Pearson Education, Inc. All rights reserved
Conditional Probabilities





5 - 28
By 2020, 2% of Americans will be Senior Citizens
living in poverty. 17% of all Americans will be
Senior Citizens in 2020. What percent of all Senior
Citizens will be living in poverty?
A → Senior Citizen, B → Living in Poverty
P(A AND B) = 0.02, P(A) = 0.17
P(B|A) = 0.02/0.17 ≈ 0.12
In 2020, about 12% of all Senior Citizens will be
living in poverty.
Copyright © 2014 Pearson Education, Inc. All rights reserved
Independent Events

Events A and B are called independent if

P(A|B) = P(A)
or equivalently
P(A AND B) = P(A)P(B)

5 - 29
Intuitively, events are independent if
knowledge of B does not change the
probability of A occurring.
Copyright © 2014 Pearson Education, Inc. All rights reserved
Determining Independence

Two 6-Sided dice are rolled. Let A be the
event that the dice sum to 7 and B be the
event that the first die lands on a 4. Are A
and B independent?
 (1,6),
(2,5), (3,4), (4,3), (5,2), (6,1)
 P(A) = 6/36
 P(A|B) = 1/6
 P(A|B) = P(A)

5 - 30
Yes, the events are independent.
Copyright © 2014 Pearson Education, Inc. All rights reserved
5.4
The Law of Large
Numbers
Copyright © 2014 Pearson Education, Inc. All rights reserved
Empirical Probability Example
The table to the right shows the
result of tossing a coin 10 times.
 Empirical Probabilities of heads:

 After
first toss:
P(H) = 1/1 = 1.00
 After second toss: P(H) = 2/2 = 1.00
 After third toss: P(H) = 3/3 = 1.00
 After fourth toss: P(H) = 3/4 = 0.75
 After tenth toss: P(H) = ?

5 - 32
Empirical probability is not the
same as theoretical probability.
Copyright © 2014 Pearson Education, Inc. All rights reserved
The Law of Large Numbers

5 - 33
The Law of Large Numbers states that if an
experiment with a random outcome is
repeated a large number of times, the
empirical probability of an event is likely to
be close to the true probability. The larger the
number of repetitions, the closer together
these probabilities are likely to be.
Copyright © 2014 Pearson Education, Inc. All rights reserved
The Law of Large Numbers Examples
If you flip a fair coin one million times, it is
likely to land on heads close to half the time.
 If you randomly survey 50,000 Americans
asking them if they know what the capitol of
Alabama is, the proportion from the survey
who do know will be very close to the
proportion of all Americans who know.

5 - 34
Copyright © 2014 Pearson Education, Inc. All rights reserved
Warnings About the Law of Large
Numbers
If the theoretical probability if far from 0.5,
use a very large number of trials for the
Empirical Probability to be close.
 If you flip a fair coin five times and it lands
on heads all five times, this does not mean
that it will land on tails the next five times to
compensate.

5 - 35
Copyright © 2014 Pearson Education, Inc. All rights reserved
Law of Large Numbers Does Not Say
That Streaks Cannot Occur
If the first five tosses of a coin all land heads,
this does not violate the Law of Large
Numbers.
 If you just watched a fair die rolled 20 times
without seeing a 2, this does not mean that a
2 is due on the next toss.

5 - 36
Copyright © 2014 Pearson Education, Inc. All rights reserved