Counting & Probability

Study Sheet

Counting & Probability

Systematic counting and complements

The Fundamental Principles

Tip
Multiply independent choices

If one choice has mm options and a second, independent choice has nn options, the pair has m⋅nm\cdot n options. Overlapping or exclusive choices are handled by splitting into cases and adding.

In plain terms. When decisions don't affect each other, multiply the number of options. When they can't happen together, add.

Example. A menu with 33 mains and 44 drinks gives 3⋅4=123\cdot 4 = 12 meals.

Why multiply: draw the choices as a tree. The first decision makes mm branches, and each of them splits into the same nn branches for the second decision, so the tree ends in mm groups of nn leaves — m⋅nm\cdot n outcomes. The word that matters is "same": if the number of second options depends on the first choice, split into cases and add instead.

Tip
Permutations vs. combinations

Ordered picks of kk from nn: nPk=n!(n−k)!{}_nP_k = \dfrac{n!}{(n-k)!}. Unordered picks: (nk)=n!k!(n−k)!\dbinom nk = \dfrac{n!}{k!(n-k)!}.

In plain terms. If rearranging counts as different, use permutations; if it does not, use combinations. The only difference is dividing out the k!k! orderings.

Example. Seat 33 of 88 in a row (order matters): 8P3=8⋅7⋅6=336{}_8P_3 = 8\cdot 7\cdot 6 = 336. Choose a committee of 33 (order doesn't): (83)=56\dbinom 83 = 56.

Example
Worked: outfits
red shirtjeanskhakisshortsblue shirtjeanskhakisshorts6 outfits
Two first branches, each splitting into the same three: six leaves.

Two shirts (red, blue) and three pairs of pants (jeans, khakis, shorts). How many outfits of one shirt and one pair of pants?

Step 1 — choose the shirt: 22 ways.

Step 2 — for each shirt, choose pants: 33 ways, the same three whichever shirt was chosen.

Step 3 — 2⋅3=62\cdot3 = 6 outfits, one for each leaf of the tree.

Example
Worked: codes

A code is two different letters followed by three digits, where the first digit is not 00. How many codes are there?

Step 1 — fill the positions in order and count the options at each: first letter 2626; second letter 2525 (different from the first); first digit 99 (not 00); then 1010 and 1010.

Step 2 — the number of options at each position does not depend on which earlier choices were made, so multiply: 26⋅25⋅9⋅10⋅10=58500026\cdot25\cdot9\cdot10\cdot10 = 585000.

Example
Worked: two who sit together

Five people sit in a row. In how many orders do Ana and Ben sit next to each other?

Step 1 — glue Ana and Ben into one block. Now there are 44 units to arrange: 4!=244! = 24 orders.

Step 2 — inside the block they can sit as Ana–Ben or Ben–Ana: 22 ways.

Step 3 — 24⋅2=4824\cdot2 = 48. (Out of 5!=1205! = 120 orders in all.)

Side note
Where it goes wrong

Using combinations when order matters. Choosing a president and a vice-president from 1010 people is 10⋅9=9010\cdot9 = 90, not (102)=45\binom{10}{2} = 45: Ana-president-Ben-vice and Ben-president-Ana-vice are different outcomes. Ask: "if I swap two chosen items, is it a different result?"

Try it
Try it: officers and a committee

A club of 77 members chooses a president, then a secretary, then a 22-person committee from the remaining members. In how many ways?

Show the answer

President 77, secretary 66 (order matters: different jobs). The committee is 22 of the remaining 55, unordered: (52)=10\binom52 = 10. Total 7⋅6⋅10=4207\cdot6\cdot10 = \mathbf{420}.

Complementary Counting and Probability

Tip
Count the opposite

For "at least one," compute (total) −- (ways it fails). The complement usually avoids messy casework.

In plain terms. Counting what you don't want and subtracting is often far easier than counting what you do want.

Example. Probability of at least one head in 44 flips: the only failure is all tails, (12)4=116\left(\tfrac12\right)^4 = \tfrac1{16}, so the answer is 1−116=15161 - \tfrac1{16} = \tfrac{15}{16}.

Why it works: every outcome either has the property or does not, never both, so (with) ++ (without) == (total). When "with" splits into many cases — at least one, some, not all — "without" is often a single product, because it is a condition on every item at once: "no heads" means "every flip is tails".

Concept
Probability is a ratio of counts

For equally likely outcomes, P(event)=favorabletotalP(\text{event}) = \dfrac{\text{favorable}}{\text{total}}.

In plain terms. Probability is just "good outcomes over all outcomes" — so counting carefully is the whole task.

Example. Rolling a sum of 77 with two dice: 66 favorable pairs out of 3636, so P=636=16P = \tfrac{6}{36} = \tfrac16.

Example
Worked: not blue

A bag holds 33 red, 55 blue and 22 green marbles. One is drawn at random. What is the probability it is not blue?

Step 1 — 1010 equally likely marbles, 55 of them blue: P(blue)=510P(\text{blue}) = \tfrac{5}{10}.

Step 2 — complement: P(not blue)=1−510=12P(\text{not blue}) = 1 - \tfrac{5}{10} = \tfrac12. (Counting directly, 3+2=53 + 2 = 5 of 1010, agrees.)

Example
Worked: an even product
112233445566shaded: product odd(both dice odd)9 of 36 cellsfirstsecond die
The complement is the small shaded block: both dice odd.

Two fair dice are rolled. What is the probability that the product of the numbers is even?

Step 1 — "even product" happens in many ways; its complement is simple: the product is odd only when BOTH dice are odd.

Step 2 — each die is odd in 33 of 66 ways, so odd products fill 3⋅3=93\cdot3 = 9 of the 3636 cells.

Step 3 — P(even)=1−936=2736=34P(\text{even}) = 1 - \tfrac{9}{36} = \tfrac{27}{36} = \tfrac34.

Example
Worked: a shared choice

Three friends each pick a whole number from 11 to 55 at random. What is the probability that at least two pick the same number?

Step 1 — total outcomes 53=1255^3 = 125.

Step 2 — complement: all three different, 5⋅4⋅3=605\cdot4\cdot3 = 60 ways.

Step 3 — P(some repeat)=1−60125=65125=1325P(\text{some repeat}) = 1 - \tfrac{60}{125} = \tfrac{65}{125} = \tfrac{13}{25}. The direct count would need separate cases for "exactly two match" and "all three match".

Side note
Where it goes wrong

Adding probabilities of events that can happen together. "At least one six in two rolls is 16+16=13\tfrac16 + \tfrac16 = \tfrac13" counts the roll (6,6)(6, 6) twice. The complement gives 1−(56)2=11361 - \left(\tfrac56\right)^2 = \tfrac{11}{36}, a little less than 1236\tfrac{12}{36} — the difference is exactly that double-counted roll.

Try it
Try it: at least one six

A fair die is rolled three times. What is the probability that at least one roll is a 66?

Show the answer

Complement: no sixes, (56)3=125216\left(\tfrac56\right)^3 = \tfrac{125}{216}. So P=1−125216=91216P = 1 - \tfrac{125}{216} = \mathbf{\tfrac{91}{216}}.

Casework Without Double Counting

Tip
Split into cases that cannot overlap

Choose a feature that every arrangement has exactly one value of (the largest element, the position of a special item, the number of red balls). Count each case, then add.

The discipline is in the words "exactly one": if a case boundary lets an object appear twice, the sum is wrong, and if it misses an object the sum is short. A good test is to name the case an example belongs to before adding anything — if the answer is "both" or "neither", the split is broken and needs redrawing, not patching.

Tip
Complementary counting

Count the opposite and subtract from the total: #(at least one)=total−#(none)\#(\text{at least one}) = \text{total} - \#(\text{none}).

Probability that two dice show at least one 66: total 3636, none-a-six 5⋅5=255\cdot5 = 25, so 11/3611/36. The phrase "at least" is the signal — direct counting there needs cases for exactly one and exactly two, while the complement needs one product. The same move handles "at least one repeat" (birthday-style) and "not all the same".

Example
Worked: three-digit numbers with a repeated digit

How many three-digit numbers have at least two digits the same?

Step 1 — total three-digit numbers: 900900 (from 100100 to 999999).

Step 2 — count those with ALL DIGITS DIFFERENT: 99 choices for the hundreds digit (not 00), 99 for the tens (any digit except the first), 88 for the units: 9⋅9⋅8=6489\cdot9\cdot8 = 648.

Step 3 — subtract: 900−648=252900 - 648 = 252. Counting the repeats directly would need three overlapping cases; the complement needs none.

Example
Worked: digits that add to 5

How many three-digit numbers have digits whose sum is 55?

Step 1 — split on the hundreds digit hh, which is 11 to 55 (not 00); every number is in exactly one case.

Step 2 — for each hh, the tens and units digits add to 5−h5 - h, and a sum of ss can be made in s+1s + 1 ways (0+s,1+(s−1),…0 + s, 1 + (s - 1), \ldots).

Step 3 — h=1,2,3,4,5h = 1, 2, 3, 4, 5 give 5,4,3,2,15, 4, 3, 2, 1 numbers. Total 1515.

Side note
When casework beats the complement

If the condition is a small number of very different situations ("the digit sum is 77", "the path turns exactly twice"), casework is clearer. If the condition contains "at least", "some" or "not all", reach for the complement first.

Try it
Try it: at least one head

Four fair coins are flipped. What is the probability of at least one head?

Show the answer

Complement: all tails has probability (12)4=116\left(\tfrac12\right)^4 = \tfrac1{16}, so at least one head has probability 1−116=15161 - \tfrac1{16} = \tfrac{15}{16}.

Probability With Tables and Trees

Concept
Multiply along a branch, add across branches

For two-stage experiments, make the sample space visible. A table lists every pair when the two stages are independent (two dice, two spinners). A tree handles stages that depend on each other: the probability of a path is the PRODUCT of the probabilities on its branches, and the probability of an event is the SUM over the paths that make it happen.

Multiplying along a branch is the product rule from counting in disguise: of all the equally likely ways the experiment can go, a fraction 35\tfrac35 start with red, and of those, a fraction 24\tfrac24 continue with red, so 35⋅24\tfrac35\cdot\tfrac24 of all the ways do both. Adding across branches is allowed because different paths are different outcomes — they never overlap.

Example
Worked: two spinners
+1231234234534564567
Twelve equally likely cells; the shaded ones sum to 55.

Spinner A shows 11, 22 or 33 and spinner B shows 11, 22, 33 or 44, each value equally likely. What is the probability the sum is 55?

Step 1 — the table has 3⋅4=123\cdot4 = 12 equally likely cells.

Step 2 — the sum 55 appears as 1+41 + 4, 2+32 + 3, 3+23 + 2: three cells.

Step 3 — P=312=14P = \tfrac{3}{12} = \tfrac14.

Example
Worked: drawing without replacement
R3/5R2/46/20B2/46/20B2/5R3/46/20B1/42/20
The second-draw probabilities depend on the first draw; multiply along each path.

A bag holds 33 red and 22 blue marbles. Two are drawn without replacement. What is the probability they are the same color?

Step 1 — first draw: red 35\tfrac35, blue 25\tfrac25.

Step 2 — the bag now has 44 marbles: after a red, 22 red and 22 blue remain; after a blue, 33 red and 11 blue.

Step 3 — both red: 35⋅24=620\tfrac35\cdot\tfrac24 = \tfrac{6}{20}; both blue: 25⋅14=220\tfrac25\cdot\tfrac14 = \tfrac{2}{20}.

Step 4 — add: 820=25\tfrac{8}{20} = \tfrac25.

Example
Worked: first head wins

Amy and Bo take turns flipping a fair coin, Amy first. The first to flip heads wins. What is the probability that Amy wins?

Step 1 — Amy wins at once with probability 12\tfrac12.

Step 2 — otherwise both flip tails (probability 12⋅12=14\tfrac12\cdot\tfrac12 = \tfrac14) and the game is back where it started, with Amy to flip.

Step 3 — so her winning probability PP satisfies P=12+14PP = \tfrac12 + \tfrac14P, giving 34P=12\tfrac34P = \tfrac12 and P=23P = \tfrac23. Going first is worth twice as much as going second.

Side note
Where it goes wrong

Treating draws without replacement as independent. (35)2+(25)2=1325\left(\tfrac35\right)^2 + \left(\tfrac25\right)^2 = \tfrac{13}{25} is the answer for drawing WITH replacement; after one red is gone, the chance of a second red is 24\tfrac24, not 35\tfrac35.

Try it
Try it: two cards

Two different cards are drawn at random from seven cards numbered 11 to 77. What is the probability that their sum is even?

Show the answer

An even sum needs two odds or two evens. There are 44 odd cards and 33 even cards. Pairs: (42)=6\binom42 = 6 odd–odd and (32)=3\binom32 = 3 even–even, out of (72)=21\binom72 = 21. P=921=37P = \tfrac{9}{21} = \mathbf{\tfrac37}.

Putting It Together

Example
Worked: a repeated digit in a PIN

A four-digit PIN uses the digits 00–99, repeats allowed. How many PINs have at least one repeated digit, and what is the probability that a random PIN does?

Step 1 — "at least one repeat" is the complement signal.

Step 2 — total 104=1000010^4 = 10000; all different 10⋅9⋅8⋅7=504010\cdot9\cdot8\cdot7 = 5040.

Step 3 — with a repeat: 10000−5040=496010000 - 5040 = 4960.

Step 4 — probability 496010000=62125\tfrac{4960}{10000} = \tfrac{62}{125}, just under a half.

Tip
Choosing the method

Independent stages: multiply. Order matters: permutations; order does not: divide by the orders. "At least", "some", "not all": complement. Stages that depend on each other: a tree. Small, lopsided conditions: casework on one feature. Whatever the method, check against a tiny case you can list.

Try it
Try it: the math book

Four different books are placed on a shelf. In how many orders is the math book not at either end?

Show the answer

Directly: the math book takes one of the 22 middle spots, and the other three books fill the rest in 3!=63! = 6 ways: 2⋅6=122\cdot6 = \mathbf{12}. By complement: 4!=244! = 24 orders, of which 2⋅6=122\cdot6 = 12 have the math book at an end; 24−12=1224 - 12 = 12.