Back

Solution: 2013 Fall Midterm - 3

Author: Pat Morin

Question

A password consists of 6 or 7 characters, each character being an uppercase or a lowercase letter. A password must contain at least one uppercase letter. How many passwords are there?
(a)
$26 \cdot 52^{5} + 26 \cdot 52^{6}$
(b)
$52^{6} + 52^{7}$
(c)
None of the above.
(d)
$52^{6} + 52^{7} - 26^{6} - 26^{7}$

Solution

Let’s break it down

  • For 7 characters, there are $ 52^7 $ total possibilities.
  • For 6 characters, there are $ 52^6 $ total possibilities.
We can subtract the number of passwords that do not contain an uppercase letter from the total number of possibilities.
  • For 7 characters, there are $ 26^7 $ possibilities that do not contain an uppercase letter.
  • For 6 characters, there are $ 26^6 $ possibilities that do not contain an uppercase letter.

Thus, the number of passwords that contain an uppercase letter is $ 52^7 - 26^7 + 52^6 - 26^6 $