Download probability! - IPEM Group of Institutions

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Inductive probability wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
PROBABILITY!
Let’s learn about probability and
chance!
What is probability?
• Probability is the measure of how likely
an event or outcome is.
• Different events have different
probabilities!
The outcomes of an experiment
are the ways it can happen.
6
10
12
52
The event is the particular outcome
you are looking for.
Mutually exclusive events:
If one and only one of them can take place at a time.
A
B
Equally likely Event: Each event has an equal chance of occurrence.
Complementary Event : The complement of an event is the
set of all the outcomes in a sample space that are not included in
The event.
P(A’) = 1- P(A)
• Probability is expressed in numbers between
0 and 1.
•
Probability = 0 means the event never
happens;
• probability = 1 means it always happens.
• The total probability of all possible event
always sums to 1.
How do we express probabilities?
• Usually, we express probabilities as
fractions.
– The numerator is the number of ways the
event can occur.
– The denominator is the number of possible
events that could occur.
• Let’s look at an example!
Theoretical Probability
Theoretical Probability is based upon the
number of favorable outcomes divided by
the total number of outcomes
Theoretical Probability
Formula
Theoretical Probability :
P=
Number of favorable outcomes
Total number of outcomes
Example:
In the roll of a die, the probability of getting an even number is
3/6 or ½.
What is the probability the spinner
will land on the number 3?
1 2
3 4
1. How many 3’s are on the spinner?
2. How many possible numbers could the spinner land on?
1 2
3 4
1
4
What is the probability the die
will land on an even number?
Remember, a die has six sides. Numbers 1, 2, 3, 4,
5, and 6 are each depicted once on the die.
Ask yourself the following questions:
1. How many even numbers are on the die?
2. How many possible numbers could the die land on?
3
6
What is the probability that I
will choose a red marble?
• In this bag of marbles, there are:
–
–
–
–
3 red marbles
2 white marbles
1 purple marble
4 green marbles
Ask yourself the following questions:
1. How many red marbles are in the bag?
2. How many marbles are in the bag IN ALL?
3
10
a)
b)
P(red)
P(blue)
P(yellow or blue)
A
1
5
A
2
5
A
3
5
B
1
4
B
1
2
1
4
B
CARDS
What is the probability of getting 4 fives?
P(4 fives) =
1
13
DICE
What is the probability of getting an even
number?
P(even) =
6
12
COINS
What is the probability of rolling two coins and
getting H first and then T?
P(H & then T) =
1
4
HH T T HT TH
Experimental Probability
• As the name suggests, Experimental
Probability is based upon repetitions of
an actual experiment.
Example:
If you toss a coin 10 times and record
that the number of times the result was
8 heads, then the experimental
probability was 8/10 or 4/5
Experimental Probability:
P
=
Number of favorable outcomes
Total number trials
• In an experiment a coin is tossed 15
times. The recorded outcomes were: 6
heads and 9 tails. What was the
experimental probability of the coin
being heads?
P (heads) =
# Heads
Total # Tosses
= 6
15
Odds
Odds
• Another way to describe the chance of an event
occurring is with odds. The odds in favor of an event
is the ratio that compares the number of ways the
event can occur to the number of ways the event
cannot occur.
• We can determine odds using the following ratios:
Odds in Favor = number of successes
number of failures
Odds against =
number of failures
number of successes
Suppose we play a game with 2 die.
If the sum of the numbers rolled is 6 or less – you win!
If the sum of the numbers rolled is not 6 or less – you lose
In this situation we can express odds as follows:
Odds in favor =
Odds against =
numbers rolled is 6 or less
numbers rolled is not 6 or less
numbers rolled is not 6 or less
`
numbers rolled is 6 or less
• A bag contains 5 yellow marbles, 3 white marbles, and 1
black marble. What are the odds drawing a white marble
from the bag?
Odds in favor =
number of white marbles
number of non-white marbles
Odds against =
number of non-white marbles
number of white marbles
Therefore, the odds for are 1:2
and the odds against are 2:1
=
3
6
6
3
Your Turn - Probability
•
Find the probability of randomly choosing a red or
white marble from the given bag of red and white
marbles.
1. Number of red marbles
16
Total number of marbles
64
2. Number of red marbles
8
Total number of marbles
40
3. Number of white marbles
7
Total number of marbles
20
4. Number of white marbles
24
Total number of marbles
32
Find the favorable odds of choosing the
indicated letter from a bag that
contains the letters in the name of
the given state.
5.
6.
7.
8.
S; Mississippi
N; Pennsylvania
A; Nebraska
G; Virginia
You toss a six-sided number cube 20 times. For twelve of the tosses
the number tossed was 3 or more.
9.
What is the experimental probability that the number tossed was
3 or more?
10.
What are the favorable odds that the number tossed was 3 or
more?
1.
2.
3.
4.
5.
¼
1/5
13/20
¼
4/11
6. ¼
7. ¼
8. 1/8
9. 3/5
10. 3/2
• Two events A and B are independent in case
P(AB) = P(A)P(B)
• A set of events {Ai} is independent in case
Pr(
i
Ai )   i Pr( Ai )
P(A) =Only one event A can take place.
Additional rule
If events are mutually exclusive ,the probability of
either A or B happening
P(A or B) = P(A) + P(B)
/U
Pr(
A
B
i
Ai )  i Pr( Ai )
P(A or B)=
Five equally capable students are waiting for a job interview with a company
That has announced that it will hire only one of them. the group consists of
John,Bill,Sally ,Helen and Walter.
• What is the Probability that John will be the candidate?
• What is the probability that either John or Helen will be candidate?
Probability of getting either ace or a heart from a deck of cards?
If events are not mutually exclusive ,the probability of either A or
B happening
P(A or B) = P(A) + P(B) – P(AB)
/U
The employees of a certain company have elected 5 of their number to
represent them on the employee- management probability council.
1. male—30 years, 2. male– 32,3.female– 45, 4. female—20, 5. male—40
What is the probability the spokesperson will be either female or over 35?
Conditional Probability
If A and B are events with Pr(A) > 0, the conditional probability of
B given A is
Pr( B | A) 
Pr( AB)
Pr( A)
Bayes’ Theorem
Suppose we have estimated
prior probabilities for events
we are concerned with, and
then obtain new information.
We would like to a sound
method to computed revised
or posterior probabilities.
Bayes’ theorem gives us a
way to do this.
Probability Revision using Bayes’
Theorem
Prior
Probabilities
New
Information
Application of
Bayes’
Theorem
Posterior
Probabilities
Application of Bayes’ Theorem
•Consider a manufacturing firm that receives
shipment of parts from two suppliers.
•Let A1 denote the event that a part is received
from supplier 1; A2 is the event the part is
received from supplier 2
We get 65 percent of our parts
from supplier 1 and 35
percent from supplier 2.
Thus:
P(A1) = .65 and P(A2) = .35
Quality levels differ between
suppliers
Percentage
Good Parts
Percentage
Bad Parts
Supplier 1
98
2
Supplier 2
95
5
Let G denote that a part is good and B denote
the event that a part is bad. Thus we have the
following conditional probabilities:
P(G | A1 ) = .98 and P(B | A2 ) = .02
P(G | A2 ) = .95 and P(B | A2 ) = .05
Tree Diagram for Two-Supplier Example
Step 1
Supplier
Step 2
Condition
G
A1
Experimental
Outcome
(A1, G)
B
(A1, B)
A2
(A2, G)
G
B
(A2, B)
Each of the experimental
outcomes is the intersection of 2
events. For example, the
probability of selecting a part
from supplier 1 that is good is
given by:
P( A1 , G)  P( A1  G)  P( A1 ) P(G | A1 )
Probability Tree for Two-Supplier
Example
Step 1
Supplier
Step 2
Condition
Probability of Outcome
P( A1  G)  P( A1 ) P(G | A1 )  .6370
P(G | A1)
.98
P(A1)
.65
P(A2)
P(B | A2)
P( A1  B)  P( A1 ) P( B | A1 )  .0130
.02
P(B | A2)
P( A2  G)  P( A2 ) P(G | A2 )  .3325
.95
.35
P(B | A2)
.05
P( A2  B)  P( A2 ) P(G | A2 )  .0175
A bad part broke one
of our machines—so
we’re through for the
day. What is the
probability the part
came from suppler 1?
We know from the law of conditional probability that:
P( A1  B)
P( A1 | B) 
P( B)
Observe from the probability tree that:
P( A1  B)  P( A1 ) P( B | A1 )
The probability of selecting a bad
part is found by adding together
the probability of selecting a bad
part from supplier 1 and the
probability of selecting bad part
from supplier 2.
That is:
P( B)  P( A1  B)  P( A2  B)
 P( A1 ) P( B | A1 )  P( A2 ) P( B / A2 )
Bayes’ Theorem for 2 events
By substituting equations (4.15) and (4.16) into
(4.14), and writing a similar result for P(B | A2), we
obtain Bayes’ theorem for the 2 event case:
P( A1 ) P( B | A1 )
P( A1 | B) 
P( A1 ) P( B | A1 )  P( A2 ) P( B | A2 )
P( A2 ) P( B | A2 )
P( A2 | B) 
P( A1 ) P( B | A1 )  P( A2 ) P( B | A2 )
P( A1 ) P( B | A1 )
P( A1 | B) 
P( A1 ) P( B | A1 )  P( A2 ) P( B | A2 )
(.65)(.02)
.0130


 .4262
(.65)(.02)  (.35)(.05) .0305
P( A2 ) P( B | A2 )
P( A2 | B) 
P( A1 ) P( B | A1 )  P( A2 ) P( B | A2 )
(.35)(.05)
.0175


 .5738
(.65)(.02)  (.35)(.05) .0305
Bayes’ Theorem
P( Ai ) P( B | Ai )
P( Ai | B) 
P( A1 ) P( B | A1 )  P( A2 ) P( B | A2 )  ...  P( An ) P( B | An )
Tabular Approach to Bayes’ Theorem—
2-Supplier Problem
(1)
Events
Ai
(2)
Prior
Probabilities
P(Ai)
(3)
Conditional
Probabilities
P(B | A1 )
(4)
Joint
Probabilities
P(Ai ∩ B)
(5)
Posterior
Probabilities
P(Ai | B)
A1
.65
.02
.0130
.0130/.0305
=.4262
A2
.35
1.00
.05
.0175
P(B)=.0305
.0175/.0305
=.5738
1.0000
Probability distributions
• We use probability distributions because they
work –they fit lots of data in real world
Random variable
• The mathematical rule (or function) that
assigns a given numerical value to each
possible outcome of an experiment in the
sample space of interest.
Random variables
• Discrete random variables
• Continuous random variables
The Binomial Distribution
Bernoulli Random Variables
Imagine a simple trial with only two possible outcomes
Success (S)
Failure (F)
Toss o
Jacob Bernoulli (1654-1705)
Examples
a coin (heads or tails)
Survival of an organism in a region
(live or die)
The Binomial Distribution
Overview
• Suppose that the probability of success is p
• What is the probability of failure?
– q=1–p
• Examples
– Toss of a coin (S = head): p = 0.5  q = 0.5
– Roll of a die (S = 1): p = 1/6  q = 1-1/6=5/6
• What is the probability of obtaining x successes in n
trials?
• Example
– What is the probability of obtaining 2 heads from
a coin that was tossed 5 times?
P(HHTTT) = (1/2)5 = 1/32
• What is the probability of obtaining x successes in n
trials?
• Example
– What is the probability of obtaining 2 heads from
a coin that was tossed 5 times?
P(HHTTT) = (1/2)5 = 1/32
In general, if trials result in a series of success and failures,
FFSFFFFSFSFSSFFFFFSF…
Then the probability of x successes in that order is
P(x)
=qqpq
= px  qn – x
• However, if order is not important, then
P(x) =
n!
where
successesx!(n – x)!
n!
x!(n – x)!
px  qn – x
is the number of ways to obtain x
in n trials, and i! = i  (i – 1)  (i – 2)  …  2  1
Mean=np, Variance= npq
Definition
• A binomial experiment is a probability experiment
that satisfies the following conditions:
1. The experiment is repeated for a fixed number of
trials, where each trial is independent of the other
trials.
2. There are only two possible outcomes of interest for
each trial. The outcomes can be classified as a
success (S) or as a failure (F).
3. The probability of a success, P(S), is the same for
each trial.
4. The random variable, x, counts the number of
successful trials.
Notation for Binomial Experiments
Symbol
Description
n
The number of times a trial is repeated.
p = P(S)
The probability of success in a single
trial.
q = P(F)
The probability of failure in a single trial
(q = 1 – p)
x
The random variable represents a
count of the number of successes in n
trials: x = 0, 1, 2, 3, . . . n.
Ex. 1: Binomial Experiments
• Decide whether the experiment is a binomial
experiment. If it is, specify the values of n, p
and q and list the possible values of the
random variable, x. If it is not, explain why.
1. A certain surgical procedure has an 85%
chance of success. A doctor performs the
procedure on eight patients. The random
variable represents the number of successful
surgeries.
Solution: the experiment is a binomial
experiment because it satisfies the four
conditions of a binomial experiment. In the
experiment, each surgery represents one
trial. There are eight surgeries, and each
surgery is independent of the others. Also,
there are only two possible outcomes for each
surgery—either the surgery is a success or it
is a failure. Finally, the probability of success
for each surgery is 0.85.
n=8
p = 0.85
q = 1 – 0.85 = 0.15
x = 0, 1, 2, 3, 4, 5, 6, 7, 8
A jar contains five red marbles, nine blue marbles and
six green marbles. You randomly select three marbles
from the jar, without replacement. The random
variable represents the number of red marbles.
The experiment is not a binomial experiment because it
does not satisfy all four conditions of a binomial
experiment. In the experiment, each marble selection
represents one trial and selecting a red marble is a
success. When selecting the first marble, the
probability of success is 5/20. However because the
marble is not replaced, the probability is no longer
5/20. So the trials are not independent, and the
probability of a success is not the same for each trial.
In a survey, American workers and retirees are asked to name their expected
sources of retirement income. The results are 36% of working Americans
expect to rely on social security for retirement income . Seven workers who
participated in the survey are asked whether they expect to rely on social
security for retirement income. Create a binomial probability distribution for
the number of workers who respond yes.
p = 0.36 and q = 0.64. Because n = 7, the possible values for x are 0, 1, 2, 3,
4, 5, 6 and 7.
x
P(x)
P(0) 7 C0 (0.36) (0.64)  0.044
0
0.044
P(1) 7 C1 (0.36)1 (0.64) 6  0.173
1
0.173
P(2) 7 C2 (0.36) 2 (0.64)5  0.292
2
0.292
P(3) 7 C3 (0.36)3 (0.64) 4  0.274
3
0.274
4
0.154
5
0.052
P(5) 7 C5 (0.36)5 (0.64) 2  0.052
6
0.010
P(6) 7 C 6 (0.36) 6 (0.64)1  0.010
7
0.001
0
7
P(4) 7 C4 (0.36) (0.64)  0.154
4
3
P(7) 7 C7 (0.36) (0.64)  0.001
7
0
P(x) = 1
Finding a Binomial Probability Using a Table
•
Fifty percent of working adults spend less than 20 minutes commuting
to their jobs. If you randomly select six working adults, what is the
probability that exactly three of them spend less than 20 minutes
commuting to work? Use a table to find the probability.
Solution: A portion of Table 2 is shown here. Using the distribution for n
= 6 and p = 0.5, you can find the probability that x = 3, as shown by the
highlighted areas in the table.
In a city, 57% of the days in a year are cloudy.
Find the mean, variance, and standard deviation for
the number of cloudy days during the month of
June. What can you conclude?
Solution: There are 30 days in June. Using n=30, p =
0.57, and q = 0.43, you can find the mean variance and
standard deviation as shown. Mean:  = np =
30(0.57) = 17.1
Variance: 2 = npq = 30(0.57)(0.43) = 7.353
Standard Deviation:  = √npq = √7.353 ≈2.71
The Poisson Distribution
Overview
• When there is a large number
of trials, but a small
probability of success, binomial
calculation becomes
impractical
– Example: Number of deaths
from horse kicks in the
Army in different years
• The mean number of successes
from n trials is µ = np
– Example: 64 deaths in 20
years from thousands of
soldiers
Simeon D. Poisson (1781-1840)
If we substitute µ/n for p, and let n tend to infinity, the binomial
distribution becomes the Poisson distribution:
e -µµx
P(x) =
x!
Poisson distribution is applied where random events in space or time are
expected to occur
Deviation from Poisson distribution may indicate some degree of nonrandomness in the events under study
Investigation of cause may be of interest