QlarIITy

MathematicsJEE Main 2023 · 15 AprilInteger

A person forgets his 4-digit ATM pin code. But he remembers that in the code all the digits are different, the greatest digit is 7 and the sum of the first two digits is equal to the sum of the last two digits. Then the maximum number of trials necessary to obtain the correct code is________.

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. A condition on sums is handled by fixing the partner of the special digit.

Concept refresher. If one choice can be made in mm ways and, for each of these, a second in nn ways, the two together can be made in

N=m×nN = m \times n

ways.

Picture the situation. The code has four different digits, the largest being 7, so the other three are below 7, and 0 may appear anywhere because a code is not a number. The first two digits form one pair and the last two another, with equal sums. The digit 7 sits in one of the pairs, so its partner must be small enough for two smaller digits to match the sum.

Approach. Go through the partners of 7, list the matching pairs, and multiply by the number of orders.

  1. Step 1: Partner of 7

    Let the partner of 7 be xx; the other pair has two different digits below 7, different from xx, adding to 7+x7 + x. For x=0x = 0 the pairs are 1, 6; 2, 5; 3, 4. For x=1x = 1: 2, 6; 3, 5. For x=2x = 2: 3, 6; 4, 5. For x=3x = 3: 4, 6. For x=4x = 4: 5, 6. Larger xx gives none, so there are 9 choices.

  2. Step 2: Order

    Each pair can be written in 2 orders, and the pair with 7 can come first or last, so each choice gives 2×2×2=82 \times 2 \times 2 = 8 codes. The number of possible codes, and so of trials, is 9×8=729 \times 8 = 72.

Answer. 72

Sanity check. One such code is 7016: the digits are different, the greatest is 7, and 7 plus 0 equals 1 plus 6.

Common wrong answers

  • 36: Forgetting that the pair containing 7 can be the first two or the last two digits gives 36.

Key takeaway

The trap. A code may start with zero, unlike a number.

How toppers think. They count unordered choices first and multiply by the orders at the end.

Remember. 9 choices of pairs, 8 orders each.

More on Permutations