UPSC Prelims 2024·CSAT·Quantitative Aptitude·Combinatorics and Probability

There is a numeric lock which has a 3-digit PIN. The PIN contains digits 1 to 7. There is no repetition of digits. The digits in the PIN from left to right are in decreasing order. Any two digits in the PIN differ by at least 2. How many maximum attempts does one need to find out the PIN with certainty?

Dalvoy logo
Reviewed by Dalvoy
UPSC Civil Services preparation
Last updated 23 May 2026, 3:31 pm IST
  1. A6
  2. B8
  3. C10Correct
  4. D12

Explanation

The problem asks for the maximum number of attempts needed to find a 3-digit PIN with certainty, given specific conditions. This means we need to count all possible valid PINs. Let the 3-digit PIN be represented as ABC. The conditions are: 1. Digits are from 1 to 7 (i.e., {1, 2, 3, 4, 5, 6, 7}). 2. No repetition of digits (A ≠ B, B ≠ C, A ≠ C). 3. Digits are in decreasing order from left to right (A > B > C). 4. Any two digits in the PIN differ by at least 2. This implies: A - B ≥ 2 B - C ≥ 2 Let's list the possible PINs by systematically choosing the digits, starting with the largest possible digit for A. Case 1: A = 7 Since A - B ≥ 2, B must be at most 7 - 2 = 5. Since B - C ≥ 2 and C ≥ 1 (smallest digit), B must be at least 1 + 2 = 3. So, B can be 3, 4, or 5. Subcase 1.1: B = 5 Since B - C ≥ 2, C must be at most 5 - 2 = 3. Also, C must be > 0 (from condition 1). Possible C values: {1, 2, 3}. PINs: (7, 5, 3), (7, 5, 2), (7, 5, 1) (3 PINs) Subcase 1.2: B = 4 Since B - C ≥ 2, C must be at most 4 - 2 = 2. Possible C values: {1, 2}. PINs: (7, 4, 2), (7, 4, 1) (2 PINs) Subcase 1.3: B = 3 Since B - C ≥ 2, C must be at most 3 - 2 = 1. Possible C value: {1}. PINs: (7, 3, 1) (1 PIN) Total for A = 7: 3 + 2 + 1 = 6 PINs. Case 2: A = 6 Since A - B ≥ 2, B must be at most 6 - 2 = 4. Since B - C ≥ 2 and C ≥ 1, B must be at least 1 + 2 = 3. So, B can be 3 or 4. Subcase 2.1: B = 4 Since B - C ≥ 2, C must be at most 4 - 2 = 2. Possible C values: {1, 2}. PINs: (6, 4, 2), (6, 4, 1) (2 PINs) Subcase 2.2: B = 3 Since B - C ≥ 2, C must be at most 3 - 2 = 1. Possible C value: {1}. PINs: (6, 3, 1) (1 PIN) Total for A = 6: 2 + 1 = 3 PINs. Case 3: A = 5 Since A - B ≥ 2, B must be at most 5 - 2 = 3. Since B - C ≥ 2 and C ≥ 1, B must be at least 1 + 2 = 3. So, B can only be 3. Subcase 3.1: B = 3 Since B - C ≥ 2, C must be at most 3 - 2 = 1. Possible C value: {1}. PINs: (5, 3, 1) (1 PIN) Total for A = 5: 1 PIN. Case 4: A = 4 Since A - B ≥ 2, B must be at most 4 - 2 = 2. However, since B - C ≥ 2 and C ≥ 1, B must be at least 1 + 2 = 3. This creates a contradiction (B ≤ 2 and B ≥ 3). Therefore, no PINs can start with 4. Similarly, A cannot be less than 4. Total number of possible PINs = (PINs for A=7) + (PINs for A=6) + (PINs for A=5) Total = 6 + 3 + 1 = 10. To find the PIN with certainty, one must try all possible valid combinations in the worst-case scenario. Therefore, the maximum number of attempts needed is the total number of valid PINs. The maximum number of attempts is 10. The final answer is C
Quantitative Aptitude: There is a numeric lock which has a 3-digit PIN. The PIN contains digits 1 to 7. There is no repetition of digits. The d

Related questions

More UPSC Prelims practice from the same subject and topic.