Outfit Grid
DarkKhakiGrayRedBlueGreenAmber3 pants4 shirts × 3 pants = 12 outfits

The Password Problem

What do you think?
A password has 4 characters: one uppercase, one lowercase, then two digits. How many possible passwords exist?

You could start listing them: Aa00, Aa01, Aa02...

You'd be at it for a while. There's a faster way.

Start smaller

What do you think?
You have 3 shirts and 2 pants. How many different outfits can you make?
Enter a whole number
Outfit Grid
DarkKhakiGrayRedBlueGreenAmber3 pants4 shirts × 3 pants = 12 outfits
Wardrobe Builder
shirts (3)
pants (2)
3×2=6combinations
all combinations
A1
A2
B1
B2
C1
C2

Tap the items on and off. Watch the total change.

With 3 shirts and 2 pants, you get 6 outfits. Not because you listed them, but because each shirt pairs with every pair of pants.

With 4 shirts and 3 pants, how many outfits? (whole number)
Now add 2 hats. With 4 shirts, 3 pants, 2 hats, how many complete outfits? (whole number)

The rule

The Multiplication Rule

If you have n1n_1 ways to make the first choice, n2n_2 ways to make the second, and so on, then the total number of ways is: n1×n2××nkn_1 \times n_2 \times \cdots \times n_k

This works because the choices are independent. Picking the purple shirt doesn't eliminate any pants.

Back to passwords

Counting the passwords
Uppercase: 26 choices\text{Uppercase: } 26 \text{ choices}
A-Z gives us 26 options for the first character.
Step 1 of 5
Password strength explorer
1816
character types
alphabet^length
624 = 14,776,336
time to crack @ 1B/sec
weak15ms
Using 1 more character adds 62 combinations
A 6-digit PIN (0-9 for each digit). How many possible PINs? (whole number)
A 4-letter password (lowercase only). How many possibilities? (whole number)

With vs. without replacement

What do you think?
A 4-digit PIN where digits CAN'T repeat. First digit has 10 options. How many options for the second digit?
Enter a whole number
PIN Code Builder
_
_
_
_
position 1: 10 choices
total 4-digit PINs
10 × 10 × 10 × 10 = 10^4
10,000
TypeHow it works4-digit PIN count
With replacement10, 10, 10, 1010,000
Without replacement10, 9, 8, 75,040

With replacement: every position has the same choices.

Without replacement: the numbers shrink: nn, then n1n-1, then n2n-2...

3-digit PIN, no repeating digits. How many options? (whole number)
3-letter code (A-Z), no repeating letters. How many codes? (whole number)

Why this matters for security

What do you think?
Standard 4-digit PIN (10,000 possibilities). At 1000 guesses per second, how long to try them all?
Password TypePossibilitiesTime to Crack @ 1B/sec
4-digit PIN10,000Instant
6-char (a-z)309 million< 1 second
8-char (a-z, A-Z, 0-9)218 trillion~2.5 days
12-char (a-z, A-Z, 0-9)3 × 10²¹~96,000 years

Each additional character multiplies the count by the alphabet size, which is why longer passwords are exponentially more secure.

The shrinking pattern

When choices shrink at each step: n×(n1)×(n2)×n \times (n-1) \times (n-2) \times \cdots

This pattern comes up so often that mathematicians gave it a name and a symbol. This is covered in the combinations vs permutations lesson.

5 people in a race. How many ways can they finish 1st, 2nd, 3rd? (No ties) (whole number)
License plate: 3 letters then 4 digits. Repetition allowed. How many plates? (whole number)
True or False: Adding one character to a password roughly DOUBLES the possibilities. (true or false)

The next lesson covers factorials, permutations, and combinations.