The Art of Perfect Mismatch
Mastering Derangements
Welcome, future engineer! Today, we are diving into a problem that sounds deceptively simple but hides a profound combinatorial truth.
Imagine you are standing in a room with four colored balls—Red, Blue, Green, and Orange—and four corresponding boxes. Your goal is to place exactly one ball in each box, but with a twist: no ball is allowed to rest in the box of its own color.
This is not just a puzzle; it is the gateway to understanding the Derangement—a fundamental concept in probability and combinatorics that frequently appears in JEE Advanced.
Phase 1
Visualizing the Constraint
Why is this hard? If we had no constraints, the number of ways to arrange four balls in four boxes would simply be 4!=24.
But the constraint—that no ball can be in its own box—acts like a filter. It removes the 'identity' permutation (where everything is correct) and many other 'partially correct' permutations.
We are looking for the total number of permutations where the set of fixed points is empty. In mathematical terms, we are looking for the number of derangements, denoted as Dn. For n=4, we are hunting for D4.
Phase 2
The Inclusion-Exclusion Principle
To solve this, we use the Principle of Inclusion-Exclusion. We start with the total number of permutations (4!) and subtract the cases where at least one ball is in the correct box.
But wait! If we subtract cases where the Red ball is in the Red box, we might have over-subtracted cases where both the Red and Blue balls are in their correct boxes. We must add those back, then subtract the cases where three are correct, and so on.
This leads us to the elegant formula:
Dn=n!(0!1−1!1+2!1−3!1+⋯+n!(−1)n)
This formula is the heartbeat of the problem. It accounts for all the overlaps and dependencies that make simple multiplication impossible.
Phase 3
The Calculation
Let us apply this to our specific case, n=4. Substituting into our formula, we get:
D4=4!(0!1−1!1+2!1−3!1+4!1)
We know that 0!=1 and 1!=1. Therefore, the first two terms are 11−11=0.
This is a beautiful, universal property of derangements: the first two terms always cancel out! We are left with:
Distributing the 24 into the parentheses makes the arithmetic trivial:
The Takeaway
There are exactly 9 ways to arrange these balls such that none are in their matching box. It is a small, elegant number, but the journey to get there taught us about the power of the Inclusion-Exclusion Principle.
As a pro-tip for your JEE preparation, do not just memorize the formula; memorize the sequence of derangements: D1=0,D2=1,D3=2,D4=9,D5=44.
Having these at your fingertips will save you precious seconds in the exam hall. Keep practicing, keep visualizing, and remember: even when everything seems to be in the wrong place, there is a beautiful mathematical order governing the chaos.