DISCRETE MATHEMATICS/Student Engineering Notebook
Page 07·notes
COMBINATORICS & RECURRENCE RELATIONS—~34 MIN READ

Combinatorics: Pigeonhole Principle, Stars & Bars & Derangements

“Generalized pigeonhole bounds, combinations with repetition, inclusion-exclusion, and derangements formula.”

1.The Generalized Pigeonhole Principle

Basic Principle (Dirichlet): If k + 1 or more items are placed into k bins, at least one bin must contain at least 2 items.

Generalized Principle:

If N objects are placed into k boxes, then at least one box must contain at least lceil N / k rceil objects.

Inverted Problem (Guaranteeing a Quota):

How many items N must be chosen to guarantee that at least m items fall into the same category across k categories?

By worst-case analysis: place m - 1 items into each of the k categories without achieving the quota. The very next item forces the quota:

N_{min} = k * (m - 1) + 1.

2.Stars and Bars & The Derangements Invariant

Stars and Bars (Combinations with Repetition):

The number of ways to distribute r identical items into n distinct labeled bins (or non-negative integer solutions to x_1 + x_2 + ... + x_n = r with x_i >= 0):

binom{n + r - 1}{r} = frac{(n + r - 1)!}{r! (n - 1)!}.

Derangements (Permutations with No Fixed Points):

A derangement is a permutation of {1, 2, ..., n} where no element appears in its original position (pi(i) != i for all i).

Using the Principle of Inclusion-Exclusion (PIE):

D_n = n! sum_{k=0}^n frac{(-1)^k}{k!} = n! [ 1 - frac{1}{1!} + frac{1}{2!} - frac{1}{3!} + ... + frac{(-1)^n}{n!} ].

WORKED EXAM ANALYSIS · STEP-BY-STEP DERIVATIONOriginal Practice Problem · Modeled on GATE Pattern (2 Marks)

3. Worked Problem: Constrained Integer Solutions & Derangements

⚠️ Pitfall Warning:

Shift variables to >= 0 by subtracting non-zero lower bounds from total sum r.

Problem: Find the number of integer solutions to x1 + x2 + x3 + x4 = 10 subject to constraints x1 >= 1, x2 >= 2, x3 >= 0, x4 >= 0.

Step 1: Define non-negative shifted variables:

Let x1' = x1 - 1 >= 0 => x1 = x1' + 1

Let x2' = x2 - 2 >= 0 => x2 = x2' + 2

x3' = x3 >= 0

x4' = x4 >= 0

Step 2: Substitute into equation:

(x1' + 1) + (x2' + 2) + x3' + x4' = 10

x1' + x2' + x3' + x4' = 10 - 3 = 7.

Step 3: Apply Stars and Bars formula with n = 4, r = 7:

Number of solutions = binom(n + r - 1, r) = binom(4 + 7 - 1, 7) = binom(10, 7)

binom(10, 7) = binom(10, 3) = (10 9 8) / (3 2 1) = 720 / 6 = 120.

Final Answer: Exactly 120 solutions.

SOURCE TRANSPARENCY & CITATIONS

Primary Academic References & Exam Sources

Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.

Curated University Lecture Series
Introductory Combinatorics (5th Edition) ·
LECTURE SERIES
RECOMMENDED YOUTUBE EDUCATORS & FULL-COURSE PLAYLISTS

Curated for clarity, rigorous numerical solving, and semester excellence:

Gate Smashers · Discrete Mathematics↗Instructor: Varun Singla · Covers: Logic, sets, relations, functions, posets, graph theory, counting

GATE-focused discrete maths with formula-sheet style rapid coverage.

Open YouTube↗
Knowledge Gate · Discrete Maths for GATE↗Instructor: Sanchit Jain · Covers: Relation counting, lattices, group theory, recurrences, graph colouring

All relation/function counting formulas in exam-pattern format.

Open YouTube↗
Dr. Trefor Bazett · Discrete Math Full Course↗Instructor: Prof. Trefor Bazett · Covers: Logic, proof techniques, graph theory, combinatorics, recurrences

University-level rigour with engaging visual proofs.

Open YouTube↗