Enumerating 5-Letter Passwords with Restrictions

35 Views Asked by At

Your mom forgot her password and you are trying to help her. She remembers it’s a five-letter password and she new it started with a ‘R’ and didn’t end with a vowel. She didn’t use the letters Q, X, Y. The password is not allowed to repeat letters. How many possibilities are there?

So it seems like the multiplication principle is at play here.

First digit: R only, so nothing to do yet.

Second digit: can't be R, Q, X, or Y. So 22 choices? So $1\times 22$

Third digit: Can't be R, Q, Z, Y, or whatever the 2nd digit was, so 21 choices? So $1\times 22\times21$

Fourth digit: Can't be R, Q, Z, Y, or whatever the 2nd and 3rd digits were, so 20 choices? So $1\times 22\times21\times20$

Fifth digit: This is where i get confused... Perhaps I should start with this, since the condition is influencing the choices for slots 2, 3, and 4? Can't be R, Q, Z, Y, or any vowel or any of the 3 chosen letters previous, which is confusing because what if they contain vowels or not.. this will affect the number that goes here.

So, if I change the approach, and say

First digit: R only, so nothing to do yet.

Fifth digit: Can't be R, Q, X, Z, A, E, I, O, U, so 17?

And now the 2nd digit Can't be R, Q, X, Z, or whatever the 5th slot is... and so on.

Is the solution just $1\times21\times20\times19\times17$?