1

Question

Students are required to create 6-character long passwords to access the library. The letters must be from lowercase letters or digits. Each password must contain at least 2 lowercase letters. How many valid passwords are there?

I would like to know if my steps to solving this question, and the final answer, are correct.

Steps:

  1. All passwords = 36^6

  2. No letters = 10^6

  3. 1 letter = 10^5 + 26^1

  4. Subtract 2,3 from 1

--END--

  • No for several reasons. First... a password of length six with exactly four digits would have two letters which satisfies "having at least two letters" (compare to the phrase 'having strictly more than two'). Next, the number of passwords with five digits and one letter would still have a letter in it. Choose which letter and where that letter is. – JMoravitz Jun 03 '20 at 01:00
  • Note, $10^4$ is the number of length four strings consisting of four digits. This is again, not the number of length six strings consisting of four digits and two letters. – JMoravitz Jun 03 '20 at 01:05
  • For all of the below, I assume we can repeat letters/numbers. The first case is all letters:

    $$26\times 26\times 26\times 26 \times 26\times 26 = 26^6$$

    Second case: $5$ letters, $1$ number:

    $${6\choose 1}\times 10\times 26^5$$

    Third case: $4$ letters, $2$ numbers, etc. Can you try to extrapolate the next one?

    – scoopfaze Jun 03 '20 at 01:18
  • To be clear: the $6$ choose $1$ term comes from "imagining" that I've already constructed my $5$ letter password, and I have one space to put a number in between, before the first letter, or after the last. – scoopfaze Jun 03 '20 at 01:20
  • I will edit my steps so that you guys can see what I now have. – Lester Grillard Jun 03 '20 at 01:20
  • @JMoravitz I have edited my steps. Please let me know if anything else needs to be done. – Lester Grillard Jun 03 '20 at 01:25
  • @scoopfaze how do my steps look now? – Lester Grillard Jun 03 '20 at 01:54
  • $10^5\color{red}{+}26^1$ is the number of strings who are length-5 made of digits or are length-1 made of letters. A plus should remind you of or. A multiplication should remind you of and. (It is slightly more complicated than that, so read your textbook for more details) Now... correcting it to be a multiplication instead is still not enough. $10^5\times 26^1$ is closer... but that is the number of length-6 strings with five numbers and one letter where very specifically the first five are numbers and the last character is a letter. It misses counting if they were in... – JMoravitz Jun 03 '20 at 03:00
  • ...another order. So... you still need to account for what order they happened to be in. There are $\binom{6}{5}$ ways to have picked which five positions the numbers were in, letting the letter be in the remaining position... That brings our new corrected count for this case to be $\binom{6}{5}\times 10^5\times 26^1$. Now..... look up at scoopfaze's comment an hour ago... Really stop and look......... He already gave you the format and example calculations and explained this already... and you still used addition? – JMoravitz Jun 03 '20 at 03:02

1 Answers1

1

The subtraction approach is right, but each individual calculation needs to be corrected

$$\text{Total Number of Passwords} = 36^6$$ This is fine

$$\text {Number of passwords with no letters} = 10^6$$

This is also alright

$$\text{Number of passwords with exactly one letter} = {6\choose 1}.{26 \choose 1}.10^5$$

Here, we first choose the place where the alphabet will come, then we have to choose a letter from the available 26, and the remaining places have to be filled with numbers.

I hope this clears up any doubts