Inclusion-Exclusion for Counting

Rarely Tested

Inclusion-Exclusion for Counting

## Formula

For two sets $$a$$ and $$b$$:

$$n(A\cup B)=n(A)+n(B)-n(A\cap B)$$

For three sets:

$$n(A\cup B\cup C)=n(A)+n(B)+n(C)-n(A\cap B)-n(B\cap C)-n(C\cap A)+n(A\cap B\cap C)$$

## Usage

- Used when different counting cases overlap and direct addition would cause overcounting.

---

Question 1

Five gentlemen check their hats and coats at a theater. Due to a mix-up, the attendant returns the 5 hats and 5 coats completely at random to the 5 men (one hat and one coat per man).

How many ways can the items be distributed such that no one receives both their own hat and their own coat?

Question 2

Find the number of ways to travel from the bottom-left corner $$(0,0)$$ to the top-right corner $$(6,6)$$ on a grid, moving only one unit Right (R) or one unit Up (U) at a time, such that the path never passes through the point $$(3,3)$$ but must pass through at least one of the points $$(2,2)$$ or $$(4,4)$$

Question 3

How many $$3\times3$$ matrices with entries from $$\{0,1\}$$ have no row consisting entirely of zeros and no column consisting entirely of  zeros?

Go back to topics

Join CAT 2026 course by 5-Time CAT 100%iler

Start your IIM journey with the right preparation and crack CAT 2026.