Discrete MathematicsProbability, Conditioning and Expectation1 of 9
Probability, Conditioning and Expectation · 1
Probability from Counting
We know how to count outcomes using slots, subsets, complements, and overlaps, and now we want to use those counts to find the probability that a specific result happens.
1
Equally Likely Outcomes and the Sample Space
Suppose we roll two fair six-sided dice and add them together. We want to find the probability that their sum is 7:
P(sum is 7)
Equally Likely Outcomes and the Sample Space
Text solution
Count the sample space of ordered dice pairsColoring one die red and one die blue gives 6 options for the red die and 6 options for the blue die, so the product rule gives every equally likely pair.
6×6=36
Count the event of pairs that add up to 7Listing the matching (Red,Blue) pairs, (1,6),(2,5),(3,4),(4,3),(5,2), and (6,1), gives 6 outcomes inside the event.
outcomes in the event=6
Divide the event size by the sample space sizePut the 6 winning pairs over the 36 equally likely pairs in the sample space S to get the probability.
P(sum is 7)=sample space S:all equally likelyoutcomes366event:subset of Swe want=61
Whenever every outcome in the sample space S has the exact same chance of happening, the probability of an event is a single fraction of two counts:
P(event)=number of outcomes in Snumber of outcomes in the event
Every event for two dice is a subset of the 36 equally likely (Red,Blue) pairs in the grid, and a sum like 7 is more likely than 2 or 12 because more pairs add up to it.
Every event is a subset of the same 36 equally likely dice pairs, and its probability is how many pairs are in that subset over 36.
2
Counting Ordered Outcomes with Slots
When the sample space has too many outcomes to draw as a grid, we count the bottom and the top of the probability fraction using slots. Suppose a random 3-digit PIN is formed using only the digits 1 through 5, and we want to find the probability that the PIN has no repeated digits:
P(no repeated digits)
Counting Ordered Outcomes with Slots
Text solution
Count all 3-digit PINs in the sample spaceAny of the 5 digits can go in each of the 3 slots when repeats are allowed.
5×5×5=125
Count the PINs with no repeated digitsEach slot has one fewer digit left to choose from than the slot before it.
5×4×3=60
Divide the event size by the sample space sizePut the 60 repeat-free PINs over the 125 total PINs.
P(no repeated digits)=12560=2512
3
Counting Subsets and Why Order Cancels Out
Now suppose we grab a handful of items all at once, where the order we grab them in doesn't change the handful. A box holds 10 lightbulbs, of which 3 are broken and 7 work. If we grab 4 bulbs at random, we want to find the probability of getting a handful with 1 broken bulb and 3 working bulbs:
P(exactly 1 broken bulb)
To count unordered subsets of k items chosen from n distinct items, we multiply k slots down from n and divide out the k! ways to order the chosen items:
n choose k(kn)=orders of the k itemsk×(k−1)×⋯×1n×(n−1)×⋯×(n−k+1)k slots
Counting Subsets and Why Order Cancels Out
Text solution
Count all unordered handfuls of 4 bulbs in the sample spaceChoose 4 bulbs out of the 10 distinct bulbs in the box.
(410)=4×3×2×110×9×8×7=210
Count the handfuls with 1 broken bulb and 3 working bulbsChoose 1 of the 3 broken bulbs and 3 of the 7 working bulbs, then multiply the two counts by the product rule.
(13)×(37)=3×3×2×17×6×5=3×35=105
Divide the event size by the sample space sizePlace the 105 winning handfuls over the 210 total handfuls.
P(exactly 1 broken bulb)=210105=21
If we instead write each unordered handful of 4 bulbs in all 4×3×2×1=24 possible orders, the event on top and the sample space on the bottom both get multiplied by the exact same factor of 24, leaving the simplified probability at 21.
Unpacking every handful into its ordered draws multiplies the top and bottom of the fraction by the same amount, so the probability stays the same.
4
Finding Probability with the Complement
When an event splits into too many separate cases to count one by one, it is faster to count the outcomes outside the event and subtract them from the sample space. Suppose we roll a fair six-sided die 4 times in a row, and we want to find the probability of getting at least one 6:
P(at least one 6)
Finding Probability with the Complement
Text solution
Count all 4-roll sequences in the sample spaceEach of the 4 rolls has 6 possible outcomes.
6×6×6×6=1296
Count the sequences outside the event with zero 6sEach roll must land on 1,2,3,4, or 5, giving 5 options per roll.
5×5×5×5=625
Subtract the outside outcomes from the sample space and divideRemove the 625 sequences with no 6s from the 1296 total sequences.
P(at least one 6)=12961296−625=1296671=1−1296625
5
Overlapping Events and the Limits of Counting
Next, suppose we want the probability that one event or another event happens, where a single outcome can belong to both events at once. If we draw 1 card at random from a standard 52-card deck, we want to find the probability that the card is a Heart or a King:
P(Heart or King)
Overlapping Events and the Limits of Counting
Text solution
Add the two events and subtract their overlapAdding the 13 Hearts and 4 Kings counts the King of Hearts twice, so subtract that 1 shared card once.
13+4−1=16
Divide by the 52 cards in the sample spacePut the 16 winning cards over the 52 equally likely cards in the deck.
P(Heart or King)=5216=134
Subtracting the overlap makes sure every card in the event is counted once.
Any suit row and rank column cross at one shared card, so subtracting that overlap counts every matching card once.
Dividing the two counts works only when every outcome in the sample space S is equally likely. For a bent coin that lands on Heads 70% of the time and Tails 30% of the time, the sample space still has 2 outcomes, but P(Heads) is not 21 because the outcomes do not have equal chances.
Key concepts
To find a probability by counting, first make sure every outcome in the sample space S is equally likely by treating identical-looking items as distinct, and then count the top and bottom using the same rule for order:
P(event)=number of outcomes in Snumber of outcomes in the event
Ordered sequences (`slots`)
When outcomes are built step by step in order, multiply the choices for each slot, such as 5×5×55×4×3 for a 3-digit PIN from {1,2,3,4,5} with no repeats.
Unordered handfuls (`combinations`)
When grabbing a subset all at once, use (kn) on both top and bottom, such as (410)(13)(37) for grabbing 1 broken and 3 working bulbs out of 10.
"At least one" (`complement`)
Instead of splitting into cases for 1,2,3,…, subtract the outcomes with none from the sample space, such as 6464−54 for rolling at least one 6 in 4 rolls.
Event A or Event B (`overlap`)
Add the sizes of both events and subtract the outcomes in both so shared outcomes are counted once, such as 5213+4−1 for drawing a Heart or a King.
When not to just count outcomes
If the individual outcomes have different chances of happening, like a bent coin with 70% Heads and 30% Tails, or summing two dice into the 11 totals 2 through 12, dividing the number of outcomes by the size of the list gives the wrong probability.
6
Practice
1
You roll two fair six-sided dice that look completely identical. What is the probability that the two dice land on different numbers and add up to 8?
Watch out: forgetting to remove (4,4) where both dice land on the same number gives the wrong answer 365, and counting only the unordered pairs {2,6} and {3,5} over the 36 ordered pairs gives 362=181.
Color one die red and one die blue: how many total (Red,Blue) pairs are in the sample space, and which of the pairs that add up to 8 must be left out?
Coloring one die red and one die blue gives 6×6=36 equally likely ordered pairs in the sample space. Five (Red,Blue) pairs add up to 8:
(2,6),(3,5),(4,4),(5,3),(6,2)
(Watch out: forgetting to remove (4,4) where both dice land on the same number gives the wrong answer 365, and counting only the unordered pairs {2,6} and {3,5} over the 36 ordered pairs gives 362=181.) Removing (4,4) leaves 4 winning outcomes:
P(different numbers and sum is 8)=364=91
2
A random 4-letter code is formed using only the 6 letters A, B, C, D, E, and F, with repeated letters allowed. What is the probability that the code starts with a vowel (A or E) and has no repeated letters?
Forbidding repeats on the bottom too would use 6×5×4×3=360 and give the wrong answer 31.Excluding both vowels from the remaining slots would use 2×4×3×2=48 and give 271.
In the sample space on the bottom, any of the 6 letters can fill any of the 4 slots; for the event on top, how many choices do you have for the first slot, and how many letters remain for the second?
In the sample space, repeats are allowed, so there are 6×6×6×6=1296 possible codes (forbidding repeats on the bottom too would use 6×5×4×3=360 and give the wrong answer 31).
For the event, the first slot must be A or E (2 choices). Only the 1 vowel actually placed in the first slot is used up, leaving 5 remaining letters (including the unchosen vowel) for the second slot, 4 for the third, and 3 for the fourth (excluding both vowels from the remaining slots would use 2×4×3×2=48 and give 271):
2×5×4×3=120
P(starts with a vowel and no repeats)=1296120=545
3
A committee of 5 people is chosen at random from a group of 6 engineers and 5 designers. What is the probability that the committee has exactly 3 engineers and 2 designers?
Adding 20+10=30 instead of multiplying gives the wrong answer 46230=775.
How many total people are available to choose the 5-person committee from on the bottom, and how do you combine the choices for the 3 engineers and the 2 designers on top?
There are 6+5=11 people in total, so the sample space has (511) committees of 5:
(511)=5×4×3×2×111×10×9×8×7=462
For the event, choose 3 of the 6 engineers and 2 of the 5 designers, and multiply the two counts by the product rule (adding 20+10=30 instead of multiplying gives the wrong answer 46230=775):
(36)×(25)=20×10=200
P(3 engineers and 2 designers)=462200=231100
4
A drawer holds 8 blue socks and 4 black socks. If you reach in and grab 3 socks at random, what is the probability that you get at least one black sock?
Stopping before subtracting gives 22056=5514, the probability of getting no black socks.
Instead of counting 1,2, or 3 black socks separately, how many handfuls of 3 socks have zero black socks?
There are 8+4=12 socks in total, giving (312) total handfuls in the sample space:
(312)=3×2×112×11×10=220
A handful with zero black socks must be chosen entirely from the 8 blue socks:
(38)=3×2×18×7×6=56
Subtracting those 56 all-blue handfuls from the 220 total handfuls (stopping before subtracting gives 22056=5514, the probability of getting no black socks):
P(at least one black sock)=220220−56=220164=5541
5
One integer is chosen at random from the integers 1 through 60. What is the probability that it is a multiple of 4 or a multiple of 6?
Forgetting to subtract the overlap gives 6025=125.Only subtracting multiples of 4×6=24 leaves out 12,36, and 60 to give 6023.
After counting the multiples of 4 and the multiples of 6, which integers from 1 to 60 got counted in both lists?
Out of the 60 integers in the sample space, there are 460=15 multiples of 4 and 660=10 multiples of 6.
The integers counted in both lists are the common multiples of 4 and 6, which are the multiples of 12(12,24,36,48, and 60), giving 1260=5 overlapping integers (forgetting to subtract the overlap gives 6025=125, and only subtracting multiples of 4×6=24 leaves out 12,36, and 60 to give 6023):
15+10−5=20
P(multiple of 4 or 6)=6020=31
6
A 5-card hand is dealt at random from a standard 52-card deck. What is the probability that the hand contains at least one Spade or at least one Ace?
Forgetting the Ace of Spades overlap subtracts 17 instead of 16 and leaves 35 cards, giving 27302389.
How many single cards in the 52-card deck are neither a Spade nor an Ace, and how many 5-card hands can be dealt using only those cards?
First, count how many cards in the 52-card deck are a Spade or an Ace. With 13 Spades, 4 Aces, and 1 Ace of Spades in both, there are 13+4−1=16 such cards, leaving 52−16=36 cards that are neither a Spade nor an Ace (forgetting the Ace of Spades overlap subtracts 17 instead of 16 and leaves 35 cards, giving 27302389).
There are (552)=2,598,960 total 5-card hands in the sample space, and (536)=376,992 hands with zero Spades and zero Aces. Subtracting the complement from 1:
P(at least one Spade or Ace)=1−(552)(536)=1−2,598,960376,992=1−45566=455389