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?
- A6
- B8
- C10Correct
- 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:
- Digits are from 1 to 7 (i.e., {1, 2, 3, 4, 5, 6, 7}).
- No repetition of digits (A ≠ B, B ≠ C, A ≠ C).
- Digits are in decreasing order from left to right (A > B > C).
- 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

Related questions
More UPSC Prelims practice from the same subject and topic.
- Prelims 2024CSATQuantitative Aptitude
There are 9 cups placed on a table arranged in equal number of rows and columns out of which 6 cups contain coffee and 3 cups contain tea. In how many ways can they be arranged so that each row should…
- Prelims 2024CSATQuantitative Aptitude
One non-zero digit, one vowel and one consonant from English alphabet (in capital) are to be used in forming passwords, such that each password has to start with a vowel and end with a consonant. How …
- Prelims 2024CSATQuantitative Aptitude
There are two containers X and Y. X contains 100 ml of milk and Y contains 100 ml of water. 20 ml of milk from X is transferred to Y. After mixing well, 20 ml of the mixture in Y is transferred back t…
- Prelims 2024CSATQuantitative Aptitude
There are four letters and four envelopes and exactly one letter is to be put in exactly one envelope with the correct address. If the letters are randomly inserted into the envelopes, then consider t…
- Prelims 2024CSATQuantitative Aptitude
In how many ways can a batsman score exactly 25 runs by scoring single runs, fours and sixes only, irrespective of the sequence of scoring shots?
- Prelims 2024CSATQuantitative Aptitude
Raj has ten pairs of red, nine pairs of white and eight pairs of black shoes in a box. If he randomly picks shoes one by one (without replacement) from the box to get a red pair of shoes to wear, what…