Probability
Probability: Probability is a branch of mathematics that deals with
calculating the likelihood of a given event's occurrence, which is
expressed as a number between 1 and 0. An event with a probability of
1 can be considered a certainty. Therefore, probability defined as
number of occurrences plus the number of failures of occurrences (the
total of possible outcomes).
Example: From a cage containing 20 red birds and 20 white birds, one bird drawn at
random. What is the probability that it is red bird?
Solution: Total number of birds in a cage
= 20 + 20 = 40
No. of red birds = 20
Probability of getting a red bird: Probability of not getting red bird or q
20 1 20 1
P q
40 2 40 2
1 1
Thus p q 1
2 2
Probability is a measure that is associated with how certain we are of
outcomes of a particular experiment or activity.
probability experiments.
A probability experiment is a chance process that leads to well-defined
results called outcomes.
An outcome is the result of a single trial of a probability experiment.
Flipping one fair coin twice is an example of an experiment.
A result of an experiment is called an outcome.
The sample space of an experiment is the set of all possible outcomes.
Three ways to represent a sample space are: to list the possible
outcomes, to create a tree diagram, or to create a Venn
diagram.
Some sample spaces for various probability experiments are shown
here.
Experiment Sample space
Toss one coin Head, tail
Roll a die 1, 2, 3, 4, 5, 6
Answer a true/false question True, false
Toss two coins Head-head, tail-tail, head-tail, tail-head
It is important to realize that when two coins are tossed, there are four
possible outcomes, as shown in the fourth experiment above.
Gender of Children
Find the sample space for the gender of the children if a
family has three children. Use B for boy and G for girl.
Solution
There are two genders, male and female, and each child could
be either gender. Hence, there are eight possibilities, as
shown here.
BBB BBG BGB GBB GGG GGB GBG BGG
The uppercase letter S is used to denote the sample space.
For example, if you flip one fair coin, S = {H, T} where
H = heads and T = tails are the outcomes.
An event is any combination of outcomes. Upper case letters like A
and B represent events. For example, if the experiment is to flip one fair
coin, event A might be getting at most one head. The probability of an
event A is written P(A).
Probabilities are between zero and one, inclusive (that is, zero
and one and all numbers between these values).
P(A) = 0 means the event A can never happen.
P(A) = 1 means the event A always happens.
P(A) = 0.5 means the event A is equally likely to occur or not to occur.
For example, if you flip one fair coin repeatedly (from 20 to 2,000 to
20,000 times) the relative frequency of heads approaches 0.5 (the
probability of heads).
Equally likely means that each outcome of an experiment occurs with
equal probability.
For example, if you toss a fair, six-sided die, each face (1, 2, 3, 4, 5, or 6)
is as likely to occur as any other face.
If you toss a fair coin, a Head (H) and a Tail (T) are equally likely to occur.
If you randomly guess the answer to a true/false question on an exam,
you are equally likely to select a correct answer or an incorrect answer.
To calculate the probability of an event A when all outcomes in the
sample space are equally likely, count the number of outcomes for
event A and divide by the total number of outcomes in the sample
space.
For example, if you toss a fair dime and a fair nickel, the sample space is
{HH, TH, HT, TT} where T = tails and H = heads. The sample space has
four outcomes. A = getting one head. There are two outcomes that meet
this condition {HT, TH}, so
P(A) = 2/4= 0.5.
Suppose you roll one fair six-sided die, with the numbers {1, 2, 3, 4, 5, 6}
on its faces. Let event E = rolling a number that is at least five. There are
two outcomes {5, 6}.
P(E) = 2/6
"OR" Event:
An outcome is in the event A OR B if the outcome is in A or is in B or is in
both A and B. For example, let A = {1, 2, 3, 4,5} and B = {4, 5, 6, 7, 8}.
A OR B = {1, 2, 3, 4, 5, 6, 7, 8}.
Notice that 4 and 5 are NOT listed twice.
"AND" Event:
An outcome is in the event A AND B if the outcome is in both A and B at
the same time. For example, let A and B be {1, 2,3, 4, 5} and {4, 5, 6, 7,
8}, respectively. Then A AND B = {4, 5}.
TERMINOLOGY
Experiment a planned activity carried out under controlled
Conditions.
Outcome: A result of an experiment.
Sample Space (S): Is the set of all possible outcomes.
Event (A, B, C,…): Is any combination of the outcomes.
As an arbitrary subset in S, event can contain one outcome,
two outcomes, no outcomes (empty subset), the entire
sample space
PROBABILITY
Probability: Is the likelihood that a specific event will occur
The complement of event A is denoted A′ (read "A prime"). A′ consists
of all outcomes that are NOT in A.
Notice that P(A)+ P(A′) = 1.
For example, let S = {1, 2, 3, 4, 5, 6} and let A = {1, 2, 3, 4}.
Then, A′ = {5, 6}.
P(A) = , P(A′) =
and
P(A) + P(A′) = + = 1
The conditional probability of A given B is written P(A|B). P(A|B) is the
probability that event A will occur given that the event B has already
occurred.
THE COMPLEMENT OF AN EVENT
The complement of event A is denoted A′ (read "A
prime"). A′ consists of all outcomes that are NOT in A.
P(A) + P(A′)=1
S = {1,2,3,4,5,6}
A = {5,6}
A′ = {1,2,3,4}
P(A) = 2/6, P(A′) = 4/6
P ( A ) + P ( A ′ ) = 2/6 + 4/6 = 1
A conditional reduces the sample space. We calculate the
probability of A from the reduced sample space B. The formula to
calculate P(A|B) is P(A|B) =
where P(B) is greater than zero.
For example, suppose we toss one fair, six-sided die. The sample space S
= {1, 2, 3, 4, 5, 6}. Let A = face is 2 or 3 and B =face is even (2, 4, 6). To
calculate P(A|B), we count the number of outcomes 2 or 3 in the sample
space B = {2, 4, 6}. Then we divide that by the number of outcomes B
(rather than S).
We get the same result by using the formula. Remember that S has six
outcomes.
P(A|B) =
The sample space S is the whole numbers starting at one and less than
20.
S = _____________________________
Let event A = the even numbers and event B = numbers greater than 13.
b. A = _____________________, B = _____________________
c. P(A) = _____________, P(B) = ________________
d. A AND B = ____________________, A OR B = ________________
e. P(A AND B) = _________, P(A OR B) = _____________
f. A′ = _____________, P(A′) = _____________
g. P(A) + P(A′) = ____________
h. P(A|B) = ___________, P(B|A) = _____________;
are the probabilities equal?
Solution a. S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19}
b. A = {2, 4, 6, 8, 10, 12, 14, 16, 18}, B = {14, 15, 16, 17, 18, 19}
c. P(A) = 9/19 , P(B) = 6/19
d. A AND B = {14,16,18}, A OR B = {2, 4, 6, 8, 10, 12, 14, 15, 16, 17, 18,
19}
e. P(A AND B) = 3/19 , P(A OR B) = 12/19
f. A′ = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19} ; P(A′) = 10/19
g. P(A) + P(A′) = 9/19 + 10/19 = 1
h. P(A|B) = =3/6
P(B|A) = =3/9
, No
Independent and Mutually Exclusive Events
Independent and mutually exclusive do not mean the same
thing.
Independent Events
Two events are independent if the following are true:
• P(A|B) = P(A)
• P(B|A) = P(B)
• P(A AND B) = P(A)P(B)
Two events A and B are independent if the knowledge that
one occurred does not affect the chance the other occurs. For
example, the outcomes of two roles of a fair die are
independent events. The outcome of the first roll does not
change the probability for the outcome of the second roll.
To show two events are independent, you must show only
one of the above conditions.
If two events are NOT independent, then we say that they are
dependent.
Sampling may be done with replacement or without replacement.
• With replacement: If each member of a population is
replaced after it is picked, then that member has the
possibility of being chosen more than once. When sampling is
done with replacement, then events are considered to be
independent, meaning the result of the first pick will not
change the probabilities for the second pick.
• Without replacement: When sampling is done without
replacement, each member of a population may be chosen
only once. In this case, the probabilities for the second pick
are affected by the result of the first pick. The events are
considered to be dependent or not independent.
If it is not known whether A and B are independent or
dependent, assume they are dependent until you can show
otherwise.
You have a fair, well-shuffled deck of 52 cards. It consists of four suits.
The suits are clubs, diamonds, hearts and spades. There are 13 cards in
each suit consisting of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J (jack), Q (queen), K
(king) of that suit.
a. Sampling with replacement:
Suppose you pick three cards with replacement. The first card you pick
out of the 52 cards is the Q of spades. You put this card back, reshuffle
the cards and pick a second card from the 52-card deck. It is the ten of
clubs. You put this card back, reshuffle the cards and pick a third card
from the 52-card deck. This time, the card is the Q of spades again. Your
picks are {Q of spades, ten of clubs, Q of spades}. You have picked the Q
of spades twice.
You pick each card from the 52-card deck.
b. Sampling without replacement: Suppose you
pick three cards without replacement. The first card you pick out of the
52 cards is the K of hearts. You put this card aside and pick the second
card from the 51 cards remaining in the deck. It is the three of
diamonds. You put this card aside and pick the third card from the
remaining 50 cards in the deck. The third card is the J of spades. Your
picks are {K of hearts, three of diamonds, J of spades}. Because you have
picked the cards without replacement, you cannot pick the same card
twice.
EXAMPLE:
You have a fair, well-shuffled deck of 52 cards. It consists of
four suits. The suits are clubs, diamonds, hearts, and
spades. There are 13 cards in each suit consisting of 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, J (jack), Q (queen), and K (king)
of that suit. S = spades, H = Hearts, D = Diamonds, C = Clubs.
a. Suppose you pick four cards, but do not put any cards back
into the deck. Your cards are QS, 1D, 1C, QD.
b. Suppose you pick four cards and put each card back before you pick
the next card. Your cards are KH, 7D, 6D, KH.
Which of a. or b. did you sample with replacement and which did you
sample without replacement?
Solution
a. Without replacement;
b. b. With replacement
Mutually Exclusive Events
A and B are mutually exclusive events if they cannot occur at the same
time. This means that A and B do not share any
outcomes and P(A AND B) = 0.
For example, suppose the sample space S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
Let A = {1, 2, 3, 4, 5}, B = {4, 5, 6, 7, 8}, and C= {7, 9}.
A AND B = {4, 5}.
P(A AND B) = 2/10 and is not equal to zero. Therefore, A and B are not
mutually exclusive.
A and C do not have any numbers in common so P(A AND C) = 0.
Therefore, A and C are mutually exclusive.
If it is not known whether A and B are mutually exclusive, assume they
are not until you can show otherwise. The following examples illustrate
these definitions and terms.
Disjointedness
• Two sets A, B are called Help, I’ve
been
disjoint (i.e., unjoined) disjointed!
iff their intersection is
empty. (AB=)
• Example: the set of even
integers is disjoint with
the set of odd integers.
31
DeMorgan’s Law for Sets
• Exactly analogous to (and derivable from)
DeMorgan’s Law for propositions.
A B A B
A B A B
32
Types of Events (Sure Event)
Sure Event: In the throw of a die, sample space S = {1, 2, 3, 4, 5, 6}
S S S represents an event.
Each outcome of the experiment is a member of S.
S is called a sure event or certain event.
33
(Impossible Event)
Impossible Event: In the throw of a die, sample space
S = {1, 2, 3, 4, 5, 6}.
Let E be the event of getting an ‘8’ on the die.
Clearly, no outcome can be a number 8.
E = is an impossible event.
Complement of an event E or EC = not E = S - E
34
Universal Events
In a random experiment, two or more events are universal if
their union is the sample space.
i.e. in a random experiment, events E1, E2, ...En
with sample space S are exhaustive if
E1 E2 ... En = S
35
EXAMPLE:
Flip two fair coins. (This is an experiment.)
The sample space is {HH, HT, TH, TT} where T = tails and H =
heads.
The outcomes are HH, HT, TH, and TT.
The outcomes HT and TH are different.
The HT means that the first coin showed heads and the
second coin
showed tails. The TH means that the first coin showed tails
and the second coin showed heads.
• Let A = the event of getting at most one tail. (At most one
tail means zero or one tail.) Then A can be written as {HH, HT,
TH}. The outcome HH shows zero tails. HT and TH each show
one tail.
• Let B = the event of getting all tails. B can be written
as {TT}. B is the complement of A, so B = A′. Also,
P(A) + P(B) = P(A) + P(A′) = 1.
• The probabilities for A and for B are P(A) = 3/4
and P(B) = ¼
• Let C = the event of getting all heads. C = {HH}. Since
B = {TT},
P(B AND C) = 0. B and C are mutually exclusive. (B and
C have no members in common because you cannot
have all tails and all heads at the same time.)
• Let D = event of getting more than one tail. D = {TT}.
P(D) = ¼
• Let E = event of getting a head on the first roll. (This implies
you can get either a head or tail on the second roll.)
E = {HT, HH}. P(E) = 2/4
• Find the probability of getting at least one (one or two) tail
in two flips. Let F = event of getting at least one tail in two
flips.
F = {HT, TH, TT}.
P(F) = 3/4
Example:
In a box there are three red cards and five blue cards. The red
cards are marked with the numbers 1, 2, and 3, and the blue
cards are marked with the numbers 1, 2, 3, 4, and 5. The cards
are well-shuffled. You reach into the box (you cannot see into
it) and draw one card.
Let R = red card is drawn, B = blue card is drawn, E = even-
numbered card is drawn.
The sample space S = R1, R2, R3, B1, B2, B3, B4, B5. S has
eight outcomes.
• P(R) = 3/8
P(B) = 5/8
P(R AND B) = 0. (You cannot draw one card that is both red
and blue.)
• P(E) = 3/8
(There are three even-numbered cards, R2, B2, and
B4.)
• P(E|B) = 2/5
(There are five blue cards: B1, B2, B3, B4, and B5. Out
of the blue cards, there are two even cards; B2 and
B4.)
• P(B|E) = 2/3
(There are three even-numbered cards: R2, B2, and
B4. Out of the even-numbered cards, to are blue; B2
and B4.)
Two Basic Rules of Probability
When calculating probability, there are two rules to consider when
determining if two events are independent or dependent and if they are
mutually exclusive or not.
The Multiplication Rule
If A and B are two events defined on a sample space, then:
P(A AND B) = P(B)P(A|B).
This rule may also be written as: P(A|B) =
(The probability of A given B equals the probability of A and B divided by
the probability of B.)
If A and B are independent, then P(A|B) = P(A). Then P(A AND B) = P(A|
B)P(B) becomes P(A AND B) = P(A)P(B).
Multiplication Rule
If A and B are two events defined on a sample space,
then:
P(A AND B) = P(B)P(A|B).
P(A|B) =
If A and B are independent, then P(A|B) = P(A).
P(A AND B) = P(A)P(B).
Addition Rule
If A and B are defined on a sample space,
then:
P(A OR B) = P(A) + P(B) - P(A AND B).
If A and B are mutually exclusive, then
P(A AND B) = 0.
P(A OR B) = P(A) + P(B)
The Addition Rule
If A and B are defined on a sample space, then: P(A OR B) = P(A) + P(B) -
P(A AND B).
If A and B are mutually exclusive, then P(A AND B) = 0. Then
P(A OR B) = P(A) + P(B) - P(A AND B) becomes
P(A OR B) = P(A) + P(B).
Example: Carlos plays college soccer. He makes a goal 65% of the time
he shoots. Carlos is going to attempt two goals in a row in the next
game. A = the event Carlos is successful on his first attempt. P(A) = 0.65.
B = the event Carlos is successful on his second attempt. P(B) = 0.65.
Carlos tends to shoot in streaks. The probability that he makes the
second goal GIVEN that he made the first goal is 0.90.
a. What is the probability that he makes both goals?
Solution
a. The problem is asking you to find P(A AND B) = P(B AND A).
Since P(B|A) = 0.90:
P(B AND A) = P(B|A)P(A) = (0.90)(0.65) = 0.585
Carlos makes the first and second goals with probability
0.585.
b. What is the probability that Carlos makes either the first
goal or the second goal?
Solution
b. The problem is asking you to find P(A OR B).
P(A OR B) = P(A) + P(B) - P(A AND B) = 0.65 + 0.65 - 0.585 =
0.715
Carlos makes either the first goal or the second goal with
probability 0.715.
c. Are A and B independent?
Solution
c. No, they are not, because P(B AND A) = 0.585.
P(B)P(A) = (0.65)(0.65) = 0.423
0.423 ≠ 0.585 = P(B AND A)
So, P(B AND A) is not equal to P(B)P(A).
d. Are A and B mutually exclusive?
Solution
d. No, they are not because P(A and B) = 0.585.
Contingency Table, Tree and Venn
diagrams
Contingency Tables
A contingency table provides a way of portraying data
that can facilitate calculating probabilities. The table
helps in determining conditional probabilities quite
easily. The table displays sample values in relation to
two different variables that may be dependent or
contingent on one another.
EXAMPLE : Suppose a study of speeding violations and drivers
who use cell phones produced the following fictional data:
Speeding violation in No speeding Total
the last year violation in the last
year
Cell phone user 25 280 305
Not a cell phone 45 405 450
user
Total 70 685 755
The total number of people in the sample is 755. The row
totals are 305 and 450. The column totals are 70 and 685.
Notice that 305 + 450 = 755 and 70 + 685 = 755.
Calculate the following probabilities using the table.
.a. Find P(Person is a car phone user)
Solution
.a =
b. Find P(person had no violation in the last year).
Solution
b. =
c. Find P(Person had no violation in the last year AND
was a car phone user).
Solution
c.
d. Find P(Person is a car phone user OR person had no
violation in the last year).
Solution
e. Find P(Person is a car phone user GIVEN person had
a violation in the last year).
Solution
e. (The sample space is reduced to the number
of persons who had a violation.)
f. Find P(Person had no violation last year GIVEN
person was not a car phone user)
Solution
f. (The sample space is reduced to the number of
persons who were not car phone users.)
Example:
Muddy Mouse lives in a cage with three doors. If Muddy goes
out the first door, the probability that he gets caught by Alissa
the cat is 1/5 and the probability he is not caught is 4/5. If he
goes out the second door, the probability he gets caught by
Alissa is 1/4 and the probability he is not caught is 3/4. The
probability that Alissa catches Muddy coming out of the third
door is 1/2 and the probability she does not catch Muddy is
1/2. It is equally likely that Muddy will choose any of the three
doors so the probability of choosing each door is 1/3.
Caught or Door One Door Two Door Three Total
Not
Caught
Not Caught
Total 1
• The first entry = is P(Door One AND Caught)
• The entry = is P(Door One AND Not Caught)
Verify the remaining entries.
a. Complete the probability contingency table. Calculate the entries for
the totals. Verify that the lower-right corner entry is 1.
b. What is the probability that Alissa does not catch Muddy?
b.
Caught or Not Door One Door Two Door Three Total
Caught
Not Caught
Total 1
Example:
The following are real data from Santa Clara County, CA. As of a certain
time, there had been a total of 3,059 documented cases of AIDS in the
county. They were grouped into the following categories:
Table bellow includes homosexual/bisexual, IV drug users
Suppose a person with AIDS in Santa Clara County is randomly selected.
Homosexual/Bisexual IV Drug User* Heterosexual Other Totals
Contact
Female 0 70 136 49
Male 2,146 463 60 135
a. Find P(Person is female).
b. Find P(Person has a risk factor heterosexual contact).
c. Find P(Person is female OR has a risk factor of IV drug user).
d. Find P(Person is female AND has a risk factor of
homosexual/bisexual).
e. Find P(Person is male AND has a risk factor of IV drug user).
f. Find P(Person is female GIVEN person got the disease from
heterosexual contact).
Solution
The completed contingency table is as follows:
a. 255/3059
b. 196/3059
c. 255/3059 + 533/3059 – 70/3059= 718/3059
d. 0
e. 463/3059
f. 136/196
Tree and Venn Diagrams
Sometimes, when the probability problems are complex, it can be
helpful to graph the situation. Tree diagrams and Venn diagrams are two
tools that can be used to visualize and solve conditional probabilities.
A tree diagram is a special type of graph used to determine
the outcomes of an experiment. It consists of "branches" that
are labeled with either frequencies or probabilities. Tree
diagrams can make some probability problems easier to
visualize and solve.
Example:
Suppose that you have eight cards. Five are green and three
are yellow. The cards are well shuffled. Suppose that you
randomly draw two cards, one at a time, with replacement.
Let G1 = first card is green
Let G2 = second card is green
a. Draw a tree diagram of the situation.
b. Find P(G1 AND G2).
c. Find P(at least one green).
d. Are G2 and G1 independent events? Explain why or why
not.
b. P(GG) =
c. P(at least one green) = P(GG) + P(GY) + P(YG)
d. Yes, they are independent because the first card is placed
back in the bag before the second card is drawn; the
composition of cards in the bag remains the same from draw
one to draw two.
EXAMPLE :
In an urn, there are 11 balls. Three balls are red (R) and eight balls are
blue (B).
Draw two balls, one at a time, with replacement. "With replacement"
means that you put the first ball back in the urn before you select the
second ball.
Total = 64 + 24 + 24 + 9 = 121
Without replacement
Venn diagram
A Venn diagram is a picture that represents the outcomes of an
experiment. It generally consists of a box that represents the sample
space S together with circles or ovals. The circles or ovals represent
events. A Venn diagram is especially helpful for visualizing the OR event,
the AND event, and the complement of an event and for understanding
conditional probabilities.
EXAMPLE:
Suppose an experiment has the outcomes 1, 2, 3, ... , 12 where each
outcome has an equal chance of occurring.
Let event A = {1, 2, 3, 4, 5, 6} and event B = {6, 7, 8, 9}. Then A AND B =
{6} and A OR B = {1, 2, 3, 4, 5, 6, 7,8, 9}. The Venn diagram is as follows:
Example:
Flip two fair coins. Let A = tails on the first coin. Let B = tails on the
second coin. Then A = {TT, TH} and B = {TT, HT}. Therefore, A AND B =
{TT}. A OR B = {TH, TT, HT}.
The sample space when you flip two fair coins is X = {HH, HT, TH, TT}.
The outcome HH is in NEITHER A NOR B. The Venn diagram is as follows: