S02 Probability

Download Report

Transcript S02 Probability

William Christensen, Ph.D.
Definitions
• Probability is the chance that some event or
outcome will happen
P - denotes a probability
A, B, ... - denote specific events or outcomes
P (A) - denotes the probability of event A
occurring
Definitions
• Probability is the chance that some event or
outcome will happen
• If there is NO CHANCE that an event will
occur, then we can say the Probability of
that event occurring is 0 (or 0%).
• If an event is CERTAIN to occur, then we can
say the Probability of that event occurring is
1 (or 100%).
Definitions
• So, we now know that the Probability of any
event occurring must be between 0 and 1 (or
0% and 100%)
• We can say this mathematically as follows
(where A represents any event):
0  P(A)  1
Impossible
to occur
Certain
to occur
Possible Probability Values (0 – 1)
1
Certain
Likely
0.5
50-50 Chance
Unlikely
0
Impossible
How to Calculate Probability
1. Relative Frequency Approximation
2. Classical Approach
3. Subjective Probabilities
How to Calculate Probability
1. Relative Frequency Approximation
•
•
This method requires that we observe or do an experiment and
actually count the number of times event A occurs
Example: using Relative Frequency Approximation to test the
probability of tossing a coin and getting ‘heads’, we would
actually toss a coin a number of times and then calculate what
percent of the time we got ‘heads’. Thus the formula here is:
P(A) =
•
number of times A occurred
number of times trial was repeated
So, for instance if we tossed a coin 100 times and got heads 52
times, then we would calculate the P(heads) = 52/100 = 0.52 or
52%.
How to Calculate Probability
2. Classical Approach
•
•
This is the method we will focus on in class
It works like this. If a procedure has n number of different
simple events (e.g., if you toss a coin there are only two things
that can happen, heads or tails, so in this case n=2), and each
has an equal chance of occurring (e.g., you must have an equal
chance of getting heads or getting tails), and there are s
number of different ways that A can occur (e.g., if A represents
getting heads then there is only one way of getting heads, so
s=1), then:
s
P(A) = n =
number of ways A can occur
number of different
simple events
How to Calculate Probability
2. Classical Approach
•
•
•
•
•
Using the Classical Approach we can therefore calculate the
Probability of tossing a coin and getting head: P(heads) as,
s (number of ways heads can occur) =1
n (number of possible outcomes is either heads or tails) n=2
s / n = 1 / 2 = 0.50 or 50%
So P(heads) = 0.50 or 50%
You must be able to use this method to calculate
Probabilities, so practice, practice, practice
s
P(A) = n =
number of ways A can occur
number of different
simple events
How to Calculate Probability
3. Subjective Probabilities
•
•
•
•
•
This is the guessing method
Using this method we simply guess or make an estimate of the
Probability of some event (A)
Therefore, P(A) is whatever you estimate it to be
For example, I might ask you, “What do you think the chances
are that it will rain tomorrow?” and you might guess something
like 0.05 (5%). Thus P(rain) = 0.05 or 5%.
We probably all use this method a lot in real life, but it
obviously is not very scientific or accurate
How to Calculate Probability
Summary
1.
Relative Frequency Approximation
•
•
Provides an approximation based on observation or experiment
The “Law of Large Numbers” states that the larger the number
of observations, the nearer our Probability using this method
will approach the true probability calculated using the Classical
Approach
•
2.
Example: The more times we toss a coin the closer our Relative Frequency
Approximation will come to P(heads)=0.50 found in the Classical Approach
Classical Approach
•
3.
Provides an actual probability and is the method of choice for
class
Subjective Probabilities
•
Simply a guess or estimate
Example:
Find the probability that a randomly
selected person will be struck by lightning this
year.
The sample space consists of two simple events: the person
is struck by lightning or is not. Because these simple
events are not equally likely, we cannot use the Classical
Approach and must use Relative Frequency Approximation
or Subjective Probability. Using Relative Frequency
Approximation we can research past events to determine
that in a recent year 377 people were struck by lightning in
the US, which has a population of about 274,037,295.
Therefore,
P(struck by lightning in a year) 
377 / 274,037,295  1/727,000
or roughly 1 in a million
Example: On an ACT or SAT test, a typical multiplechoice question has 5 possible answers. If you make a
random guess a question, what is the probability that your
response is wrong?
There are 5 possible outcomes or answers,
and there are 4 ways to answer incorrectly.
Random guessing implies that the
outcomes in the sample space are equally
likely, so we apply the Classical Approach
to get:
P(wrong answer) = 4/5 = 0.80 or 80%
Rounding Rule for
Probabilities
• Give the exact fraction or
• Round off the final result to 3
significant digits
– Example: round 0.3456789 to
–
0.346
Example: round 0.000000158702
to 0.000000159
Complementary
Events
Complementary Events
The complement of event A, denoted
by A, consists of all outcomes in
which event A does not occur.
P(A)
(read “not A”)
Example:
Testing Corvettes
The General Motors Corporation wants to conduct a test of a new
model of Corvette. A pool of 50 drivers has been recruited, 20 or
whom are men. When the first person is selected from this pool, what
is the probability of not getting a male driver?
Because 20 of the 50 subjects are men,
it follows that 30 of the 50 subjects are
women so,
P(not selecting a man) = P(man)
= P(woman)
= 30 = 0.6
50
Complementary Events
• Another approach to finding P(A)
(probability of not A) is to recognize that the
P(A) (the probability of some event occurring) OR
P(A) (the probability of some event not occurring)
must total up to 1 (100% or certainty)
• In other words: P(A) + P(A) = 1
• This is a critical concept you must
understand and remember
Complementary Events
• And, since P(A) + P(A) = 1
• Then simple algebra tells us that:
P(A) = 1 - P(A)
• and
P(A) = 1 - P(A)
Applying this rule to our previous Example:
Testing Corvettes
The General Motors Corporation wants to conduct a test of a new
model of Corvette. A pool of 50 drivers has been recruited, 20 or
whom are men. When the first person is selected from this pool, what
is the probability of not getting a male driver?
P(not selecting a man) = P(man) = 1 – P(man)
= 1 – (20/50)
= 1 – 0.40 = 0.600
• Notice how we got the same answer, but in a
different way. You must be able to do this type
of problem.
Probability
Addition Rule
The “OR” Rule
Addition Rule
• To find the probability that event A or event
B occurs, we use the addition rule:
P(A or B) = P(A) + P(B)
where A and B are mutually exclusive or cannot occur at the same time
• If A and B are not mutually exclusive (they
can happen simultaneously) then:
P(A or B) = P(A) + P(B) – P(A and B)
where P(A and B) denotes the probability that A and B both occur at the same time
Addition Rule
P(A or B) = P(A) + P(B) - P(A and B)
P(A or B) = P(A) + P(B)
we subtract P(A and B) to avoid double that
area where both A and B occur
Total Area = 1
P(A)
P(B)
Overlapping Events
A and B NOT mutually exclusive
Total Area = 1
P(A)
P(B)
Non-overlapping Events
A and B are mutually exclusive
Addition Rule
Using a Contingency Table
• The best way to approach a problem involving P(A or B) is to
•
put the information into what’s called a Contingency Table
(shown below).
Here is an example showing the passengers on the Titanic
and whether they died or survived. We’ll use this information
to work some examples.
Men
Survived
Died
Total
332
1360
1692
Women
Boys
Girls
Totals
318
104
422
29
35
64
27
18
56
706
1517
2223
Titanic Example I
•
•
•
•
•
•
Let’s say we want to find the probability of randomly selecting a Man or Boy. In other
words, find P(Man or Boy)
First, we need to know whether Man and Boy are mutually exclusive. Just think, is it
possible to be both a Man and Boy at the same time – obviously not. We can also see
this as we circle “Men” and “Boys” we see they do not intersect.
Thus, P(Man or Boy) = P(Man) + P(Boy)
Since there are 1692 men out of 2223 passengers, the P(Man) = 1692/2223 = 0.761
There are 64 boys out of the 2223 passengers, so P(Boy) (the probability of randomly
selecting a Boy) = 64/2223 = 0.029
Finally, P(Man or Boy) = P(Man) + P(Boy) = 0.761 + 0.029 = 0.790
Survived
Died
Total
Men
332
1360
1692
Women
318
104
422
Boys
29
35
64
Girls
27
18
56
Totals
706
1517
2223
Titanic Example II
• Next, let’s see if we can find the probability of randomly selecting a Man or someone who Survived.
•
•
•
•
•
•
In other words, find P(Man or Survived)
First, we need to know whether Man and Survived are mutually exclusive. Just think, is it possible to
be both a Man and a Survivor at the same time – obviously YES. We can also see this as we circle
“Men” and “Survived” we see they intersect or overlap.
Thus, P(Man or Survived) = P(Man) + P(Survived) – P(Man and Survived)
Since there are 1692 men out of 2223 passengers, the P(Man) = 1692/2223 = 0.761
There are 706 Survivors out of the 2223 passengers, so P(Survived) = 706/2223 = 0.318
There are 332 people who are both Men and Survived, so P(Man and Survived) = 332/2223 = 0.149
Finally, P(Man or Survived) = P(Man) + P(Survived) - P(Man and Survived) = 0.761 + 0.318 – 0.149 =
0.930
Survived
Died
Total
Men
332
1360
1692
Women
318
104
422
Boys
29
35
64
Girls
27
18
56
Totals
706
1517
2223
Probability
Multiplication Rule
The “AND” Rule
Multiplication Rule
• To find the probability that event A and event B occurs, we
•
•
use the multiplication rule
How we approach this depends on whether or not event A
and B are connected or depended on each other
IF event A and B are independent events (A does not
effect B in any way), then:
P(A and B) = P(A) x P(B)
where A and B are independent events
• IF event A and B are somehow dependent on each other,
then:
P(A and B) = P(A) x P(B/A)
where A and B are dependent
P(B/A) represents the probability of event B occurring
after it is assumed that event A has already occurred (read
B/A as “B given A”)
Example: Multiplication Rule and
Independent Events (coin toss)
•
•
•
Let’s go back to our example of tossing a coin. We
already determined that P(heads)=0.50
Now let’s use the multiplication rule to find the probability
of tossing a coin 3 times and getting heads every time.
We state this as P(Head and Head and Head)
First, we have to determine whether these are
independent or dependent events. Think about it, is there
any influence or effect between coin tosses. I don’t think
so. Just because you throw heads one time has
absolutely no effect on what happens the next time you
toss the coin. Every time you toss the coin it is
“independent” of every other time you toss the coin
Example: Multiplication Rule and
Independent Events (coin toss)
•
•
Thus, P(Head and Head and Head) = 0.50 x 0.50 x 0.50 =
0.125 or 12.5%. This is the probability of tossing a coin
three times and getting heads all three times
You must know how to do these kinds of problems
Example: Multiplication Rule and
Independent Events (babies)
•
•
•
Let’s try another problem. Let’s find the probability of a
couple having 5 children and all five of them being girls.
Find P(Girl and Girl and Girl and Girl and Girl)
We can safely say that having a boy or girl one time has
no effect on the gender of the next child, so we have
independent events. Let’s also assume that a couple has
an equal chance of having a boy or a girl, so the P(Girl) =
½ = 0.500.
Thus, P(Girl and Girl and Girl and Girl and Girl ) = 0.50 x
0.50 x 0.50 x 0.50 x 0.50 = 0.0312 or 3.12%. Given our
assumptions, this is the probability of having all girls
among 5 children
Multiplication Rule
• We’ve now worked a couple of examples in which we had
independent events (coin toss and babies), using the
formula:
P(A and B) = P(A) x P(B)
where A and B are independent events
• Now let’s explore what happens when we have
dependent events, using the formula:
P(A and B) = P(A) x P(B/A)
where A and B are dependent
Note that we can also write this formula as:
P(B/A) = P(A and B) / P(A)
Multiplication Rule – Dependent Events
• Let’s go back to our Titanic example and see if we can find the P(Man and Survived) using the
•
•
•
multiplication rule.
First, is survival somehow effected or dependent on whether or not you are a man. Yes, I think so,
since it was supposed to be “women and children first” in the lifeboats. So we have dependent
events and must use the formula P(A and B) = P(A) x P(B/A), or in this case P(Man and Survived) =
P(Man) x P(Survived / Man)
With 1692 of the 2223 passengers being Men, P(Man) = 1692 / 2223 = 0.761
With 332 survivors among 1692 men, the probability you survived GIVEN you are a man P(Survived /
Man) = 332 / 1692 = 0.196
–
This is probably the step that students mess up on the most. Make sure you practice and understand this
concept of P(B/A) and how to read it off a contingency table
• Thus, P(Man and Survived) = P(Man) x P(Survived / Man) = 0.761 x 0.196 = 0.149 or 14.9%
• You might notice how putting the data in a Contingency Table can help us simplify the problem.
Notice how we can read right off the table that there are 332 people who are Men and Survived, out of
2223 passengers, so we can simply take 332 / 2223 = 0.149 or 14.9%
Survived
Died
Total
Men
332
1360
1692
Women
318
104
422
Boys
29
35
64
Girls
27
18
56
Totals
706
1517
2223
Multiplication Rule
Test for Independence
•
I’ve given you examples of the multiplication rule with
independent events and with dependent events.
However, there may be some problems where you are
not sure whether you are dealing with independent
events or dependent events. In those situations, there is
a simple test you can do.
a) First, it helps to put your data into a Contingency
Table so you can clearly see how things are related
b) Next, check to see if P(B) = P(B/A)
 If P(B) = P(B/A) then A and B are independent
 If P(B) ≠ P(B/A) then A and B are dependent
Probability
of “at least one”
Probability of “at least one”
• “At least one” means one or more
• Think about this, the “complement” of one or more is
what? Isn’t it none. Thus:
Compliment of P(at least one) or P(at least one) = P(none)
• Since we know that P(A) + P(A) = 1, then:
P(at least one) + P(none) = 1 since P(none) is equivalent to the
compliment of P(at least one)
• Finally, we can say P(at least one) = 1 – P(none)
This is a critical concept that you must understand
Example: Probability of “at least one”
•
•
•
Using the formula we just learned:
P(at least one girl) = 1 – P(no girls)
Let’s find the probability of a couple having at least 1 girl
among 3 children, or P(at least 1 Girl) among 3 children
To solve this problem the key is find P(no girls) among 3
children. So, if the couple had 3 children and none of
them were girls, what did they have? Boys I hope! Thus
P(no girls) is the same as P(Boy and Boy and Boy). Since
we already know the P(Boy) = 0.50, the P(Boy and Boy
and Boy) = 0.50 x 0.50 x 0.50 = 0.125
Now we can solve the problem because we know P(no
girls) = 0.125, so P(at least one girl) = 1 – P(no girls) =
1 – 0.125 = 0.875 or 87.5%
Counting Rule
Fundamental Counting Rule
For a sequence of two events in
which the first event can occur m
ways and the second event can occur
n ways, the events together can
occur a total of m
•n
ways.
Example: if our two events are putting two letters of the alphabet together,
and there are 26 letters or ways the first event can occur, and another 26
letters or ways the second event can occur, then there are 26 x 26 = 676
different ways that we can combine two letters.
Definition
• The factorial symbol ! denotes the
product of decreasing positive whole
numbers. Thus:
• n! = n (n-1) (n-2) (n-3) ……
• Special exception: 0! = 1
• Example: 3! = 3 x 2 x 1 = 6
• In Excel, we use the formula
=FACT(number) to calculate the factorial
of any number
Factorial Rule
n different items can
be arranged in n! different orders or
A collection of
ways.
Example: A deck of 52 different cards can be arranged in
52! = 80,658,175,170,943,900,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
different orders or ways.
Permutations Rule
If we select r items from a total selection of
n
different
items,
the
number
of
permutations possible is n! / (n – r)!
Example: If we want to know how many different 5 card selections there
are from a deck of 52 different cards, we can use this formula. Thus,
there would be 52!/(52-5)! = 311,875,200 different 5 card selections you
could get from a deck of 52 cards. Note: permutations includes every
possible ordering, thus every possible ordering of the same 5 cards adds
to the possible selections when using this formula. Since, for example in
poker, we really don’t care what order the cards are in as long as we
have 5 particular cards in our hand, we should not use this Permutations
Rule, but rather the Combinations Rule which we present next, in which
we are not concerned with every possible ordering.
Combinations Rule
If we select r items from a total selection of
n
different
items,
the
number
of
combinations possible is n! / (n – r)!r!
Example: If we want to know how many different 5 card
poker hands are possible from a deck of 52 different cards,
we can use this formula. Thus, there would be 52!/(52-5)!5!
= 2,598,960 different 5 card hands possible from a deck of
52 cards. Note: combinations does not care about the
order in which we get the 5 cards, only what specific 5 cards
we end up with.
Permutations vs. Combinations
Which One to Use?
When different orderings of the same items
are to be counted separately, we have a
permutation problem, but when different
orderings are not to be counted separately,
we have a combination problem.
Section 2
Probability
END
William Christensen, Ph.D.