QlarIITy

MathematicsJEE Main 2022 · 28 JulyInteger

Let SS be the set of all passwords which are six to eight characters long, where each character is either an alphabet from {A,B,C,D,E}\{A, B, C, D, E\} or a number from {1,2,3,4,5}\{1, 2, 3, 4, 5\} with the repetition of characters allowed. If the number of passwords in SS whose at least one character is a number from {1,2,3,4,5}\{1, 2, 3, 4, 5\} is α×56\alpha \times 5^6, then α\alpha is equal to

Try it before you look.The full solution is on this page, below the answer box, the moment you check. No sign-in needed.

Solution

Core idea. At least one is counted as all possibilities less those with none.

Concept refresher. With repetition allowed, rr places can be filled from nn characters in nrn^r ways, and

N(at least one)=N(all)−N(none)N(\text{at least one}) = N(\text{all}) - N(\text{none})

Picture the situation. There are ten characters, five letters and five numbers, and a password has six, seven or eight of them with repetition allowed. Having at least one number is the opposite of having letters only. So for each length the count is all passwords less the letter-only ones, and both of those are simple powers.

Approach. Count by complement for each length, add the three lengths, and factor out the required power.

  1. Step 1: Each length

    A password of length kk with at least one number can be formed in 10k−5k=5k(2k−1)10^k - 5^k = 5^k(2^k - 1) ways.

  2. Step 2: Add the lengths

    For k=6k = 6, 7 and 8 the total is

    56[(26−1)+5(27−1)+25(28−1)]=56(63+635+6375)\begin{aligned} &5^6\left[(2^6 - 1) + 5(2^7 - 1) + 25(2^8 - 1)\right] \\[4pt] &= 5^6(63 + 635 + 6375) \end{aligned}

    so α=7073\alpha = 7073.

Answer. 7073

Sanity check. Most passwords contain a number, so the count should be close to the number of all passwords, 56(64+640+6400)=56×71045^6(64 + 640 + 6400) = 5^6 \times 7104, and 7073 is just below 7104.

Common wrong answers

  • 7104: Not subtracting the letter-only passwords gives 64+640+6400=710464 + 640 + 6400 = 7104.

Key takeaway

The trap. The letter-only passwords must be removed for every length.

How toppers think. They factor each term before adding, so the common power comes out at once.

Remember. 10k−5k=5k(2k−1)10^k - 5^k = 5^k(2^k - 1)

More on Fundamental Principle of Counting