Permutations

AS · S1 · 18 min

A permutation is an arrangement of objects in which the order matters. Counting arrangements quickly, without listing them, is the skill behind this topic: how many ways can seven people stand in a queue, how many different "words" can be made from the letters of NEEDLESS, how many four-digit codes are even. Paper 5 usually has one full question on permutations and combinations, worth around eight marks, built from exactly the situations in the syllabus: arrangements in a line, arrangements with repeated objects, arrangements with restrictions (two people together or apart, fixed ends), and people seated in rows. Circular arrangements are not examined.

The multiplication principle

Everything in this topic rests on one idea.

Key result

If one choice can be made in mm ways, and for each of those a second choice can be made in nn ways, then the two choices together can be made in m×nm \times n ways. This extends to any number of successive choices.

Think of filling boxes, one per position. To arrange the letters A, B, C, D in a line: the first position can be filled in 44 ways, the second in 33 (one letter has been used), the third in 22, the last in 11. That gives 4×3×2×1=244 \times 3 \times 2 \times 1 = 24 arrangements.

Position1st2nd3rd4th
Choices44332211

The product n×(n−1)×⋯×2×1n \times (n - 1) \times \cdots \times 2 \times 1 is written n!n!, read "nn factorial". By definition 0!=10! = 1, which makes the formulas below work in every case.

Key result

The number of ways of arranging nn different objects in a line is

n!=n×(n−1)×(n−2)×⋯×2×1.n! = n \times (n - 1) \times (n - 2) \times \cdots \times 2 \times 1.

Factorials grow very fast: 5!=1205! = 120, 8!=403208! = 40320, 10!=362880010! = 3628800. That is why listing is hopeless and counting methods are needed.

Arranging some of the objects

Often only some of the objects are used. A club of 1010 members chooses a president, a secretary and a treasurer: the order matters (being president is different from being treasurer), and only 33 of the 1010 are placed. Filling three boxes gives 10×9×8=72010 \times 9 \times 8 = 720.

Definition

A permutation of rr objects from nn different objects is an ordered arrangement of rr of them. The number of such permutations is written nPr{}^{n}P_{r}:

nPr=n(n−1)(n−2)⋯(n−r+1)=n!(n−r)!.{}^{n}P_{r} = n(n - 1)(n - 2)\cdots(n - r + 1) = \frac{n!}{(n - r)!}.

Check: 10P3=10!7!=10×9×8=720{}^{10}P_{3} = \dfrac{10!}{7!} = 10 \times 9 \times 8 = 720. And nPn=n!0!=n!{}^{n}P_{n} = \dfrac{n!}{0!} = n!, the full arrangement. Your calculator has an nPr{}^{n}P_{r} key.

Repeated objects

The word NEEDLESS has 88 letters, but three are E and two are S, so many of the 8!8! orderings look identical. If the three Es were labelled E1,E2,E3E_1, E_2, E_3, each visible arrangement would appear 3!=63! = 6 times (once for each way of ordering the labels). Likewise, each would appear 2!2! times because of the Ss. So the 8!8! labelled arrangements overcount every real arrangement by a factor of 3!×2!3! \times 2!.

Key result

The number of arrangements of nn objects, of which pp are alike of one kind, qq alike of another kind, rr alike of another, and so on, is

n!p! q! r!⋯.\frac{n!}{p!\, q!\, r! \cdots}.

NEEDLESS: 8!3! 2!=4032012=3360\dfrac{8!}{3!\,2!} = \dfrac{40320}{12} = 3360 arrangements. Letters that appear once contribute 1!=11! = 1 and can be ignored in the denominator.

Restrictions

Most marks are for arrangements with conditions. There are a few standard techniques; the art is recognising which one a question needs.

Fixed positions: deal with them first

If a position is restricted (the arrangement must start with a vowel, end with S, the number must be even), fill the restricted positions first, then arrange the rest freely.

Seven different letters C, A, M, B, R, I, D: arrangements beginning with C and ending with D. Fix C and D, then arrange the middle 55 letters: 5!=1205! = 120.

Objects that must be together: glue them

Treat the objects that must be together as a single block. Arrange the block with the other objects, then multiply by the number of ways of arranging the objects inside the block.

Seven people including Ali and Bea stand in a line, with Ali and Bea next to each other. Glue them into one block: there are now 66 items to arrange, in 6!6! ways, and the block can be "Ali Bea" or "Bea Ali", 2!2! ways. Total: 6!×2!=14406! \times 2! = 1440.

Objects that must not be together: subtract, or use gaps

For two objects that must not be next to each other, the quickest method is

not together=total−together.\text{not together} = \text{total} - \text{together}.

For the seven people: 7!−1440=5040−1440=36007! - 1440 = 5040 - 1440 = 3600.

For three or more objects with no two of them adjacent, subtraction becomes complicated (there are several ways to be "together"). Use the gaps method instead: arrange the unrestricted objects first, then place the restricted objects in the gaps between and at the ends, at most one per gap.

Method

The gaps method (no two of kk particular objects adjacent)

  1. Arrange the other mm objects: count the ways.
  2. These create m+1m + 1 gaps (one before each object and one at the end): _ O _ O _ ⋯ _ O _\_\, \text{O} \,\_\, \text{O} \,\_\, \cdots \,\_\, \text{O} \,\_.
  3. Place the kk restricted objects into kk different gaps. If they are all different, this can be done in m+1Pk{}^{m+1}P_{k} ways.
  4. Multiply.

Seven people with Ali, Bea and Cal no two adjacent: arrange the other 44 in 4!=244! = 24 ways, which leaves 55 gaps. Put Ali, Bea and Cal in 33 of these gaps in 5P3=60{}^{5}P_{3} = 60 ways. Total: 24×60=144024 \times 60 = 1440.

Rows of seats

People seated in two rows are arrangements with fixed positions. Number every seat. If certain people must sit in a certain row, place them in that row first, then arrange everyone else in the remaining seats. Seats in different rows are different positions, so "front row" and "back row" are just restrictions on which positions are allowed.

Method

For any arrangement question

  1. Decide what is being arranged and whether the objects are all different.
  2. Deal with the restricted items first: fixed positions, blocks that must be together, items that must be separated (gaps).
  3. Multiply the number of ways at each stage. Divide by p! q!⋯p!\,q!\cdots for any repeated objects that remain.
  4. Sanity-check: the restricted count must be smaller than the unrestricted total, and complementary cases must add up to the total.

Permutations and probability

If all arrangements are equally likely (the letters are "arranged at random"), a probability is a ratio of counts:

P(event)=number of arrangements with the propertytotal number of arrangements.P(\text{event}) = \frac{\text{number of arrangements with the property}}{\text{total number of arrangements}}.

For NEEDLESS arranged at random, the probability the arrangement starts with E: fix an E at the front, then arrange the other 77 letters (two Es and two Ss among them) in 7!2! 2!=1260\dfrac{7!}{2!\,2!} = 1260 ways. So the probability is 12603360=38\dfrac{1260}{3360} = \dfrac{3}{8}, which agrees with the direct argument that 33 of the 88 letters are E.

Worked examples

Arrangements and fixed ends (routine)

Find the number of different arrangements of the 99 letters of the word CAMBRIDGE.

(a) in total, (b) that begin with C and end with E, (c) in which the three vowels A, I, E are together.

Solution

All 99 letters are different.

(a) 9!=3628809! = 362880.

(b) Fix C first and E last; arrange the other 77 letters: 7!=50407! = 5040.

(c) Glue A, I, E into one block. Arrange the block with the 66 consonants: 7!7! ways. Arrange the vowels inside the block: 3!3! ways. Total 7!×3!=5040×6=302407! \times 3! = 5040 \times 6 = 30240.

Repeated letters with conditions

Find the number of different arrangements of the 88 letters of NEEDLESS

(a) in total, (b) in which the three Es are together, (c) in which the two Ss are not next to each other.

Solution

NEEDLESS: N, E, E, E, D, L, S, S (three Es, two Ss).

(a) 8!3! 2!=3360\dfrac{8!}{3!\,2!} = 3360.

(b) Treat EEE as one block. Items: [EEE], N, D, L, S, S, that is 66 items with two Ss alike. The Es inside the block are identical, so there is only 11 internal arrangement. Total 6!2!=360\dfrac{6!}{2!} = 360.

(c) First count arrangements with the Ss together: block [SS] with N, E, E, E, D, L is 77 items with three Es alike: 7!3!=840\dfrac{7!}{3!} = 840. So Ss not together =3360−840=2520= 3360 - 840 = 2520.

People standing in a line

Seven people, including Ali, Bea and Cal, stand in a line. Find the number of arrangements in which

(a) Ali and Bea stand next to each other,

(b) Ali and Bea do not stand next to each other,

(c) no two of Ali, Bea and Cal stand next to each other.

Solution

(a) Block [Ali Bea] plus 55 others: 6!6! arrangements, times 2!2! for the order inside the block: 720×2=1440720 \times 2 = 1440.

(b) Total 7!=50407! = 5040, so 5040−1440=36005040 - 1440 = 3600.

(c) Gaps method. Arrange the other 44 people: 4!=244! = 24 ways. This gives 55 gaps: _ P _ P _ P _ P _\_\,P\,\_\,P\,\_\,P\,\_\,P\,\_. Place Ali, Bea and Cal in 33 different gaps: 5P3=5×4×3=60{}^{5}P_{3} = 5 \times 4 \times 3 = 60 ways. Total 24×60=144024 \times 60 = 1440.

Forming numbers from digits

Four-digit numbers are formed from the digits 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7, with no digit repeated. Find how many of these numbers are

(a) possible in total, (b) even, (c) greater than 50005000, (d) even and greater than 50005000.

Solution

(a) 7P4=7×6×5×4=840{}^{7}P_{4} = 7 \times 6 \times 5 \times 4 = 840.

(b) The last digit must be 22, 44 or 66: 33 ways. The first three digits are then chosen in order from the remaining 66: 6P3=120{}^{6}P_{3} = 120. Total 3×120=3603 \times 120 = 360.

(c) The first digit must be 55, 66 or 77: 33 ways, then 6P3=120{}^{6}P_{3} = 120. Total 360360.

(d) Both the first and last digits are restricted, and they interact: whether the first digit is even affects how many even digits are left for the end. Split into cases.

  • First digit 55 or 77 (odd): 22 ways; last digit 22, 44 or 66: 33 ways; middle two from the remaining 55: 5×4=205 \times 4 = 20. Subtotal 2×3×20=1202 \times 3 \times 20 = 120.
  • First digit 66: 11 way; last digit 22 or 44: 22 ways; middle two: 2020. Subtotal 4040.

Total 120+40=160120 + 40 = 160.

Seating in two rows (exam style)

A family of 33 adults and 55 children sit for a photograph in two rows of 44 seats, one row behind the other. Find the number of ways they can be arranged if

(a) there are no restrictions,

(b) all 33 adults sit in the back row,

(c) all 33 adults sit in the back row and two particular children, Dan and Eve, sit next to each other in the front row.

Solution

(a) 88 people in 88 different seats: 8!=403208! = 40320.

(b) Place the adults in 33 of the 44 back-row seats: 4P3=24{}^{4}P_{3} = 24 ways. The 55 children fill the remaining 55 seats: 5!=1205! = 120 ways. Total 24×120=288024 \times 120 = 2880.

(c) Adults in the back row: 2424 ways, as before. In the front row of 44 seats there are 33 pairs of adjacent seats, and Dan and Eve can sit in either order: 3×2=63 \times 2 = 6 ways. The other 33 children fill the remaining 33 seats (one back, two front): 3!=63! = 6 ways. Total 24×6×6=86424 \times 6 \times 6 = 864.

Repetition, restrictions and probability (exam-hard)

The 1010 letters of the word STATISTICS are arranged in a line.

(a) Find the number of different arrangements.

(b) Find the number of arrangements that begin and end with S.

(c) Find the number of arrangements in which the two Is are not next to each other.

(d) An arrangement is chosen at random. Find the probability that it begins and ends with S.

Solution

STATISTICS: S three times, T three times, I twice, A once, C once.

(a) 10!3! 3! 2!=362880072=50400\dfrac{10!}{3!\,3!\,2!} = \dfrac{3628800}{72} = 50400.

(b) Fix S at each end. The middle 88 letters are S, T, T, T, A, I, I, C: one S, three Ts, two Is. 8!3! 2!=3360\dfrac{8!}{3!\,2!} = 3360.

(c) Is together: block [II] with S, S, S, T, T, T, A, C, that is 99 items with three Ss and three Ts alike: 9!3! 3!=10080\dfrac{9!}{3!\,3!} = 10080. Not together: 50400−10080=4032050400 - 10080 = 40320.

(d) 336050400=115\dfrac{3360}{50400} = \dfrac{1}{15}. Check directly: P(first is S)×P(last is S∣first is S)=310×29=115P(\text{first is S}) \times P(\text{last is S} \mid \text{first is S}) = \dfrac{3}{10} \times \dfrac{2}{9} = \dfrac{1}{15}.

Watch out

Forgetting the arrangements inside a block. Gluing Ali and Bea together gives 6!6! arrangements of the items, but each has Ali on the left or Bea on the left. Multiply by 2!2! (or k!k! for a block of kk different objects). If the objects in the block are identical, as with EEE, there is only 11 internal arrangement.

Watch out

Subtracting for three or more separated objects. "Total minus all three together" counts arrangements where two of them are still adjacent. Use the gaps method whenever no two of three or more objects may touch.

Watch out

Dividing out repeats too early or not at all. In "Ss together" for NEEDLESS, the two Ss are inside the block, so they no longer appear in the denominator, but the three Es outside still do: 7!3!\dfrac{7!}{3!}, not 7!3! 2!\dfrac{7!}{3!\,2!}.

Watch out

Interacting restrictions. When two restrictions can use the same object (first digit and last digit both drawn from the even digits), a single product is wrong. Split into cases and add.

Exam tip
  • Write a short reason next to every factor: "6!6! for the block and 5 others, ×2\times 2 for the order inside the block". Method marks are given for the structure even if the arithmetic slips.
  • Final answers are exact integers; give them in full (3024030240, not 3.02×1043.02 \times 10^4).
  • Use the complement (total minus together) whenever it is quicker, but state that is what you are doing.
  • In probability parts, the total number of arrangements found earlier is usually the denominator; reuse it.
  • Read "next to each other", "together", "at each end", "in the front row" very carefully: each phrase signals a specific technique.
  • A sense check you can always do: the restricted answer must be smaller than the unrestricted one.
Summary
  • Multiplication principle: successive choices multiply. Fill positions one at a time.
  • nn different objects in a line: n!n! ways; 0!=10! = 1.
  • rr objects from nn, order mattering: nPr=n!(n−r)!{}^{n}P_{r} = \dfrac{n!}{(n - r)!}.
  • Repeated objects: n!p! q!⋯\dfrac{n!}{p!\,q!\cdots}.
  • Fixed positions: fill them first.
  • Together: glue into a block, arrange, then multiply by the arrangements inside the block.
  • Not together (two objects): total minus together. No two of several: gaps method.
  • Rows of seats: treat seats as positions and place restricted people first.
  • Probability with random arrangements: favourable count ÷\div total count.

Practice questions

Question
  1. In how many ways can 66 different books be arranged on a shelf? In how many of these are two particular books at the two ends of the shelf?
  2. Find the number of different arrangements of the letters of BANANA.
  3. Ten runners compete in a race. In how many ways can the gold, silver and bronze medals be awarded?
  4. Find the number of arrangements of the letters of PARALLEL (a) in total, (b) in which the three Ls are together.
  5. Five boys and three girls stand in a line. Find the number of arrangements in which (a) the three girls stand together, (b) no two girls stand next to each other.
  6. Three-digit numbers are formed from the digits 0,1,2,3,4,50, 1, 2, 3, 4, 5 with no repetition. (A number cannot begin with 00.) How many of these numbers are odd and greater than 300300?
  7. Find the number of arrangements of the letters of DECIDED (a) in total, (b) that begin and end with D, (c) in which the three vowels are together.
  8. Ten people sit in two rows of 55 seats. Two of them, Fay and Gus, must sit in the front row. Find the number of arrangements (a) with this condition only, (b) if also Fay and Gus must sit next to each other.
  9. The letters of MISSISSIPPI are arranged at random. Find the probability that the arrangement begins and ends with S.
  10. Find the number of arrangements of NEEDLESS in which no two Es are next to each other.
Answers
  1. 6!=7206! = 720. With two particular books at the ends: they can be placed in 2!=22! = 2 ways, and the other 44 books arranged in 4!=244! = 24 ways, giving 4848.

  2. Six letters with three As and two Ns: 6!3! 2!=72012=60\dfrac{6!}{3!\,2!} = \dfrac{720}{12} = 60.

  3. Order matters (gold is different from silver): 10P3=10×9×8=720{}^{10}P_{3} = 10 \times 9 \times 8 = 720.

  4. PARALLEL: P, A, A, R, L, L, L, E (two As, three Ls). (a) 8!2! 3!=4032012=3360\dfrac{8!}{2!\,3!} = \dfrac{40320}{12} = 3360. (b) Block [LLL] with P, A, A, R, E: 66 items with two As alike: 6!2!=360\dfrac{6!}{2!} = 360.

  5. (a) Block of 33 girls plus 55 boys: 6!6! arrangements, times 3!3! inside the block: 720×6=4320720 \times 6 = 4320. (b) Arrange the boys: 5!=1205! = 120. They create 66 gaps; place the 33 girls in 33 different gaps: 6P3=120{}^{6}P_{3} = 120. Total 120×120=14400120 \times 120 = 14400.

  6. The first digit is 33, 44 or 55; the last digit is 11, 33 or 55, and these can clash. First digit 33: last digit 11 or 55 (22 ways), middle digit from the 44 remaining: 88. First digit 44: last digit 11, 33 or 55 (33 ways), middle 44 ways: 1212. First digit 55: last digit 11 or 33, middle 44 ways: 88. Total 8+12+8=288 + 12 + 8 = 28.

  7. DECIDED: D three times, E twice, C, I. (a) 7!3! 2!=420\dfrac{7!}{3!\,2!} = 420. (b) Fix D at each end; arrange D, E, E, C, I in the middle: 5!2!=60\dfrac{5!}{2!} = 60. (c) The vowels are E, I, E. Block [vowels] with D, D, D, C: 55 items with three Ds alike: 5!3!=20\dfrac{5!}{3!} = 20. Inside the block, E, I, E can be arranged in 3!2!=3\dfrac{3!}{2!} = 3 ways. Total 20×3=6020 \times 3 = 60.

  8. (a) Fay and Gus in 22 of the 55 front seats: 5P2=20{}^{5}P_{2} = 20 ways. The other 88 people fill 88 seats: 8!=403208! = 40320. Total 20×40320=80640020 \times 40320 = 806400. (b) A row of 55 has 44 adjacent pairs of seats, and Fay and Gus can sit in either order: 88 ways. Total 8×8!=3225608 \times 8! = 322560.

  9. MISSISSIPPI: M once, I four times, S four times, P twice. Total arrangements 11!4! 4! 2!=34650\dfrac{11!}{4!\,4!\,2!} = 34650. Beginning and ending with S: the middle 99 letters are M, I, I, I, I, S, S, P, P: 9!4! 2! 2!=3780\dfrac{9!}{4!\,2!\,2!} = 3780. Probability 378034650=655=0.109\dfrac{3780}{34650} = \dfrac{6}{55} = 0.109 (3 s.f.). Check: 411×310=655\dfrac{4}{11} \times \dfrac{3}{10} = \dfrac{6}{55}.

  10. Arrange N, D, L, S, S first: 5!2!=60\dfrac{5!}{2!} = 60 ways. This creates 66 gaps. The three Es are identical, so we only choose which 33 gaps receive an E: 6P3÷3!=1206=20{}^{6}P_{3} \div 3! = \dfrac{120}{6} = 20 ways (this is 6C3{}^{6}C_{3}, see combinations). Total 60×20=120060 \times 20 = 1200.

How well do you know this?

Where this leads

Console

Search notes, courses and tools, or run an action