there are $m \times n$ ways of doing both
A password is made of one letter (26 choices), then two digits, then one symbol from a set of $8$. How many passwords are possible?
The specification names two cases directly.
No repetition: $n \times (n-1) \times (n-2) \times \cdots$
How many three-digit codes can be made from the digits $1$ to $5$ (a) if digits may repeat, (b) if they may not?
| $n$ | $n!$ |
|---|---|
| $0$ | $1$ |
| $1$ | $1$ |
| $2$ | $2$ |
| $3$ | $6$ |
| $4$ | $24$ |
| $5$ | $120$ |
| $6$ | $720$ |
| $10$ | $3\,628\,800$ |
Six people sit in a row. In how many ways can they be arranged if two particular people must sit next to each other?
How many four-digit numbers can be formed from the digits $1, 2, 3, 4, 5$ without repetition, if the number must be even?
A code is either two letters ($26$ each) or three digits. How many codes are possible?
How many three-digit numbers (from $100$ to $999$) contain at least one zero?
"And"
Multiply.
"Or"
Add (if the cases cannot overlap).
Repetition allowed
$n^k$ for $k$ stages.
No repetition
$n(n-1)(n-2)\cdots$
All $n$ arranged
$n!$
$0!$
Equals $1$.
Must be together
Treat as a block, then $\times\,$ internal arrangements.
Restrictions
Fill the restricted position first.
"At least one"
Total minus none.
Sanity check
Does the size of the answer feel plausible?
A shop sells $5$ styles of shirt in $7$ colours. How many different shirts are stocked?
▶ Show solution
$5 \times 7 = 35$
Four dice are rolled. How many possible outcomes are there?
▶ Show solution
$6^4 = 1296$
In how many orders can $8$ runners finish a race?
▶ Show solution
$8! = 40\,320$
How many four-letter arrangements can be made from the letters of MATHS, with no letter repeated?
▶ Show solution
$5$ letters available, choosing $4$ in order:
$5 \times 4 \times 3 \times 2 = 120$
A car registration is $2$ letters, then $2$ digits, then $3$ letters. How many are possible if repeats are allowed?
▶ Show solution
$26^2 \times 10^2 \times 26^3$
$= 676 \times 100 \times 17\,576 = 1\,188\,137\,600$
Five people sit in a row, but two of them refuse to sit next to each other. How many arrangements are possible?
▶ Show solution
Total arrangements: $5! = 120$.
Arrangements with them together: block of $2$ plus $3$ others gives $4! = 24$, times $2$ for the swap $= 48$.
$120 - 48 = 72$
How many three-digit numbers can be made from $1, 2, 3, 4, 5, 6$ without repetition if the number must be greater than $500$?
▶ Show solution
The first digit must be $5$ or $6$: $2$ choices.
Then $5$ remaining digits for the second place and $4$ for the third.
$2 \times 5 \times 4 = 40$
A lock uses either a $4$-digit code or a $3$-letter code. How many combinations must a thief try in the worst case?
▶ Show solution
Digits: $10^4 = 10\,000$
Letters: $26^3 = 17\,576$
These are alternatives, so add: $27\,576$.
Six books — three maths and three physics — are arranged on a shelf. How many arrangements keep all the maths books together?
▶ Show solution
Treat the three maths books as one block. That leaves $4$ items (block + $3$ physics books).
$4! = 24$ arrangements of the items.
Within the block, $3! = 6$ orders.
$24 \times 6 = 144$
A $5$-character ID is made from the $26$ capital letters and the $10$ digits.
(a) How many IDs are possible if characters may repeat? (b) How many if all five characters must be different? (c) How many contain at least one digit? (d) The designers want at least $50$ million IDs while keeping all characters different. Is a $5$-character ID enough?
▶ Show solution
There are $26 + 10 = 36$ available characters.
(a) $36^5 = 60\,466\,176$
(b) $36 \times 35 \times 34 \times 33 \times 32$
$= 45\,239\,040$
(c) Count the complement: IDs made of letters only.
$26^5 = 11\,881\,376$
At least one digit $= 60\,466\,176 - 11\,881\,376 = 48\,584\,800$
(d) From (b), the number of all-different $5$-character IDs is $45\,239\,040$, which is less than $50$ million.
So no — a $5$-character ID is not enough under that restriction. Note that (a) shows allowing repeats would be sufficient ($60.5$ million), so the designers must either permit repeated characters or extend the ID to $6$ characters. Adding a sixth character while keeping all different gives $45\,239\,040 \times 31 \approx 1.4$ billion, comfortably enough.