© All Rights reserved @ LearnWithDash
Step-by-Step Solution
Step 1: Understand the Problem
A person has a 4-digit ATM PIN code, represented by digits a, b, c, d under the following conditions:
1. All four digits are different.
2. The greatest digit used is 7 (so digits are from 0 to 7, and 7 must appear).
3. The sum of the first two digits equals the sum of the last two digits, i.e.,
a + b = c + d.
We need to count how many such PINs exist, so we know the maximum number of trials needed.
Step 2: Determine Possible Pairs (i, j) That Sum to a Specific Value
Because the digits range from 0 to 7:
• Both i and j must lie in \{0, 1, 2, 3, 4, 5, 6, 7\} .
• i \neq j because all digits must be distinct.
• The pair (i, j) sums to a certain value S = i + j .
We look for pairs that include the digit 7 or can combine with a pair that does, because 7 must be the largest digit used.
Step 3: Identify Sums That Can Include 7
If the sum S is less than 7, then no pair can have 7 and still sum to that S . So we only consider S \geq 7 . For each S , we find all valid pairs:
• They must be distinct digits.
• At least one of the pairs (for the first two or the last two digits) must include 7.
Step 4: Count Valid 4-Digit Codes for Each Sum
We consider S from 7 to 13 and find how many ways we can form (a,b) and (c,d) such that each pair sums to S , the pairs share no digit in common, and at least one pair uses 7.
--------------------------------------------------------------------------------
S = 7
Valid pairs summing to 7: (0,7) , (1,6) , (2,5) , (3,4) .
• The pair containing 7 is (0,7) .
• Other non-7 pairs are (1,6) , (2,5) , (3,4) .
To ensure 7 is used, pick (0,7) for one pair and choose any of the three remaining pairs for the other pair. For each choice:
• We can swap digits within the first pair (2 ways).
• We can swap digits within the second pair (2 ways).
• We can also decide which pair goes in the first half of the PIN and which goes in the second half (effectively another factor of 2 if we think of all distinct placements).
More explicitly:
1) (P7, Pn7) → (0,7) + one of \{(1,6), (2,5), (3,4)\} .
2) (Pn7, P7) → one of \{(1,6), (2,5), (3,4)\} + (0,7) .
Each scenario has 3 choices for the non-7 pair, each choice yields 2 \times 2 = 4 internal permutations, and we have 2 scenarios.
Hence total for S = 7 : 3 \times 4 for the first scenario + 3 \times 4 for the second = 24 codes.
--------------------------------------------------------------------------------
S = 8
Valid pairs: (1,7) , (2,6) , (3,5) .
To include 7, at least one pair is (1,7) .
Possible pair combinations:
• ( (1,7), (2,6) ) , ( (1,7), (3,5) ) , ( (2,6), (1,7) ) , ( (3,5), (1,7) ) .
That is 4 ways to choose how pairs appear in the PIN. Each way has 2 \times 2 = 4 internal permutations (swapping positions within each pair).
Total for S = 8 : 4 \times 4 = 16 codes.
--------------------------------------------------------------------------------
S = 9
Valid pairs: (2,7) , (3,6) , (4,5) .
To include 7, at least one pair is (2,7) .
Possible two-pair combinations:
• ( (2,7), (3,6) ) , ( (2,7), (4,5) ) , ( (3,6), (2,7) ) , ( (4,5), (2,7) ) .
Again, 4 ways to arrange which pair goes first or second, and each arrangement has 4 internal permutations.
Total for S = 9 : 4 \times 4 = 16 codes.
--------------------------------------------------------------------------------
S = 10
Valid pairs: (3,7) , (4,6) .
We must use (3,7) in at least one position to have digit 7.
Possible combinations:
• ( (3,7), (4,6) ) and ( (4,6), (3,7) ) .
That gives 2 ways, each with 2 \times 2 = 4 permutations:
Total for S = 10 : 2 \times 4 = 8 codes.
--------------------------------------------------------------------------------
S = 11
Valid pairs: (4,7) , (5,6) .
We must use (4,7) to include digit 7.
Possible combinations:
• ( (4,7), (5,6) ) and ( (5,6), (4,7) ) .
Again, 2 ways, each with 2 \times 2 = 4 permutations:
Total for S = 11 : 8 codes.
--------------------------------------------------------------------------------
S = 12
Valid pair: (5,7) only.
We cannot form a second distinct pair summing to 12 that avoids repeating digits. So there are 0 valid codes here.
--------------------------------------------------------------------------------
S = 13
Valid pair: (6,7) only.
Similarly, there is no second distinct pair available, so 0 valid codes.
Step 5: Add All Valid Codes
Summing all possible codes from S=7 to S=13 :
• S = 7 \rightarrow 24 codes
• S = 8 \rightarrow 16 codes
• S = 9 \rightarrow 16 codes
• S = 10 \rightarrow 8 codes
• S = 11 \rightarrow 8 codes
• S = 12 \rightarrow 0 codes
• S = 13 \rightarrow 0 codes
Total = 24 + 16 + 16 + 8 + 8 = 72.
Final Answer
The maximum number of trials necessary is \boxed{72} .