In: Statistics and Probability
You need to make up a password which contains 6 digits, which can be one of 26 letters, 10 numbers (0-9) or 10 punctuation marks (!.,%$#*&=+).
The first digit of the password must be a letter, and the last digit must also be a letter. There are no other restrictions. How many possible passwords are there?
Restrictions:
1) First digit should be a letter
2) Last digit should be a letter
There is a bit of ambiguity in the question regarding use of uppercase and lowercase letters. I'll solve it for both cases.
Case 1: Both uppercases and lowercases allowed
The first digit can be chosen in 26 x 2 = 52 ways. Similarly, last digit can also be chosen in 26 x 2 = 52 ways.
For the 2nd digit, one can choose a character in 52 + 10 + 10 = 72 ways.
Similarly 3rd, 4th and 5th digits can also be chosen in 72 ways each.
Now, by standard rules of counting, no of such passwords possible = 52 x 72 x 72 x 72 x 72 x 52 = 72666906624
Case 2: Only lowercases allowed (or only uppercases allowed)
The first digit can be chosen in 26 ways. Similarly, last digit can also be chosen in 26 ways.
For the 2nd digit, one can choose a character in 26 + 10 + 10 = 46 ways.
Similarly 3rd, 4th and 5th digits can also be chosen in 46 ways each.
Now, by standard rules of counting, no of such passwords possible = 26 x 46 x 46 x 46 x 46 x 26 = 3026760256