James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA HL › Topic 1: Number & algebra › Counting principles

Counting principles: permutations & combinations

How to count arrangements and selections without listing them: the product and sum rules, permutations, combinations, repeated objects and, most importantly, how to handle restrictions.

AHL 1.10HL onlyPaper 1Paper 2≈ 100 min to work through
Before you start: factorials and nCr. See Binomial theorem. The probability links use Probability.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Use the product rule ("and") and the sum rule ("or") to count outcomesAHL 1.10
  • Decide whether order matters, and choose permutations or combinationsAHL 1.10
  • Count arrangements with restrictions: together, apart, fixed positionsAHL 1.10
  • Count arrangements of objects that are not all differentAHL 1.10
  • Count selections with conditions, including "at least", by cases or the complementAHL 1.10
  • Use counting to find probabilitiesAHL 1.10, SL 4.5

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

Counting questions ask "how many ways?" without listing every possibility. Almost every question is built from two decisions: does order matter? (an arrangement or a selection) and are there restrictions? (some people together, some apart, at least one of something). Get those two decisions right and the calculation is usually short.

2.1 The product rule and the sum rule

Suppose a café offers 3 starters and 4 main courses. A meal is a starter and a main course. For each of the 3 starters there are 4 mains, so there are 3×4=12 meals. This is the product rule: if one choice can be made in m ways and, for each of these, a second choice can be made in n ways, the two choices together can be made in m×n ways.

If instead you choose a starter or a main course (but not both), there are 3+4=7 options. This is the sum rule: when the options cannot happen together, add them.

The two rules

And (one choice after another) ⇒ multiply.    Or (separate, non-overlapping cases) ⇒ add.

Worked example 1Paper 1
A PIN code has 4 digits, each from 0 to 9. How many PIN codes are there (a) if digits may repeat (b) if all four digits are different?
(a) Each of the 4 positions has 10 choices: 10×10×10×10=10000.
Repeats allowed: the number of choices stays the same at each step.
(b) 10×9×8×7=5040.
No repeats: one fewer choice at each step, because a digit used cannot be used again.

Drawing "slots" helps: draw one box per position, write the number of choices in each box, then multiply. Fill the most restricted box first.

2.2 Permutations: when order matters

The number of ways to arrange n different objects in a row is n!=n×(n−1)×…×2×1: there are n choices for the first place, n−1 for the second, and so on. If only r of the n objects are placed in order, you stop after r factors.

Permutations (in formula booklet) In formula booklet
nPr=n!(n−r)!=n(n−1)(n−2)⋯(n−r+1)(r factors)
Worked example 2Paper 1
Eight runners race. In how many ways can gold, silver and bronze be awarded?
Order matters: gold, silver, bronze are different prizes.
Swapping two winners gives a different result, so this is a permutation.
8P3=8×7×6=336.

2.3 Combinations: when order does not matter

Choosing a committee of 3 people from 8 is different: the committee {Ana, Ben, Cai} is the same however you list it. Each committee of 3 has been counted 3!=6 times among the 8P3=336 ordered lists, so there are 336÷6=56 committees.

Combinations (in formula booklet) In formula booklet
nCr=(nr)=n!r!(n−r)!=nPrr!
Why divide by r!?

To make an ordered list of r objects from n, you can first choose which r objects (nCr ways) and then arrange them (r! ways). By the product rule, nPr=nCr×r!, which rearranges to the formula. This is also why nCr=nCn−r: choosing the r people who are in the committee is the same as choosing the n−r who are left out.

Does order matter? A quick test

Imagine swapping two of the chosen items. If that gives a different outcome (different seats, different prizes, a different code), order matters: use permutations. If it gives the same outcome (the same team, the same hand of cards, the same set of toppings), order does not matter: use combinations.

Worked example 3Paper 1
From 10 students, find the number of ways to choose (a) a team of 4 (b) a captain, vice-captain and two other team members.
(a) Order does not matter: (104)=210.
(b) Choose the captain (10), then the vice-captain (9), then 2 others from the remaining 8: 10×9×(82)=90×28=2520.
A mix: the two named roles are ordered, the other two places are not.

2.4 Restrictions: together, apart and fixed positions

This is where questions become varied. There are three standard techniques, and the golden rule is to deal with the restriction first.

  • Fixed positions (someone must sit at the end, a code must start with a vowel): fill the restricted slots first, then arrange everyone else.
  • Must be together: glue the group into one "block". Arrange the block with the other objects, then multiply by the number of ways to arrange the objects inside the block.
  • Must not be together: count all arrangements and subtract those where they are together (the complement). For several objects that must all be separated, use the gaps method instead: arrange the others first, then place the separated objects in the gaps.
Worked example 4Paper 1
The letters of the word NUMBERS are arranged in a row. Find the number of arrangements (a) in total (b) that begin and end with a vowel (c) with the two vowels next to each other (d) with the two vowels not next to each other.
(a) 7 different letters: 7!=5040.
(b) The vowels are U and E. End slots: 2×1 ways; the middle 5 letters: 5!. Total 2×120=240.
Restricted slots first: the first and last letters.
(c) Glue UE into one block: 6 objects, 6!=720 arrangements; the block can be UE or EU, so 720×2=1440.
Do not forget the arrangements inside the block.
(d) 5040−1440=3600.
Complement: "not together" = total − together.
Worked example 5Paper 2
Four boys and three girls stand in a row. Find the number of arrangements in which no two girls stand next to each other.
Arrange the 4 boys: 4!=24 ways. This creates 5 gaps (▢): ▢ B ▢ B ▢ B ▢ B ▢.
Gaps include the two ends.
Place the 3 girls in 3 different gaps, in order: 5P3=60 ways.
Each gap takes at most one girl, so no two girls can be adjacent.
Total 24×60=1440.
When to use the gaps method

"Total minus together" only works neatly when there is one pair to keep apart. With three girls, "not together" could mean no two adjacent, or not all three in a block, and subtracting gets complicated. The gaps method builds the separation in from the start, so it never double counts.

2.5 Objects that are not all different

If some objects are identical, swapping them does not create a new arrangement. The letters of BOOK can be arranged in 4!=24 ways if the two Os are labelled O1,O2, but each real arrangement is counted twice (O1O2 and O2O1), so there are 24÷2=12.

Arrangements with repeats Not in booklet: learn it
n!a!b!c!⋯where a,b,c,… are the numbers of each repeated object
Worked example 6Paper 1
Find the number of arrangements of the letters of STATISTICS.
10 letters: S appears 3 times, T 3 times, I twice, A and C once.
10!3!3!2!=362880072=50400.

2.6 Selections with conditions

For selections, conditions such as "at least 2 women" are handled in one of two ways. Either split into separate cases and add (the sum rule), or count everything and subtract the cases you do not want (the complement). Use whichever has fewer cases.

Worked example 7Paper 2
A committee of 5 is chosen from 6 men and 4 women. How many committees contain at least 2 women?
By cases. 2 women: (42(63=))6×20=120. 3 women: (43(62=))4×15=60. 4 women: (44(61=))6.
Women and men are chosen independently, so multiply within each case.
Total: 120+60+6=186.
Check by complement. All committees: (105)=252. Subtract 0 women ((65=)6) and 1 woman ((41(64=))60): 252−66=186. ✓
Two methods giving the same answer is the best check there is.
The most common trap: double counting

A tempting shortcut for "at least one woman" is: choose one woman (4 ways), then choose the other 4 members from the remaining 9 people. That gives 4×(94=)504, which is too big. A committee with two women, say Ana and Bea, is counted twice: once with Ana as "the chosen woman" and once with Bea. Whenever a method picks out "a special one" that is not really special, check for double counting.

Worked example 8Paper 1
In how many ways can 9 people be split into three groups of 3?
Choose the first group, then the second, then the last: (93(63(33=)))84×20×1=1680.
The groups are not labelled, so the same split has been counted once for each order of the 3 groups: divide by 3!.
If the groups were labelled (Team Red, Team Blue, Team Green), you would not divide.
1680÷6=280.

2.7 Counting and probability

When all outcomes are equally likely, a probability is a count divided by a count: P(A)=number of outcomes in Atotal number of outcomes. Use the same method (ordered or unordered) for the top and the bottom.

Worked example 9Paper 2
Three cards are taken at random from 10 cards, of which 4 are red. Find the probability that exactly 2 are red.
Total selections: (103)=120.
Favourable: 2 red from 4 and 1 non-red from 6: (42(61=))36.
P=36120=0.3.
Worked example 10 (faded)Paper 1
Check the link between permutations and combinations for n=7, r=3.
(73=) 35  ← you work this out
(73×)3!= 210=7P3=7×6×5. ✓  ← you work this out
Which method? A checklist for any counting question
  1. Does order matter? (arrangement or selection)
  2. Are any objects identical? (divide by the repeats)
  3. Is there a fixed position? (fill it first)
  4. Must some objects be together? (block, then arrange inside)
  5. Must some be apart? (complement for one pair, gaps for several)
  6. Is it "at least" or "at most"? (cases, or the complement)
  7. Are groups unlabelled? (divide by the number of ways to order the groups)
On your TI-Nspire Calculator tricks →

On a Calculator page: menu → 5: Probability → 1: Factorial, 2: Permutations (nPr(8,3) gives 336) and 3: Combinations (nCr(10,4) gives 210). For a question split into cases, type the whole sum in one line, e.g. nCr(4,2)*nCr(6,3)+nCr(4,3)*nCr(6,2)+nCr(6,1).

3Explore it

The bars show (nr) for every r (a row of Pascal’s triangle). Change n and r to compare permutations and combinations.

4Common mistakes & exam tips

Common mistakes

  • Using combinations when order matters (prizes, seats, codes), or permutations when it does not (teams, hands of cards).
  • Adding when the choices happen together ("and"), or multiplying separate cases ("or").
  • Forgetting to arrange the objects inside a block when some must be together.
  • Double counting in "at least one" questions by choosing "a special one" first.
  • Forgetting to divide by repeats (identical letters) or by the order of unlabelled groups.

Exam tips

  • Always decide "does order matter?" first, and write it down.
  • Fill restricted positions first; draw slots and write the number of choices in each.
  • For "not together", use total − together for one pair, and the gaps method for several objects.
  • Check a counting answer with a second method, or with a small case you can list by hand.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
In how many ways can 7 different books be arranged on a shelf?
7!=5040
FluencyP2
How many 3-letter codes can be made from the 26 letters if no letter is repeated?
26×25×24=15600
FluencyP3
A pizza has 3 toppings chosen from 9. How many different pizzas are possible?
(93=)84
FluencyP4
Find the number of arrangements of the letters of BANANA.
6!3!2!=60
Problem solvingP5
A team of 4 is chosen from 5 boys and 6 girls. How many teams have more girls than boys?
4 girls: (64=)15; 3 girls, 1 boy: (63×)5=100. Total 115.
Problem solvingP6
How many even 4-digit numbers can be made from the digits 1, 2, 3, 4, 5, 6 if no digit is repeated?
Last digit first (2, 4 or 6): 3 ways; then 5×4×3. Total 180.
Problem solvingP7
A committee of 4 is chosen from 5 men and 5 women. Find the number with at least one woman, and explain why 5×(93=)420 is wrong.
(104)−(54=)210−5=205. The 420 counts committees with several women more than once.

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[6 marks]

The letters of the word EXAMINE are to be arranged in a row.

  • (a)Find the number of different arrangements.[2]
  • (b)Find the number of arrangements in which the two Es are next to each other.[2]
  • (c)Find the number of arrangements in which the two Es are not next to each other.[2]
(a)
7!2!M1
2520A1
(b)
treat EE as one block: 6!M1
720A1
No ×2: the Es are identical.
(c)
2520−720M1
1800A1
Question 2Paper 2[7 marks]

A club has 7 boys and 5 girls. A committee of 6 members is to be chosen.

  • (a)Find the number of possible committees.[1]
  • (b)Find the number of committees with exactly 2 girls.[2]
  • (c)Find the number of committees with at least one girl.[2]
  • (d)The committee is chosen at random. Find the probability that it contains exactly 2 girls.[2]
(a)
(126)=924A1
(b)
(52(74))M1
350A1
(c)
924−(76)M1
917A1
(d)
350924M1
2566 (0.379)A1
Question 3Paper 1[7 marks]

Eight people, including Alex, Bea and Chen, sit in a row of 8 seats.

  • (a)Find the number of possible seating arrangements.[1]
  • (b)Find the number of arrangements in which Alex and Bea sit next to each other.[2]
  • (c)Find the number of arrangements in which Chen sits in one of the end seats and Alex and Bea do not sit next to each other.[4]
(a)
8!=40320A1
(b)
7!×2M1
10080A1
(c)
Chen at an end: 2 waysA1
remaining 7 seats: 7!−6!×2M1
=3600A1
2×3600=7200A1
Question 4Paper 1[6 marks]

Twelve students are to be divided into groups for a project.

  • (a)Find the number of ways to divide them into a group of 5 and a group of 7.[2]
  • (b)Find the number of ways to divide them into three groups of 4.[4]
(a)
(125)M1
792A1
(b)
(124)(84(44))M1
=34650A1
divide by 3! as the groups are unlabelledM1
5775A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
May 2021 · TZ1 · Paper 1Q9Arrangements in a grid with restrictions★★★
May 2022 · TZ1 · Paper 2Q9Seating in a row with conditions★★☆
May 2024 · TZ1 · Paper 2Q9Choosing groups with siblings kept apart or together★★★
May 2024 · TZ2 · Paper 1Q9Assigning students to groups★★★
May 2025 · TZ2 · Paper 2Q11Dividing a class into equal teams★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake