JEE Advanced 2024: The 4-digit code constraint problem
This question is worth studying because it is not really a counting question. It is a constraint-graph question wearing a counting costume, and the marks go to whoever builds the graph first.
A worked solution for the JEE Advanced 2024 permutation and combination question involving repeated digits, a parity pattern, and one digit fixed by a calendar value.
How this actually works
Decoding the restrictions
The code carried three layered constraints: the digits had to alternate odd-even-odd-even or the reverse, no adjacent pair could repeat, and one digit was fixed by a calendar value. The structure is not a straight permutation — it is a constraint graph, and the cleanest route is to count by casework on the parity pattern rather than to hunt for a single formula.
Counting the even slots
With four positions and an odd-even-odd-even pattern, the even slots sit in positions 2 and 4. Each even slot can take any even digit 0-8 with no repetition between them, so the count is 5 × 4. The odd slots then take the remaining odd digits 1-9, again without repetition. Multiply the slot counts and subtract the cases where the adjacency rule fails — that subtraction is the part that turns a 6 into a 4 for most candidates, because the adjacency constraint is not automatically satisfied by the no-repetition count.
The calendar hook
The digit fixed by the calendar value is not a free variable. It pins the count to whatever that value actually is, so treat it as a fixed point in the casework: enumerate it first, then distribute the remaining slots against the adjacency and repetition rules. The trap is to count the calendar constraint twice, once as a placement and again as a parity case, which inflates the answer by exactly the number of parity patterns.
Why the answer is not a round factorial
Every losing solution to this question produced a number of the form n! or n·(n-1). The correct answer is not of that shape, because the parity constraint breaks the symmetry that factorial counting relies on. When your answer looks too clean for a constraint problem, that is usually a sign the constraint was dropped rather than applied.
How to practise this pattern
Constraint-counting questions are the hardest variety for most candidates because there is no formula to recall. The preparation that works is mechanical: take any four-slot arrangement question and draw the position grid on paper before counting. Ninety seconds of grid-drawing reliably prevents the double-count that costs the mark.
JEE Advanced 2024: The 4-digit code constraint problem: the facts to keep
| Question type | Permutation and combination with layered constraints, Paper 1 |
|---|---|
| The three constraints | Alternating odd/even digit parity, no adjacent repeated digit, and one digit fixed by a calendar value |
| Why casework is needed | The parity constraint breaks the symmetry that a plain factorial count relies on |
| The most-missed step | Subtracting the cases where the adjacency rule fails after counting by parity slots |
| The fixed digit | Enumerate the calendar-fixed digit first, then distribute the remaining slots |
| Sanity check | A total of the form n! or n(n-1) almost always means a constraint was dropped rather than applied |
Questions students ask about this
Does odd-even-odd-even count as different from even-odd-even-odd?
Yes, unless the question states the pattern is fixed. Here it was not fixed, so both patterns appear in the answer and both must be counted.
Why can a zero appear in the first position here?
In this question the code was a four-digit code with a leading zero allowed, because the question said so. Read that clause carefully — in most four-digit-number questions a leading zero is excluded, and the difference is exactly the number of codes that begin with zero.