100% FREE Updated: Mar 2026 Discrete Mathematics Combinatorics and Proofs

Counting Techniques

Comprehensive study notes on Counting Techniques for CMI Data Science preparation. This chapter covers key concepts, formulas, and examples needed for your exam.

Counting Techniques

Overview

In the realm of Data Science, understanding the sheer scale and variety of possibilities is paramount. This chapter, "Counting Techniques," equips you with the fundamental mathematical tools to systematically quantify outcomes, arrangements, and selections. Far from being a mere abstract exercise, these techniques form the bedrock for critical areas such as probability theory, statistical inference, and the analysis of algorithms, enabling you to precisely define sample spaces, evaluate computational complexity, and design robust experiments.

For your CMI examinations, a firm grasp of counting techniques is non-negotiable. You will encounter problems requiring you to determine the number of ways events can occur, calculate the size of data subsets, or analyze the efficiency of different computational approaches. Proficiency in this area ensures you can accurately interpret problem statements, construct valid mathematical models, and arrive at precise solutions, directly impacting your performance in quantitative and analytical sections.

Mastering these foundational principles will not only prepare you for immediate exam challenges but also lay essential groundwork for advanced modules. The ability to count effectively underpins your understanding of discrete probability distributions, sampling methods, and even the combinatorial aspects of machine learning feature engineering. Consider this chapter your essential toolkit for navigating the quantitative landscape of Data Science.

---

Chapter Contents

| # | Topic | What You'll Learn |
|---|-------|-------------------|
| 1 | Elementary Counting Principles | Master fundamental rules for simple counts. |
| 2 | Permutations and Combinations | Arrange and select items systematically. |
| 3 | The Binomial Theorem | Expand powers of binomial expressions efficiently. |

---

Learning Objectives

By the End of This Chapter

After studying this chapter, you will be able to:

  • Apply the Sum Rule and Product Rule to determine the total number of outcomes.

  • Calculate permutations and combinations for distinct and non-distinct items.

  • Utilize the Binomial Theorem to expand binomial expressions and find specific coefficients.

  • Solve complex counting problems relevant to data structure analysis and probability.

---

Now let's begin with Elementary Counting Principles...

Part 1: Elementary Counting Principles

Introduction

Elementary Counting Principles form the bedrock of combinatorics, a branch of discrete mathematics focused on counting, arrangement, and combination of objects. For the CMI Masters in Data Science exam, a strong grasp of these principles is crucial for solving problems in probability, algorithm analysis, data structures, and various applied mathematics scenarios. This topic covers fundamental techniques for enumerating possibilities, understanding arrangements, and calculating selections, often appearing in logical reasoning and problem-solving sections of the exam.
📖 Combinatorics

Combinatorics is the branch of mathematics that studies finite or countable discrete structures. It is concerned with counting, arranging, and combining objects according to specific rules.

---

Key Concepts

1. Fundamental Principles of Counting

The two most basic rules are the Sum Rule and the Product Rule, which form the basis for all other counting techniques.

a. The Sum Rule (Rule of Addition)

If a task can be done in one of mm ways OR in one of nn ways, where the mm ways and nn ways are mutually exclusive (i.e., cannot occur at the same time), then there are m+nm + n ways to do the task.

📐 Sum Rule
AB=A+Bif AB=|A \cup B| = |A| + |B| \quad \text{if } A \cap B = \emptyset

Variables:

    • A|A| = number of ways to perform task A

    • B|B| = number of ways to perform task B

    • AB=A \cap B = \emptyset = tasks A and B are mutually exclusive


Application: When choosing between distinct options or categories.

b. The Product Rule (Rule of Multiplication)

If a procedure can be broken down into a sequence of two tasks, and there are mm ways to do the first task AND nn ways to do the second task, then there are m×nm \times n ways to do the procedure. This extends to any number of sequential tasks.

📐 Product Rule
A×B=A×B|A \times B| = |A| \times |B|

Variables:

    • A|A| = number of ways to perform task A

    • B|B| = number of ways to perform task B


Application: When performing a sequence of tasks, where the choices for each task are independent.

Worked Example:

Problem: A menu offers 3 appetizers, 5 main courses, and 2 desserts. How many different 3-course meals can be ordered?

Solution:

Step 1: Identify the sequence of tasks.
Ordering a meal involves choosing an appetizer, then a main course, then a dessert.

Step 2: Apply the Product Rule.
Number of choices for appetizer = 3
Number of choices for main course = 5
Number of choices for dessert = 2

3×5×2=303 \times 5 \times 2 = 30

Answer: 3030 different 3-course meals.

---

2. Permutations

A permutation is an ordered arrangement of objects. The order of selection matters.

a. Permutations of nn distinct objects taken rr at a time

The number of ways to arrange rr objects chosen from nn distinct objects is given by:

📐 Permutations
P(n,r)=n!(nr)!P(n, r) = \frac{n!}{(n-r)!}

Variables:

    • nn = total number of distinct objects

    • rr = number of objects to be arranged (0rn0 \le r \le n)

    • !! = factorial (e.g., n!=n×(n1)××1n! = n \times (n-1) \times \dots \times 1)


Application: When order is important, such as arranging people in a line, creating passwords, or scheduling tasks.

b. Permutations with Repetition

If there are nn objects where n1n_1 are of type 1, n2n_2 are of type 2, ..., nkn_k are of type kk, and n1+n2++nk=nn_1 + n_2 + \dots + n_k = n, then the number of distinct permutations of these nn objects is:

📐 Permutations with Repetition
n!n1!n2!nk!\frac{n!}{n_1! n_2! \dots n_k!}

Variables:

    • nn = total number of objects

    • nin_i = number of identical objects of type ii


Application: Arranging letters in words with repeated letters (e.g., "MISSISSIPPI").

c. Circular Permutations

The number of ways to arrange nn distinct objects in a circle is (n1)!(n-1)!. This is because in a circle, there's no fixed "start" or "end," so we fix one object's position and arrange the remaining n1n-1 objects relative to it.

📐 Circular Permutations
(n1)!(n-1)!

Variables:

    • nn = total number of distinct objects


Application: Arranging people around a circular table, arranging beads on a necklace.

Worked Example:

Problem: How many different ways can 5 distinct books be arranged on a shelf?

Solution:

Step 1: Identify the type of arrangement.
This is an arrangement of nn objects taken nn at a time (r=nr=n).

Step 2: Apply the Permutation formula.
Here n=5n=5, r=5r=5.

P(5,5)=5!(55)!=5!0!=5!P(5, 5) = \frac{5!}{(5-5)!} = \frac{5!}{0!} = 5!
5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120

Answer: 120120 different ways.

---

3. Combinations

A combination is an unordered selection of objects. The order of selection does not matter.

a. Combinations of nn distinct objects taken rr at a time

The number of ways to choose rr objects from nn distinct objects without regard to order is given by:

📐 Combinations
C(n,r)=(nr)=n!r!(nr)!C(n, r) = \binom{n}{r} = \frac{n!}{r!(n-r)!}

Variables:

    • nn = total number of distinct objects

    • rr = number of objects to be chosen (0rn0 \le r \le n)


Application: Selecting a team from a group, choosing a subset of items, picking lottery numbers.

b. Combinations with Repetition (Stars and Bars)

The number of ways to choose rr objects from nn types of objects with repetition allowed is given by:

📐 Combinations with Repetition
(n+r1r)or(n+r1n1)\binom{n+r-1}{r} \quad \text{or} \quad \binom{n+r-1}{n-1}

Variables:

    • nn = number of distinct types of objects to choose from

    • rr = number of objects to be chosen (with repetition allowed)


Application: Distributing identical items into distinct bins, finding non-negative integer solutions to equations like x1+x2++xn=rx_1 + x_2 + \dots + x_n = r.

Worked Example:

Problem: A committee of 3 members is to be selected from a group of 10 people. How many different committees can be formed?

Solution:

Step 1: Identify the type of selection.
The order in which members are selected for a committee does not matter, so this is a combination.

Step 2: Apply the Combination formula.
Here n=10n=10, r=3r=3.

C(10,3)=(103)=10!3!(103)!=10!3!7!C(10, 3) = \binom{10}{3} = \frac{10!}{3!(10-3)!} = \frac{10!}{3!7!}
C(10,3)=10×9×8×7!3×2×1×7!=10×9×83×2×1C(10, 3) = \frac{10 \times 9 \times 8 \times 7!}{3 \times 2 \times 1 \times 7!} = \frac{10 \times 9 \times 8}{3 \times 2 \times 1}
C(10,3)=10×3×4=120C(10, 3) = 10 \times 3 \times 4 = 120

Answer: 120120 different committees.

---

---

4. Principle of Inclusion-Exclusion (PIE)

PIE is used to find the number of elements in the union of multiple sets when the sets are not mutually exclusive. It accounts for elements that might be counted multiple times.

a. For Two Sets

To find the number of elements in the union of two sets AA and BB:

📐 PIE for Two Sets
AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|

Variables:

    • A|A| = number of elements in set A

    • B|B| = number of elements in set B

    • AB|A \cap B| = number of elements common to both A and B


Application: Counting items with at least one of two properties. Often used to count items with "neither A nor B" by using the complement: NABN - |A \cup B|, where NN is the total.

b. For Three Sets

To find the number of elements in the union of three sets AA, BB, and CC:

📐 PIE for Three Sets
ABC=A+B+C(AB+AC+BC)+ABC|A \cup B \cup C| = |A| + |B| + |C| - (|A \cap B| + |A \cap C| + |B \cap C|) + |A \cap B \cap C|

Variables:

    • A,B,C|A|, |B|, |C| = sizes of individual sets

    • AB,|A \cap B|, \dots = sizes of pairwise intersections

    • ABC|A \cap B \cap C| = size of the triple intersection


Application: More complex counting scenarios involving three overlapping properties.

Worked Example:

Problem: How many positive integers less than 100 are divisible by 2 or 3?

Solution:

Step 1: Define sets.
Let U={1,2,,99}U = \{1, 2, \dots, 99\}. Total integers N=99N=99.
Let AA be the set of integers in UU divisible by 2.
Let BB be the set of integers in UU divisible by 3.

Step 2: Calculate sizes of individual sets.
A=99/2=49|A| = \lfloor 99/2 \rfloor = 49
B=99/3=33|B| = \lfloor 99/3 \rfloor = 33

Step 3: Calculate the size of the intersection.
ABA \cap B is the set of integers divisible by both 2 and 3, i.e., divisible by lcm(2,3)=6\operatorname{lcm}(2,3)=6.
AB=99/6=16|A \cap B| = \lfloor 99/6 \rfloor = 16

Step 4: Apply PIE for two sets.

AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|

AB=49+3316|A \cup B| = 49 + 33 - 16

AB=8216=66|A \cup B| = 82 - 16 = 66

Answer: 6666 integers.

---

5. Pigeonhole Principle (PHP)

The Pigeonhole Principle is a powerful tool for proving existence. It states that if you have more "pigeons" than "pigeonholes," at least one pigeonhole must contain more than one pigeon.

a. Basic Form

If nn items are put into mm containers, with n>mn > m, then at least one container must contain more than one item.

Must Remember

The PHP guarantees existence, not which pigeonhole or how many items beyond the minimum.

b. Generalized Form

If nn items are put into mm containers, then at least one container must contain at least n/m\lceil n/m \rceil items.

📐 Generalized PHP
Minimum items in at least one container=n/m\text{Minimum items in at least one container} = \lceil n/m \rceil

Variables:

    • nn = number of items (pigeons)

    • mm = number of containers (pigeonholes)

    • \lceil \cdot \rceil = ceiling function (rounds up to the nearest integer)


Application: Proving that certain situations must occur, such as duplicate birthdays, shared properties, or minimum counts.

Worked Example:

Problem: In a group of 13 people, show that at least two people must have been born in the same month.

Solution:

Step 1: Identify pigeons and pigeonholes.
Pigeons = 13 people (n=13n=13)
Pigeonholes = 12 months in a year (m=12m=12)

Step 2: Apply the Pigeonhole Principle.
Since n=13>m=12n=13 > m=12, by the basic form of the PHP, at least one month (pigeonhole) must contain more than one person (pigeon).

Answer: At least two people must have been born in the same month.

---

6. Combinatorial Arguments & Problem-Solving Techniques

Many CMI problems require applying counting principles in creative ways, often involving specific arguments like coloring, parity, or systematic enumeration.

a. Tiling and Coloring Arguments

These arguments are often used to prove impossibility in tiling problems. By coloring a grid (e.g., a chessboard) in a specific way, one can show that a certain shape of tile cannot cover the grid, usually because it covers an unequal number of colored squares.

Worked Example:

Problem: Can a 4×44 \times 4 chessboard be perfectly tiled by 1×31 \times 3 trominoes?

Solution:

Step 1: Color the chessboard.
A standard 4×44 \times 4 chessboard has 16 squares. A 1×31 \times 3 tromino covers 3 squares.
If we color the board with 3 colors (0, 1, 2) such that square (i,j)(i,j) has color (i+j)(mod3)(i+j) \pmod 3.






















Count the number of squares of each color:
Color 0: 6 squares (e.g., (0,0), (0,3), (1,2), (2,1), (3,0), (3,3))
Color 1: 5 squares
Color 2: 5 squares

A 1×31 \times 3 tromino, placed horizontally or vertically, will always cover one square of each color (0, 1, 2) in any cyclic permutation.
For example, if it covers (i,j),(i,j+1),(i,j+2)(i,j), (i,j+1), (i,j+2), the colors are (i+j)(mod3)(i+j)\pmod 3, (i+j+1)(mod3)(i+j+1)\pmod 3, (i+j+2)(mod3)(i+j+2)\pmod 3, which are C,C+1,C+2(mod3)C, C+1, C+2 \pmod 3. This means it covers one of each color.

Step 2: Check for divisibility and color count.
The total number of squares is 16. Since a tromino covers 3 squares, if it were possible to tile, the total number of squares (16) must be divisible by 3. 16(mod3)=1016 \pmod 3 = 1 \ne 0. So it's impossible.
Even if the total number of squares were divisible by 3, the coloring argument strengthens the proof. Each tromino covers one square of each color. If the board were perfectly tiled, there must be an equal number of squares of each color. Here, we have 6 squares of color 0, and 5 each of colors 1 and 2. Since the counts are not equal, it's impossible to tile.

Answer: No, a 4×44 \times 4 chessboard cannot be perfectly tiled by 1×31 \times 3 trominoes.

b. Parity Arguments

Parity (whether a number is even or odd) can be used to track changes in a system. If a game or process involves operations that always change the parity of a certain quantity, it can be used to determine if a certain state is reachable.

Worked Example (Conceptual):

Problem: Six children are sitting around a circular table. Each child can be either seated or standing. Initially, all are seated. A game rule is: call out initials of a pair of adjacent children, and they both change their state (seated to standing, or vice versa). Can you reach a state where exactly one child is standing?

Solution:

Step 1: Assign numerical states and track parity.
Let 'seated' be 0 and 'standing' be 1. The state of the system is the sum of the states of all children.
Initially, all are seated, so sum = 0+0+0+0+0+0=00+0+0+0+0+0 = 0 (even parity).
When an adjacent pair changes state:

  • If both were 0 (seated), they become 1 (standing): 0+01+10+0 \to 1+1. Change in sum: +2+2. Parity of sum remains even.

  • If one was 0, one was 1, they become 1, 0: 0+11+00+1 \to 1+0. Change in sum: 00. Parity of sum remains even.

  • If both were 1 (standing), they become 0 (seated): 1+10+01+1 \to 0+0. Change in sum: 2-2. Parity of sum remains even.


Step 2: Analyze the target state.
Target state: exactly one child standing. Sum of states = 1 (odd parity).

Step 3: Conclusion.
Since each operation preserves the even parity of the total number of standing children, it is impossible to reach a state with an odd number of standing children (like exactly one standing).

Answer: No, it is not possible to reach a state where exactly one child is standing.

c. Systematic Enumeration (e.g., Counting Squares on a Grid)

Some problems involve counting objects of varying sizes within a larger structure. This often requires systematic enumeration, possibly leading to a summation formula.

Worked Example:

Problem: How many squares are there on an n×nn \times n chessboard?

Solution:

Step 1: Identify types of squares.
Squares can be of size 1×11 \times 1, 2×22 \times 2, 3×33 \times 3, ..., up to n×nn \times n.

Step 2: Count squares of each size.

  • For 1×11 \times 1 squares: There are nn rows and nn columns, so n×n=n2n \times n = n^2 squares.

  • For 2×22 \times 2 squares: The top-left corner of a 2×22 \times 2 square can be at any position from row 1 to row n1n-1, and column 1 to column n1n-1. So there are (n1)×(n1)=(n1)2(n-1) \times (n-1) = (n-1)^2 squares.

  • For k×kk \times k squares: Similarly, there are (nk+1)×(nk+1)=(nk+1)2(n-k+1) \times (n-k+1) = (n-k+1)^2 squares.

  • This continues until n×nn \times n squares: There is only (nn+1)2=12=1(n-n+1)^2 = 1^2 = 1 such square.


Step 3: Sum the counts.
The total number of squares is the sum of squares of all possible sizes:
Total=n2+(n1)2+(n2)2++12Total = n^2 + (n-1)^2 + (n-2)^2 + \dots + 1^2

This is the sum of the first nn square numbers.

📐 Sum of First n Squares
k=1nk2=n(n+1)(2n+1)6\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}

Variables:

    • nn = dimension of the chessboard


Application: Counting geometric shapes of various sizes on a grid.

Answer: n(n+1)(2n+1)6\frac{n(n+1)(2n+1)}{6} squares. For a 7×77 \times 7 board, this is 7(7+1)(2×7+1)6=7×8×156=7×4×5=140\frac{7(7+1)(2 \times 7+1)}{6} = \frac{7 \times 8 \times 15}{6} = 7 \times 4 \times 5 = 140.

d. Longest Common Subsequence (LCS) - Length and Count

A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. A common subsequence of two strings is a subsequence that is common to both. The Longest Common Subsequence (LCS) is the common subsequence with the greatest length.

While finding the length of an LCS is typically done using dynamic programming, counting the number of distinct LCS can be a combinatorial problem.

Length of LCS:
Let S1S_1 be a string of length mm and S2S_2 be a string of length nn. Let LCS(i,j)LCS(i, j) be the length of the LCS of S1[1i]S_1[1 \dots i] and S2[1j]S_2[1 \dots j].
If S1[i]=S2[j]S_1[i] = S_2[j], then LCS(i,j)=1+LCS(i1,j1)LCS(i,j) = 1 + LCS(i-1, j-1).
If S1[i]S2[j]S_1[i] \ne S_2[j], then LCS(i,j)=max(LCS(i1,j),LCS(i,j1))LCS(i,j) = \max(LCS(i-1, j), LCS(i, j-1)).

Counting Number of LCS:
Let CountLCS(i,j)CountLCS(i, j) be the number of distinct LCS of S1[1i]S_1[1 \dots i] and S2[1j]S_2[1 \dots j].
Base cases: CountLCS(i,0)=1CountLCS(i, 0) = 1 for all i0i \ge 0, CountLCS(0,j)=1CountLCS(0, j) = 1 for all j0j \ge 0. (An empty string has one LCS: the empty string itself).

If S1[i]=S2[j]S_1[i] = S_2[j]:
The characters match, so we extend all LCS of S1[1i1]S_1[1 \dots i-1] and S2[1j1]S_2[1 \dots j-1] by this character.

CountLCS(i,j)=CountLCS(i1,j1)CountLCS(i,j) = CountLCS(i-1, j-1)

If S1[i]S2[j]S_1[i] \ne S_2[j]:
We need to consider the LCS from S1[1i1],S2[1j]S_1[1 \dots i-1], S_2[1 \dots j] and S1[1i],S2[1j1]S_1[1 \dots i], S_2[1 \dots j-1].
Let L1=LCS(i1,j)L_1 = LCS(i-1, j) and L2=LCS(i,j1)L_2 = LCS(i, j-1).
If L1>L2L_1 > L_2: The LCS comes only from S1[1i1],S2[1j]S_1[1 \dots i-1], S_2[1 \dots j].

CountLCS(i,j)=CountLCS(i1,j)CountLCS(i,j) = CountLCS(i-1, j)

If L2>L1L_2 > L_1: The LCS comes only from S1[1i],S2[1j1]S_1[1 \dots i], S_2[1 \dots j-1].
CountLCS(i,j)=CountLCS(i,j1)CountLCS(i,j) = CountLCS(i, j-1)

If L1=L2L_1 = L_2: The LCS can come from both paths. We need to sum the counts. However, we must subtract the count of common subsequences that are counted twice (those formed from S1[1i1],S2[1j1]S_1[1 \dots i-1], S_2[1 \dots j-1]).
CountLCS(i,j)=CountLCS(i1,j)+CountLCS(i,j1)CountLCS(i1,j1)CountLCS(i,j) = CountLCS(i-1, j) + CountLCS(i, j-1) - CountLCS(i-1, j-1)

This subtraction is for the case where the longest common subsequences from LCS(i1,j)LCS(i-1, j) and LCS(i,j1)LCS(i, j-1) also include those from LCS(i1,j1)LCS(i-1, j-1). This is an application of PIE.

Worked Example (Conceptual):

Problem: For strings S1="ABABA"S_1 = \text{"ABABA"} and S2="BABAB"S_2 = \text{"BABAB"}, find the length and number of LCS.

Solution:

Step 1: Compute LCS length table (standard DP).
Length is 4. (e.g., "ABAB", "BABA").

Step 2: Compute LCS count table.
Using the rules above, carefully populate a DP table for counts.
For S1="ABABA"S_1 = \text{"ABABA"}, S2="BABAB"S_2 = \text{"BABAB"}:
LCS length is 4.
The LCS are "ABAB" and "BABA".
The number of LCS is 2.

Answer: Length x=4x=4, Number y=2y=2.

---

7. Connectivity and Design Principles (Elevator Problem Type)

Problems involving resource allocation, connectivity, and constraints on subsets (like the elevator problem) often combine counting with design theory. These problems typically involve:

  • Double Counting: Summing quantities in two different ways to establish an inequality or equality.

  • Extremal Arguments: Determining maximum or minimum possible values under given constraints.

  • Existence Proofs: Showing if a configuration is possible or impossible.
  • Worked Example (Conceptual - based on PYQ 9):

    Problem: There are EE elevators in a mall, each stopping at the ground floor and at most kk other floors. At least rr elevators stop at each floor. It is possible to go from any floor to any other floor without changing elevators. What is the maximum number of floors in the mall?

    Solution Approach:

    Step 1: Define variables.
    Let NN be the total number of floors.
    Let EjE_j be the jj-th elevator, stopping at kjk_j floors (including ground). So kjk+1k_j \le k+1.
    Let FiF_i be the ii-th floor. Let rir_i be the number of elevators stopping at FiF_i. So rirr_i \ge r.

    Step 2: Apply double counting for total stops.
    The total number of (floor, elevator) pairs, where the elevator stops at the floor, can be counted in two ways:
    Sum over elevators: j=1Ekj\sum_{j=1}^E k_j
    Sum over floors: i=1Nri\sum_{i=1}^N r_i
    So, i=1Nri=j=1Ekj\sum_{i=1}^N r_i = \sum_{j=1}^E k_j.
    Using the constraints: rNi=1Nri=j=1EkjE×(k+1)rN \le \sum_{i=1}^N r_i = \sum_{j=1}^E k_j \le E \times (k+1).
    Thus, rNE(k+1)    NE(k+1)rrN \le E(k+1) \implies N \le \frac{E(k+1)}{r}. This gives an upper bound for NN.

    Step 3: Apply connectivity condition (covering pairs).
    "Possible to go from any floor to any other floor without changing elevators" means that for any pair of distinct floors {Fa,Fb}\{F_a, F_b\}, there must be at least one elevator EjE_j that stops at both FaF_a and FbF_b.
    The total number of distinct pairs of floors is (N2)\binom{N}{2}.
    Each elevator EjE_j stops at kjk_j floors, covering (kj2)\binom{k_j}{2} pairs.
    So, (N2)j=1E(kj2)\binom{N}{2} \le \sum_{j=1}^E \binom{k_j}{2}.
    Using the constraint kjk+1k_j \le k+1:
    (N2)E×(k+12)\binom{N}{2} \le E \times \binom{k+1}{2}. This gives another upper bound for NN.

    Step 4: Combine bounds and check for existence.
    The maximum NN must satisfy both upper bounds. The tighter bound will be the maximum.
    For PYQ 9: E=7E=7, k=6k=6 (meaning k+1=7k+1=7 floors per elevator), r=3r=3.
    From Step 2: 3N7×7=49    N49/3=163N \le 7 \times 7 = 49 \implies N \le \lfloor 49/3 \rfloor = 16.
    From Step 3: (N2)7×(72)=7×21=147\binom{N}{2} \le 7 \times \binom{7}{2} = 7 \times 21 = 147.
    N(N1)294N(N-1) \le 294.
    For N=17N=17, 17×16=27229417 \times 16 = 272 \le 294.
    For N=18N=18, 18×17=306>29418 \times 17 = 306 > 294.
    So N17N \le 17.
    Combining both, Nmin(16,17)=16N \le \min(16, 17) = 16.

    Step 5: Check if N=16N=16 is achievable.
    If N=16N=16, then 3×16=483 \times 16 = 48. This means ri48\sum r_i \ge 48.
    Also kj49\sum k_j \le 49.
    So, to achieve N=16N=16, we must have ri=48\sum r_i = 48 or 4949, and kj=48\sum k_j = 48 or 4949.
    If ri=48\sum r_i = 48, then all rir_i must be exactly 3. And kj=48\sum k_j = 48. This means the 7 elevators must visit an average of 48/76.8548/7 \approx 6.85 floors each. For example, six elevators visit 7 floors each, and one visits 6 floors.
    It turns out that a combinatorial design satisfying these conditions (N=16N=16, each floor on exactly 3 elevators, elevators covering specific number of floors, and all pairs connected) does not exist. This is a known result in design theory.
    Therefore, N=16N=16 is not possible. The maximum possible value is N=15N=15.

    Answer: N=15N=15.

    ---

    Problem-Solving Strategies

    💡 CMI Strategy

    • Identify Order Importance: Does the order of selection/arrangement matter? If yes, permutations. If no, combinations.

    • Mutually Exclusive vs. Sequential: Are you choosing between options (Sum Rule) or performing a sequence of steps (Product Rule)?

    • Overlapping Sets: For "or" conditions with overlapping sets, use the Principle of Inclusion-Exclusion.

    • Existence Proofs: When asked to show "at least one" or "guarantee," think Pigeonhole Principle.

    • Impossibility Proofs: Consider coloring arguments or parity arguments, especially for tiling or state-change problems.

    • Systematic Breakdown: For complex counting (e.g., squares on a board), break down into simpler, enumerable cases and sum them up.

    • Double Counting: For problems with two types of entities (e.g., floors and elevators), count the total number of connections/incidences in two ways to derive inequalities.

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • Confusing Permutations and Combinations: Using P(n,r)P(n,r) when order doesn't matter, or (nr)\binom{n}{r} when it does.
    Check: If rearranging selected items creates a different outcome, use permutations. If not, use combinations.
      • Ignoring Overlaps in PIE: Simply adding counts for overlapping sets (e.g., A+B|A|+|B| for AB|A \cup B|).
    Always Subtract Intersections: Remember to subtract AB|A \cap B| for two sets, and adjust for three or more sets.
      • Misapplying PHP: Incorrectly identifying pigeons or pigeonholes, or drawing conclusions beyond existence (e.g., assuming all pigeonholes have more than one pigeon).
    Clearly Define: State nn (pigeons) and mm (pigeonholes) and apply n/m\lceil n/m \rceil correctly.
      • Incorrect Base Cases/Recursion for LCS: Errors in handling matching vs. non-matching characters, especially for counting distinct LCS.
    Careful Table Filling: Systematically fill DP tables for both length and count, paying attention to the specific rules for each cell.
      • Off-by-One Errors: Common in problems involving "less than," "at most," or ranges.
    Test with Small Numbers: Use small examples to verify formulas or logic (e.g., integers less than 100 is 1 to 99, not 1 to 100).
      • Forgetting Factorials for Repetition: Not accounting for identical items when calculating permutations.
    Divide by Factorial of Repeats: Use n!/(n1!n2!nk!)n!/(n_1! n_2! \dots n_k!) for permutations with repetition.

    ---

    Practice Questions

    :::question type="MCQ" question="A standard deck of 52 cards has 4 suits, each with 13 ranks. How many 5-card hands can be formed that contain exactly three aces?" options=["4512","65800","42300","4896"] answer="4512" hint="Break the problem into two independent choices: choosing aces and choosing non-aces." solution="Step 1: Choose 3 aces from the 4 available aces. This is a combination:

    (43)=4!3!(43)!=4!3!1!=4\binom{4}{3} = \frac{4!}{3!(4-3)!} = \frac{4!}{3!1!} = 4

    Step 2: Choose the remaining 2 cards from the non-ace cards. There are 524=4852 - 4 = 48 non-ace cards.

    (482)=48!2!(482)!=48!2!46!=48×472×1=24×47=1128\binom{48}{2} = \frac{48!}{2!(48-2)!} = \frac{48!}{2!46!} = \frac{48 \times 47}{2 \times 1} = 24 \times 47 = 1128

    Step 3: Apply the Product Rule to combine these choices.

    4×1128=45124 \times 1128 = 4512

    Answer: 4512\boxed{4512}"
    :::

    :::question type="NAT" question="How many positive integers less than 500 are divisible by 4 or 6, but not by 10?" answer="133" hint="Use PIE for divisibility by 4 or 6. Then, use PIE again to exclude numbers divisible by 10 from this set." solution="Let U={1,2,,499}U = \{1, 2, \dots, 499\}. Total integers N=499N = 499.

    Step 1: Find integers divisible by 4 or 6.
    Let AA be divisible by 4: A=499/4=124|A| = \lfloor 499/4 \rfloor = 124.
    Let BB be divisible by 6: B=499/6=83|B| = \lfloor 499/6 \rfloor = 83.
    ABA \cap B are divisible by lcm(4,6)=12\text{lcm}(4,6) = 12: AB=499/12=41|A \cap B| = \lfloor 499/12 \rfloor = 41.
    Integers divisible by 4 or 6: AB=A+BAB=124+8341=166|A \cup B| = |A| + |B| - |A \cap B| = 124 + 83 - 41 = 166.

    Step 2: Find integers divisible by 10 that are also divisible by 4 or 6.
    Let CC be divisible by 10. We want to exclude (AB)C(A \cup B) \cap C.
    (AB)C=(AC)(BC)(A \cup B) \cap C = (A \cap C) \cup (B \cap C).
    ACA \cap C are divisible by lcm(4,10)=20\text{lcm}(4,10) = 20: AC=499/20=24|A \cap C| = \lfloor 499/20 \rfloor = 24.
    BCB \cap C are divisible by lcm(6,10)=30\text{lcm}(6,10) = 30: BC=499/30=16|B \cap C| = \lfloor 499/30 \rfloor = 16.
    (AC)(BC)(A \cap C) \cap (B \cap C) are divisible by lcm(20,30)=60\text{lcm}(20,30) = 60: ABC=499/60=8|A \cap B \cap C| = \lfloor 499/60 \rfloor = 8.
    Using PIE for (AC)(BC)(A \cap C) \cup (B \cap C):
    (AB)C=AC+BCABC=24+168=32|(A \cup B) \cap C| = |A \cap C| + |B \cap C| - |A \cap B \cap C| = 24 + 16 - 8 = 32.

    Step 3: Subtract the excluded count from the total of (4 or 6).
    Result = AB(AB)C=16632=134|A \cup B| - |(A \cup B) \cap C| = 166 - 32 = 134.
    Answer: 134\boxed{134}"
    :::

    ---

    💡 Moving Forward

    Now that you understand Elementary Counting Principles, let's explore Permutations and Combinations which builds on these concepts.

    ---

    Part 2: Permutations and Combinations

    Introduction

    Permutations and Combinations form the bedrock of combinatorics, a branch of discrete mathematics focused on counting, arrangement, and selection. In the context of a Masters in Data Science, these techniques are crucial for understanding probability, analyzing algorithms, designing experiments, and working with complex data structures. For the CMI exam, a deep understanding of these concepts is essential, as they frequently appear in various forms, often requiring a combination of different counting principles and advanced problem-solving strategies.

    This chapter will delve into the fundamental principles of counting, exploring how to systematically determine the number of possible arrangements and selections of objects. We will cover linear and circular permutations, basic and constrained combinations, and introduce advanced techniques like the Principle of Inclusion-Exclusion and Derangements, which are vital for tackling more complex counting problems. Mastery of these methods will equip you to approach a wide range of CMI-style questions effectively.

    📖 Combinatorics

    The branch of mathematics dealing with combinations of objects belonging to a finite set in accordance with certain constraints, such as those of graph theory. It is concerned with counting, both as a means and an end, and with certain properties of finite structures.

    ---

    Key Concepts

    1. Fundamental Principles of Counting

    The two most basic principles in combinatorics are the Multiplication Principle and the Addition Principle. They form the basis for solving almost all counting problems.

    1.1. The Multiplication Principle

    If an event can occur in mm ways, and after it occurs, another independent event can occur in nn ways, then the two events can occur in m×nm \times n ways. This principle extends to any number of sequential independent events.

    📐 Multiplication Principle

    If there are kk events, and the ii-th event can occur in nin_i ways, then the total number of ways all kk events can occur in sequence is:

    N=n1×n2××nkN = n_1 \times n_2 \times \dots \times n_k

    Variables:

      • NN = total number of ways

      • nin_i = number of ways for event ii


    When to use: When tasks are performed in sequence or simultaneously, and the choice for one task does not affect the number of choices for subsequent tasks.

    Worked Example:

    Problem: A menu offers 3 appetizers, 5 main courses, and 2 desserts. How many different 3-course meals can be ordered?

    Solution:

    Step 1: Identify the number of choices for each stage of the meal.

    • Appetizer: 3 choices
    • Main Course: 5 choices
    • Dessert: 2 choices
    Step 2: Apply the Multiplication Principle.
    3×5×23 \times 5 \times 2

    Step 3: Calculate the total number of meals.

    3030
    Answer: 30\boxed{30}

    ---

    1.2. The Addition Principle

    If an event can occur in mm ways OR in nn ways, and these two ways cannot occur simultaneously (they are mutually exclusive), then the event can occur in m+nm + n ways. This principle extends to any number of mutually exclusive events.

    📐 Addition Principle

    If there are kk mutually exclusive events, and the ii-th event can occur in nin_i ways, then the total number of ways any one of these events can occur is:

    N=n1+n2++nkN = n_1 + n_2 + \dots + n_k

    Variables:

      • NN = total number of ways

      • nin_i = number of ways for event ii


    When to use: When you have a choice between several distinct, non-overlapping categories or scenarios.

    Worked Example:

    Problem: A student can choose a project from three categories: Programming (4 options), Research (3 options), or Design (2 options). How many total project options are there if they must choose exactly one project?

    Solution:

    Step 1: Identify the number of options in each category.

    • Programming: 4 options
    • Research: 3 options
    • Design: 2 options
    Step 2: Apply the Addition Principle as the choices are mutually exclusive.
    4+3+24 + 3 + 2

    Step 3: Calculate the total number of options.

    99
    Answer: 9\boxed{9}

    ---

    2. Permutations

    A permutation is an arrangement of objects in a specific order. The order of selection matters.

    2.1. Linear Permutations

    The number of ways to arrange nn distinct objects is n!n! (n factorial). The number of ways to arrange kk objects chosen from nn distinct objects is denoted by P(n,k)P(n, k) or nPk_nP_k.

    📐 Permutations of k objects from n
    P(n,k)=n!(nk)!P(n, k) = \frac{n!}{(n-k)!}

    Variables:

      • nn = total number of distinct objects

      • kk = number of objects to arrange


    When to use: When selecting and arranging a subset of distinct items, and the order of arrangement is important.

    Worked Example:

    Problem: In how many ways can 5 different books be arranged on a shelf?

    Solution:

    Step 1: Identify nn (total objects) and kk (objects to arrange).
    Here, n=5n = 5 and k=5k = 5 (all books are arranged).

    Step 2: Apply the permutation formula for all objects.

    P(5,5)=5!P(5, 5) = 5!

    Step 3: Calculate the factorial.

    5!=5×4×3×2×1=1205! = 5 \times 4 \times 3 \times 2 \times 1 = 120
    Answer: 120\boxed{120}

    ---

    2.2. Permutations with Repetition

    If there are nn objects where n1n_1 are of one type, n2n_2 are of another type, ..., nkn_k are of a kk-th type, and n1+n2++nk=nn_1 + n_2 + \dots + n_k = n, then the number of distinct permutations is given by:

    📐 Permutations with Repetition
    Prep(n;n1,n2,,nk)=n!n1!n2!nk!P_{rep}(n; n_1, n_2, \dots, n_k) = \frac{n!}{n_1! n_2! \dots n_k!}

    Variables:

      • nn = total number of objects

      • nin_i = number of identical objects of type ii


    When to use: When arranging a set of objects where some objects are identical.

    Worked Example:

    Problem: How many distinct permutations can be formed using the letters of the word "MISSISSIPPI"?

    Solution:

    Step 1: Count the total number of letters and the frequency of each distinct letter.

    • Total letters n=11n = 11
    • M: nM=1n_M = 1
    • I: nI=4n_I = 4
    • S: nS=4n_S = 4
    • P: nP=2n_P = 2
    Step 2: Apply the formula for permutations with repetition.
    11!1!×4!×4!×2!\frac{11!}{1! \times 4! \times 4! \times 2!}

    Step 3: Calculate the value.

    39,916,8001×24×24×2=39,916,8001152=34,650\frac{39,916,800}{1 \times 24 \times 24 \times 2} = \frac{39,916,800}{1152} = 34,650

    Answer: 34,65034,650

    ---

    2.3. Circular Permutations

    The number of ways to arrange nn distinct objects in a circle is (n1)!(n-1)!. This is because in a circular arrangement, rotations of the same arrangement are considered identical. We fix one object's position to eliminate these rotations.

    📐 Circular Permutations
    Pcirc(n)=(n1)!P_{circ}(n) = (n-1)!

    Variables:

      • nn = total number of distinct objects


    When to use: When arranging distinct objects in a circle, and arrangements are considered the same if one can be rotated into another.

    If arrangements are considered the same when reflected (e.g., beads on a necklace), the formula changes to (n1)!2\frac{(n-1)!}{2} for n3n \ge 3.

    Worked Example:

    Problem: 5 friends are to be seated around a circular table. In how many distinct ways can they be seated?

    Solution:

    Step 1: Identify nn (total distinct objects).
    Here, n=5n=5.

    Step 2: Apply the circular permutation formula.

    (51)!(5-1)!

    Step 3: Calculate the factorial.

    4!=4×3×2×1=244! = 4 \times 3 \times 2 \times 1 = 24

    Answer: 2424

    ---

    2.4. Permutations with Constraints (Grouping and Alternating)

    Many problems involve placing restrictions on arrangements, such as certain objects always sitting together or alternating positions.

    Grouping Method: When items must sit together, treat them as a single unit. Arrange this unit with the other items, then arrange the items within the unit.

    Alternating Arrangements: For alternating patterns (e.g., male/female, DS/CS students), consider arranging one group first, then placing the other group in the gaps.

    Worked Example (Grouping):

    Problem: 5 people (A, B, C, D, E) are to be seated in a row. In how many ways can they be seated if A and B must sit together?

    Solution:

    Step 1: Treat A and B as a single unit.
    Now we are arranging 4 "items": (AB), C, D, E.

    Step 2: Arrange these 4 items linearly.

    4!=244! = 24

    Step 3: Consider the internal arrangement of the unit (AB).
    A and B can sit as AB or BA. So there are 2!2! ways to arrange them.

    2!=22! = 2

    Step 4: Multiply the arrangements of the units by the internal arrangements.

    24×2=4824 \times 2 = 48

    Answer: 4848

    ---

    Worked Example (Alternating):

    Problem: 3 boys and 3 girls are to be seated in a row such that no two students of the same gender sit next to each other.

    Solution:

    Step 1: Consider the possible alternating patterns.
    Since there are equal numbers of boys and girls, the patterns must be B G B G B G or G B G B G B.

    Step 2: Calculate arrangements for the first pattern (B G B G B G).
    Arrange the 3 boys in 3!3! ways. Arrange the 3 girls in 3!3! ways.

    3!×3!=(6)×(6)=363! \times 3! = (6) \times (6) = 36

    Step 3: Calculate arrangements for the second pattern (G B G B G B).
    Similarly, 3!×3!=363! \times 3! = 36.

    Step 4: Add the results for the mutually exclusive patterns.

    36+36=7236 + 36 = 72

    Answer: 7272

    ---

    3. Combinations

    A combination is a selection of objects where the order of selection does not matter. The number of ways to choose kk objects from nn distinct objects is denoted by (nk)\binom{n}{k} or C(n,k)C(n, k) or nCk_nC_k.

    📐 Combinations of k objects from n
    (nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!}

    Variables:

      • nn = total number of distinct objects

      • kk = number of objects to choose


    When to use: When selecting a subset of distinct items, and the order of selection is not important.

    Worked Example:

    Problem: A committee of 3 members is to be chosen from a group of 8 people. How many different committees can be formed?

    Solution:

    Step 1: Identify nn (total objects) and kk (objects to choose).
    Here, n=8n=8 and k=3k=3. Order does not matter for committee members.

    Step 2: Apply the combination formula.

    (83)=8!3!(83)!=8!3!5!\binom{8}{3} = \frac{8!}{3!(8-3)!} = \frac{8!}{3!5!}

    Step 3: Calculate the value.

    8×7×6×5!3×2×1×5!=8×7×63×2×1=8×7=56\frac{8 \times 7 \times 6 \times 5!}{3 \times 2 \times 1 \times 5!} = \frac{8 \times 7 \times 6}{3 \times 2 \times 1} = 8 \times 7 = 56

    Answer: 5656

    ---

    3.1. Combinations with Repetition (Stars and Bars)

    This technique is used to count the number of ways to distribute kk identical items into nn distinct bins, or to select kk items from nn types with replacement.

    📐 Stars and Bars

    The number of ways to distribute kk identical items into nn distinct bins is:

    (k+n1k)or(k+n1n1)\binom{k+n-1}{k} \quad \text{or} \quad \binom{k+n-1}{n-1}

    Variables:

      • kk = number of identical items (stars)

      • nn = number of distinct bins (categories or variables)


    When to use: Distributing identical items, selecting items with replacement, or finding non-negative integer solutions to x1+x2++xn=kx_1 + x_2 + \dots + x_n = k.

    Worked Example:

    Problem: In how many ways can 10 identical chocolate bars be distributed among 5 children?

    Solution:

    Step 1: Identify kk (identical items) and nn (distinct bins).
    Here, k=10k=10 (chocolate bars) and n=5n=5 (children).

    Step 2: Apply the Stars and Bars formula.

    (10+5110)=(1410)\binom{10+5-1}{10} = \binom{14}{10}

    Step 3: Calculate the value.

    (1410)=(141410)=(144)=14×13×12×114×3×2×1=14×13×112=1001\binom{14}{10} = \binom{14}{14-10} = \binom{14}{4} = \frac{14 \times 13 \times 12 \times 11}{4 \times 3 \times 2 \times 1} = 14 \times 13 \times \frac{11}{2} = 1001

    Answer: 10011001

    ---

    ---

    Constraint: Each bin gets at least one item.
    If each of the nn bins must receive at least one item, we first place one item in each bin. This leaves knk-n items to distribute among nn bins without further restrictions.

    📐 Stars and Bars (with minimum 1 per bin)

    The number of ways to distribute kk identical items into nn distinct bins such that each bin gets at least one item is:

    (k1n1)\binom{k-1}{n-1}

    Variables:

      • kk = total identical items

      • nn = number of distinct bins

    Condition: knk \ge n

    When to use: Distributing identical items with a minimum quantity requirement for each recipient.

    Worked Example:

    Problem: In how many ways can 10 identical chocolate bars be distributed among 5 children, such that each child gets at least one chocolate bar?

    Solution:

    Step 1: Identify kk (total items) and nn (total bins).
    Here, k=10k=10 and n=5n=5.

    Step 2: Apply the Stars and Bars formula with the minimum requirement.

    (10151)=(94)\binom{10-1}{5-1} = \binom{9}{4}

    Step 3: Calculate the value.

    (94)=9×8×7×64×3×2×1=9×2×7=126\binom{9}{4} = \frac{9 \times 8 \times 7 \times 6}{4 \times 3 \times 2 \times 1} = 9 \times 2 \times 7 = 126

    Answer: \boxed{126}

    ---

    4. Advanced Counting Techniques

    4.1. Principle of Inclusion-Exclusion (PIE)

    PIE is used to find the size of the union of multiple sets. For two sets A and B:
    AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|

    For three sets A, B, and C:
    ABC=A+B+C(AB+AC+BC)+ABC|A \cup B \cup C| = |A| + |B| + |C| - (|A \cap B| + |A \cap C| + |B \cap C|) + |A \cap B \cap C|

    In general, for NN sets, it involves summing the sizes of individual sets, subtracting the sizes of all pairwise intersections, adding the sizes of all three-way intersections, and so on, alternating signs.

    📐 Principle of Inclusion-Exclusion (General)

    For nn sets A1,A2,,AnA_1, A_2, \dots, A_n:

    i=1nAi=iAii<jAiAj+i<j<kAiAjAk+(1)n1A1An|\bigcup_{i=1}^n A_i| = \sum_{i} |A_i| - \sum_{i<j} |A_i \cap A_j| + \sum_{i<j<k} |A_i \cap A_j \cap A_k| - \dots + (-1)^{n-1} |A_1 \cap \dots \cap A_n|

    When to use: When counting elements that satisfy at least one of several properties, especially when the properties overlap.

    4.2. Derangements

    A derangement is a permutation of objects such that no object ends up in its original position (i.e., no fixed points). The number of derangements of nn objects is denoted by DnD_n or !n!n.

    📐 Number of Derangements
    Dn=n!k=0n(1)kk!=n!(10!11!+12!+(1)nn!)D_n = n! \sum_{k=0}^{n} \frac{(-1)^k}{k!} = n! \left( \frac{1}{0!} - \frac{1}{1!} + \frac{1}{2!} - \dots + \frac{(-1)^n}{n!} \right)

    For large nn, Dnn!eD_n \approx \frac{n!}{e}.

    Variables:

      • nn = number of distinct objects


    When to use: When counting arrangements where no object is in its original or "correct" position. Classic problems involve letters in envelopes, coats in a checkroom.

    Worked Example:

    Problem: Four friends leave their coats at a checkroom. In how many ways can they each receive a coat that does not belong to them?

    Solution:

    Step 1: Identify nn (number of objects to be deranged).
    Here, n=4n=4.

    Step 2: Apply the derangement formula.

    D4=4!(10!11!+12!13!+14!)D_4 = 4! \left( \frac{1}{0!} - \frac{1}{1!} + \frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!} \right)

    Step 3: Calculate the value.

    D4=24(11+1216+124)D_4 = 24 \left( 1 - 1 + \frac{1}{2} - \frac{1}{6} + \frac{1}{24} \right)
    D4=24(1224424+124)D_4 = 24 \left( \frac{12}{24} - \frac{4}{24} + \frac{1}{24} \right)
    D4=24(924)=9D_4 = 24 \left( \frac{9}{24} \right) = 9

    Answer: \boxed{9}

    ---

    4.3. Functions and Mappings

    Counting different types of functions between sets AA and BB, where A=m|A|=m and B=n|B|=n.

  • Total functions: Each of the mm elements in AA can map to any of the nn elements in BB. So, nmn^m.

  • Injective (one-to-one) functions: Each element of AA maps to a unique element of BB. This requires mnm \le n. The number of ways is P(n,m)=n!(nm)!P(n, m) = \frac{n!}{(n-m)!}.

  • Bijective (one-to-one and onto) functions: Each element of AA maps to a unique element of BB, and every element of BB is mapped to. This requires m=nm=n. The number of ways is n!n!. These are essentially permutations.

  • Surjective (onto) functions: Every element in BB must be mapped to by at least one element from AA. This requires mnm \ge n. The number of surjective functions can be found using PIE or Stirling Numbers of the Second Kind.

  • The number of surjective functions from a set of size mm to a set of size nn is:
    n!S(m,n)n! S(m, n)

    where S(m,n)S(m, n) is a Stirling number of the second kind.
    Alternatively, using PIE:
    k=0n(1)k(nk)(nk)m\sum_{k=0}^{n} (-1)^k \binom{n}{k} (n-k)^m

    Idempotent Functions (ff=ff \circ f = f):
    A function f:XXf: X \to X such that f(f(x))=f(x)f(f(x)) = f(x) for all xXx \in X.
    If yy is in the range of ff (i.e., y=f(x)y=f(x) for some xx), then f(y)=yf(y)=y. This means all elements in the range are fixed points.
    To count idempotent functions:
    Step 1: Choose the kk elements that form the range. (nk)\binom{n}{k} ways.
    Step 2: For each of these kk range elements, they must map to themselves (fixed points). kkk^k maps.
    Step 3: For the remaining nkn-k elements in the domain (not in the range), each must map to one of the kk chosen range elements. knkk^{n-k} ways.
    So, for a fixed range size kk: (nk)knk\binom{n}{k} k^{n-k}.
    Sum this over all possible range sizes kk from 11 to nn: k=1n(nk)knk\sum_{k=1}^{n} \binom{n}{k} k^{n-k}.

    Worked Example (Idempotent Functions):

    Problem: Let SS be the set of all functions from {1,2,3}\{1,2,3\} to {1,2,3}\{1,2,3\} such that ff=ff \circ f = f. Compute the number of functions fSf \in S.

    Solution:

    Step 1: Use the formula k=1n(nk)knk\sum_{k=1}^{n} \binom{n}{k} k^{n-k} for n=3n=3.

    Step 2: Calculate for k=1k=1:
    Range size 1: Choose 1 element for range (31)\binom{3}{1}. The 3 domain elements map to this 1 range element.

    (31)131=3×12=3\binom{3}{1} 1^{3-1} = 3 \times 1^2 = 3

    Step 3: Calculate for k=2k=2:
    Range size 2: Choose 2 elements for range (32)\binom{3}{2}. The 3 domain elements must map to these 2 range elements, with the 2 range elements being fixed points.

    (32)232=3×21=6\binom{3}{2} 2^{3-2} = 3 \times 2^1 = 6

    Step 4: Calculate for k=3k=3:
    Range size 3: Choose 3 elements for range (33)\binom{3}{3}. The 3 domain elements map to these 3 range elements, with the 3 range elements being fixed points. This implies a bijection to the range itself.

    (33)333=1×30=1\binom{3}{3} 3^{3-3} = 1 \times 3^0 = 1

    Step 5: Sum the results.

    3+6+1=103 + 6 + 1 = 10

    Answer: \boxed{10}

    ---

    4.4. Catalan Numbers

    Catalan numbers (CnC_n) are a sequence of natural numbers that appear in various counting problems, often involving recursive structures.

    📐 Catalan Numbers
    Cn=1n+1(2nn)C_n = \frac{1}{n+1} \binom{2n}{n}

    Variables:

      • nn = index of the Catalan number


      When to use: Counting problems like:
      • Number of Dyck paths of length 2n2n.

      • Number of ways to parenthesize n+1n+1 factors.

      • Number of full binary trees with n+1n+1 leaves (or nn internal nodes).

      • Number of binary trees with nn nodes.

    For binary trees with nn nodes, the formula is CnC_n.
    C0=1C_0 = 1 (empty tree)
    C1=1C_1 = 1 (single root)
    C2=13(42)=13×6=2C_2 = \frac{1}{3}\binom{4}{2} = \frac{1}{3} \times 6 = 2
    C3=14(63)=14×20=5C_3 = \frac{1}{4}\binom{6}{3} = \frac{1}{4} \times 20 = 5
    C4=15(84)=15×70=14C_4 = \frac{1}{5}\binom{8}{4} = \frac{1}{5} \times 70 = 14











































    The diagram shows the 5 binary trees with 3 nodes (C3=5C_3=5).

    ---

    4.5. Permutation Cycles and Order

    A permutation can be decomposed into disjoint cycles. For example, σ=(1 2 3)(4 5)\sigma = (1\ 2\ 3)(4\ 5).

    • Cycle Length: The number of elements in a cycle.
    • Order of a Permutation: The smallest positive integer kk such that σk\sigma^k is the identity permutation. It is the least common multiple (LCM) of the lengths of its disjoint cycles.
    Worked Example:

    Problem: Consider the permutation

    σ=(123456234516)\sigma = \begin{pmatrix} 1 & 2 & 3 & 4 & 5 & 6 \\ 2 & 3 & 4 & 5 & 1 & 6 \end{pmatrix}

    Find its cycle decomposition and order.

    Solution:

    Step 1: Trace the cycles.
    Start with 1: 1234511 \to 2 \to 3 \to 4 \to 5 \to 1. This forms a cycle (1 2 3 4 5)(1\ 2\ 3\ 4\ 5).
    The remaining element is 6: 666 \to 6. This forms a cycle (6)(6).

    Step 2: Write the cycle decomposition.

    σ=(1 2 3 4 5)(6)\sigma = (1\ 2\ 3\ 4\ 5)(6)

    Step 3: Find the lengths of the disjoint cycles.
    Lengths are 5 and 1.

    Step 4: Calculate the LCM of the cycle lengths.

    LCM(5,1)=5\operatorname{LCM}(5, 1) = 5

    Answer: \boxed{\text{Cycle decomposition is } (1\ 2\ 3\ 4\ 5)(6), \text{ and its order is } 5.}

    ---

    Problem-Solving Strategies

    💡 CMI Strategy

    • Understand the "Order Matters" vs. "Order Doesn't Matter" Distinction: This is the most critical first step. Permutations when order matters, combinations when it doesn't.

    • Break Down Complex Problems: Use the Multiplication and Addition Principles. If a problem has multiple stages, multiply the ways for each stage. If there are mutually exclusive cases, add their counts.

    • Handle Constraints Carefully:

    • "Together" constraint: Treat the group as a single unit. Don't forget to account for internal arrangements within the unit.
      "Not Together" constraint: Often easier to use complementary counting: (Total arrangements) - (Arrangements where they are
      together).
      * "At least/At most" constraint: Break into cases or use complementary counting. "At least one" often uses (Total) - (None).
    • Identical vs. Distinct Items: This determines whether you use standard permutations/combinations or Stars and Bars.

    • Circular Arrangements: Remember to fix one position to avoid overcounting rotations, leading to (n1)!(n-1)!.

    • Fixed Points/Derangements: Recognize when the problem requires no object to be in its original position.

    • Functions: Understand the definitions of injective, surjective, bijective, and idempotent functions and their corresponding counting formulas.

    • Re-read the Question: A small detail (like "leader from class XII" or "exactly two distinct digits") can change the entire approach.

    ---

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • Confusing Permutations and Combinations: Using (nk)\binom{n}{k} when order matters, or P(n,k)P(n,k) when it doesn't.
    ✅ Always ask: "Does the arrangement/order of the selected items change the outcome?" If yes, permutation. If no, combination.
      • Overcounting in Circular Permutations: Forgetting to divide by nn (or using (n1)!(n-1)!) when rotations are identical.
    ✅ For distinct objects in a circle, it's (n1)!(n-1)!. For items on a necklace (reflection symmetry), it's (n1)!2\frac{(n-1)!}{2}.
      • Ignoring Internal Arrangements: When grouping items together (e.g., A and B must sit together), forgetting to multiply by the ways the grouped items can arrange themselves (2!2! for A and B).
    ✅ Treat the group as one unit, arrange units, then arrange within the group.
      • Misapplying Stars and Bars: Using Stars and Bars for distinct items, or standard combinations for identical items. Forgetting to adjust kk for "at least one" constraints.
    ✅ Stars and Bars is for identical items into distinct bins. For "at least one", pre-allocate one item to each bin, then apply Stars and Bars to the remainder.
      • Incorrectly Using PIE: Missing terms (e.g., not subtracting all pairwise intersections), or getting the signs wrong.
    ✅ Systematically list all properties, then apply the formula S1S2+S3S_1 - S_2 + S_3 - \dots.
      • Assuming Independence: Applying the Multiplication Principle when events are dependent (e.g., drawing cards without replacement).
    ✅ Ensure choices for one step don't change the number of options for subsequent steps, or adjust the options accordingly.
      • Errors with Digit Problems: Forgetting that '0' cannot be the leading digit for numbers, or miscounting 'distinct digits' vs 'any digits'.
    ✅ Always consider the position of 0 and the distinctness requirement.

    ---

    Practice Questions

    :::question type="MCQ" question="A committee of 7 members is to be formed from 10 men and 8 women. How many committees can be formed if there must be at least 3 men and at least 3 women?" options=["(103)(84)+(104)(83)\binom{10}{3}\binom{8}{4} + \binom{10}{4}\binom{8}{3}","(103)(84)+(104)(83)+(105)(82)\binom{10}{3}\binom{8}{4} + \binom{10}{4}\binom{8}{3} + \binom{10}{5}\binom{8}{2}","(103)(84)+(104)(83)+(105)(82)+(102)(85)\binom{10}{3}\binom{8}{4} + \binom{10}{4}\binom{8}{3} + \binom{10}{5}\binom{8}{2} + \binom{10}{2}\binom{8}{5}","(187)(committees with <3 men or <3 women)\binom{18}{7} - (\text{committees with <3 men or <3 women})"] answer="(103)(84)+(104)(83)\binom{10}{3}\binom{8}{4} + \binom{10}{4}\binom{8}{3}" hint="Consider the possible valid combinations of men and women that sum to 7, satisfying the minimums for both genders." solution="Let MM be the number of men and WW be the number of women chosen. We need M+W=7M+W=7, with M3M \ge 3 and W3W \ge 3.

    Possible combinations for (M,W)(M, W):

  • If M=3M=3, then W=4W=4. Number of ways: (103)(84)\binom{10}{3}\binom{8}{4}

  • If M=4M=4, then W=3W=3. Number of ways: (104)(83)\binom{10}{4}\binom{8}{3}
  • If M=2M=2, W=5W=5, but this violates M3M \ge 3.
    If M=5M=5, W=2W=2, but this violates W3W \ge 3.

    So, these are the only two valid cases. Since these cases are mutually exclusive, we add the number of ways for each case.

    Total ways = (103)(84)+(104)(83)\binom{10}{3}\binom{8}{4} + \binom{10}{4}\binom{8}{3}"
    :::

    :::question type="NAT" question="Six distinct books are to be arranged on a shelf. Three specific books (A, B, C) must always be kept together in that specific order (ABC). How many distinct arrangements are possible?" answer="24" hint="Treat the fixed sequence of books as a single unit." solution="Step 1: Treat the three specific books (A, B, C) as a single block 'ABC'.
    Step 2: Now we are arranging this block 'ABC' and the remaining 63=36-3=3 books. So, we are arranging 4 items (the block and 3 individual books).
    Step 3: The number of ways to arrange these 4 distinct items is 4!4!.

    4!=4×3×2×1=244! = 4 \times 3 \times 2 \times 1 = 24

    Since the order of A, B, C within their block is fixed as 'ABC', there is only 1 way to arrange them internally."
    :::

    :::question type="MSQ" question="Which of the following statements about permutations and combinations are true?" options=["The number of ways to choose kk items from nn distinct items is (nk)\binom{n}{k}.","The number of ways to arrange nn distinct items in a line is n!n!.","The number of ways to distribute kk identical items into nn distinct bins such that each bin gets at least one item is (k1n1)\binom{k-1}{n-1}.","The number of bijective functions from a set of size mm to a set of size nn is nmn^m." ] answer="A,B,C" hint="Review the definitions and formulas for basic combinations, linear permutations, Stars and Bars with minimums, and bijective functions." solution="A. True. This is the definition of combinations.
    B. True. This is the definition of linear permutations of nn distinct items.
    C. True. This is the formula for Stars and Bars with the constraint that each bin receives at least one item.
    D. False. The number of bijective functions from a set of size mm to a set of size nn is m!m! if m=nm=n, and 0 otherwise. nmn^m is the total number of functions from a set of size mm to a set of size nn."
    :::

    :::question type="SUB" question="Derive the formula for the number of ways to distribute kk identical items into nn distinct bins using the Stars and Bars method, assuming each bin can be empty." answer="The number of ways is (k+n1k)\binom{k+n-1}{k} or (k+n1n1)\binom{k+n-1}{n-1}." hint="Represent the identical items as 'stars' and the divisions between bins as 'bars'. Consider how many positions are available for stars and bars." solution="Step 1: Represent the kk identical items as kk 'stars' (*).

    (k stars) \dots \quad (k \text{ stars})

    Step 2: To divide these kk stars into nn distinct bins, we need n1n-1 'bars' (|). For example, if n=3n=3, we need 22 bars to create 3 bins.

    | | \dots *

    Step 3: Imagine we have a total of kk stars and n1n-1 bars. These k+(n1)k + (n-1) symbols must be arranged in a line. The arrangement of these symbols uniquely determines the distribution of stars into bins. For instance, stars before the first bar go into bin 1, stars between the first and second bar go into bin 2, and so on.

    Step 4: The total number of positions for these symbols is k+n1k + n - 1. We need to choose kk of these positions to be stars (the remaining n1n-1 positions will automatically be bars), OR we need to choose n1n-1 of these positions to be bars (the remaining kk positions will automatically be stars).

    Step 5: Using the combination formula, the number of ways to choose kk positions for stars from k+n1k+n-1 total positions is (k+n1k)\binom{k+n-1}{k}.
    Alternatively, the number of ways to choose n1n-1 positions for bars from k+n1k+n-1 total positions is (k+n1n1)\binom{k+n-1}{n-1}.

    Since (NK)=(NNK)\binom{N}{K} = \binom{N}{N-K}, these two expressions are equivalent:

    (k+n1k)=((k+n1)kk+n1)=(k+n1n1)\binom{k+n-1}{k} = \binom{(k+n-1) - k}{k+n-1} = \binom{k+n-1}{n-1}

    Thus, the formula for distributing kk identical items into nn distinct bins is (k+n1k)\binom{k+n-1}{k} or (k+n1n1)\binom{k+n-1}{n-1}."
    :::

    :::question type="MCQ" question="In a round-robin chess tournament with 8 players, each player plays every other player exactly once. How many games are played in total?" options=["16","28","56","64"] answer="28" hint="The order of players in a game doesn't matter (Player A vs Player B is the same as Player B vs Player A)." solution="Step 1: Identify nn (total players) and kk (players in each game).
    Here, n=8n=8 players. Each game involves 2 players, so k=2k=2.
    Step 2: Determine if order matters.
    In a chess game between two players, the order in which they are chosen does not matter (Player 1 vs Player 2 is the same game as Player 2 vs Player 1). Therefore, this is a combination problem.
    Step 3: Apply the combination formula (nk)\binom{n}{k}.

    (82)=8!2!(82)!=8!2!6!\binom{8}{2} = \frac{8!}{2!(8-2)!} = \frac{8!}{2!6!}

    Step 4: Calculate the value.

    8×7×6!2×1×6!=8×72=4×7=28\frac{8 \times 7 \times 6!}{2 \times 1 \times 6!} = \frac{8 \times 7}{2} = 4 \times 7 = 28

    Total games played are 28."
    :::

    :::question type="NAT" question="A 5-digit number is to be formed using the digits {0, 1, 2, 3, 4} without repetition. How many such numbers are even?" answer="60" hint="An even number must end in an even digit (0, 2, or 4). Consider cases based on the last digit and the first digit." solution="A 5-digit number cannot start with 0. An even number must end with an even digit (0, 2, 4).

    Case 1: The number ends with 0.
    - Last digit: 1 choice (0)
    - First digit: 4 choices (1, 2, 3, 4, since 0 is used and it cannot be 0)
    - Remaining 3 digits: 41=34-1=3 digits left for the remaining 52=35-2=3 positions. These can be arranged in 3!3! ways.
    - Number of ways: 1×4×3!=1×4×6=241 \times 4 \times 3! = 1 \times 4 \times 6 = 24

    Case 2: The number ends with 2.
    - Last digit: 1 choice (2)
    - First digit: 3 choices (1, 3, 4, since 0 cannot be the first digit and 2 is used)
    - Remaining 3 digits: 52=35-2=3 digits left for the remaining 3 positions. These can be arranged in 3!3! ways.
    - Number of ways: 1×3×3!=1×3×6=181 \times 3 \times 3! = 1 \times 3 \times 6 = 18

    Case 3: The number ends with 4.
    - Last digit: 1 choice (4)
    - First digit: 3 choices (1, 2, 3, since 0 cannot be the first digit and 4 is used)
    - Remaining 3 digits: 52=35-2=3 digits left for the remaining 3 positions. These can be arranged in 3!3! ways.
    - Number of ways: 1×3×3!=1×3×6=181 \times 3 \times 3! = 1 \times 3 \times 6 = 18

    Total even numbers = Sum of ways from all cases (Addition Principle).

    24+18+18=6024 + 18 + 18 = 60
    "
    :::

    ---

    Summary

    Key Takeaways for CMI

    • Fundamental Principles are Paramount: Master the Multiplication and Addition Principles, as they underpin all other counting techniques. Break down complex problems into sequences of choices or mutually exclusive cases.

    • Distinguish Permutations and Combinations: Order matters for permutations (P(n,k)P(n,k)), order does not matter for combinations ((nk)\binom{n}{k}). Always identify this first.

    • Handle Constraints Systematically: Grouping for "together", complementary counting for "not together", and careful case analysis for "at least/at most" or digit restrictions are crucial.

    • Stars and Bars for Identical Items: Use (k+n1k)\binom{k+n-1}{k} for distributing kk identical items into nn distinct bins (can be empty), and (k1n1)\binom{k-1}{n-1} for "at least one" constraint.

    • Derangements and PIE for Advanced Counting: Recognize problems requiring no fixed points (DnD_n) or situations where direct counting is hard due to overlaps (PIE).

    • Understand Function Types: Know how to count total, injective, surjective, bijective, and especially idempotent functions, as these are common CMI question types.

    • Circular Permutations: Remember the (n1)!(n-1)! adjustment for distinct items in a circle.

    • Catalan Numbers: Be aware of their applications, especially in counting binary trees.

    ---

    What's Next?

    💡 Continue Learning

    This topic connects to:

      • Probability Theory: Permutations and Combinations are foundational for calculating probabilities of events, especially in discrete probability where outcomes are counted.

      • Graph Theory: Counting paths, cycles, and specific graph structures often relies on combinatorial principles. Tournament problems, for instance, can be viewed as complete graphs with directed edges.

      • Algorithm Analysis: Combinatorial methods are used to count the number of operations or possible inputs for algorithms, impacting their complexity analysis.

      • Set Theory and Functions: A deeper understanding of mappings and relations, especially for counting specific types of functions, builds directly on combinatorics.


    Master these connections for comprehensive CMI preparation!

    ---

    💡 Moving Forward

    Now that you understand Permutations and Combinations, let's explore The Binomial Theorem which builds on these concepts.

    ---

    Part 3: The Binomial Theorem

    Introduction

    The Binomial Theorem is a fundamental principle in combinatorics and algebra, providing a systematic method for expanding expressions of the form (x+y)n(x+y)^n for any non-negative integer nn. It is essential for understanding polynomial expansions, probability distributions, and various counting problems. This topic builds foundational skills in manipulating algebraic expressions and understanding combinatorial identities, which are critical for advanced topics in discrete mathematics and data science applications, such as analyzing algorithms involving selections or distributions.

    This section will thoroughly cover the definition of binomial coefficients, the Binomial Theorem itself, and its generalization, the Multinomial Theorem. Mastery of these concepts is crucial for solving problems involving combinations, probability calculations, and coefficient extraction in polynomial series, frequently encountered in CMI examinations.

    📖 Binomial Coefficient

    For non-negative integers nn and kk with 0kn0 \le k \le n, the binomial coefficient, denoted as (nk)\binom{n}{k} (read as "n choose k"), is defined as:

    (nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!}

    This represents the number of ways to choose kk distinct items from a set of nn distinct items without regard to the order of selection.

    ---

    ---

    Key Concepts

    1. Properties of Binomial Coefficients

    Binomial coefficients possess several important properties that simplify calculations and derivations.

    Property 1: Symmetry

    📐 Symmetry Property
    (nk)=(nnk)\binom{n}{k} = \binom{n}{n-k}

    Variables:

      • nn = total number of items

      • kk = number of items chosen


    When to use: To simplify calculations by choosing the smaller kk or (nk)(n-k), or to recognize equivalent combinatorial quantities.

    Proof:

    Step 1: Start with the definition of (nk)\binom{n}{k}

    (nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!}

    Step 2: Start with the definition of (nnk)\binom{n}{n-k}

    (nnk)=n!(nk)!(n(nk))!\binom{n}{n-k} = \frac{n!}{(n-k)!(n-(n-k))!}

    Step 3: Simplify the denominator for (nnk)\binom{n}{n-k}

    (nnk)=n!(nk)!k!\binom{n}{n-k} = \frac{n!}{(n-k)!k!}

    Step 4: Compare the two expressions
    Since k!(nk)!=(nk)!k!k!(n-k)! = (n-k)!k!, we have (nk)=(nnk)\binom{n}{k} = \binom{n}{n-k}.

    Property 2: Base Cases

    📐 Base Cases
    (n0)=1\binom{n}{0} = 1
    (nn)=1\binom{n}{n} = 1

    Variables:

      • nn = total number of items


    When to use: For direct substitution in expansions or proofs.

    Proof:

    Step 1: For (n0)\binom{n}{0}, apply the definition

    (n0)=n!0!(n0)!\binom{n}{0} = \frac{n!}{0!(n-0)!}

    Step 2: Use the convention 0!=10! = 1

    (n0)=n!1n!=1\binom{n}{0} = \frac{n!}{1 \cdot n!} = 1

    Step 3: For (nn)\binom{n}{n}, apply the definition

    (nn)=n!n!(nn)!\binom{n}{n} = \frac{n!}{n!(n-n)!}

    Step 4: Simplify the expression

    (nn)=n!n!0!=n!n!1=1\binom{n}{n} = \frac{n!}{n!0!} = \frac{n!}{n! \cdot 1} = 1

    Property 3: Pascal's Identity

    📐 Pascal's Identity
    (nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}

    Variables:

      • nn = total number of items

      • kk = number of items chosen


    When to use: For recursive calculations of binomial coefficients or in proofs involving combinatorial identities.

    Proof (Combinatorial Argument):
    Consider a set SS of nn distinct items. We want to choose kk items from SS. The total number of ways to do this is (nk)\binom{n}{k}.

    Let's pick one specific item from the set, say item 'A'. When choosing kk items from SS, there are two mutually exclusive possibilities:

  • Item 'A' is included in the selection: If 'A' is included, we need to choose k1k-1 additional items from the remaining n1n-1 items (all items except 'A'). The number of ways to do this is (n1k1)\binom{n-1}{k-1}.
  • Item 'A' is NOT included in the selection: If 'A' is not included, we need to choose all kk items from the remaining n1n-1 items (all items except 'A'). The number of ways to do this is (n1k)\binom{n-1}{k}.
  • Since these two cases cover all possibilities and are mutually exclusive, the total number of ways to choose kk items from nn is the sum of the ways in these two cases:

    (nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}

    This completes the combinatorial proof.

    ---

    2. The Binomial Theorem

    The Binomial Theorem provides a formula for the algebraic expansion of powers of a binomial (x+y)n(x+y)^n.

    📐 The Binomial Theorem

    For any non-negative integer nn:

    (x+y)n=k=0n(nk)xnkyk(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k

    Variables:

      • nn = the exponent of the binomial

      • kk = the index of the term in the sum (ranging from 00 to nn)

      • x,yx, y = the terms of the binomial

      • (nk)\binom{n}{k} = the binomial coefficient


    When to use: To expand binomial expressions, find specific terms or coefficients in an expansion, or derive combinatorial identities.

    Proof (Combinatorial Argument):
    Consider the expansion of (x+y)n(x+y)^n:

    (x+y)n=(x+y)(x+y)(x+y)(n times)(x+y)^n = (x+y)(x+y)\dots(x+y) \quad \text{(nn times)}

    When we expand this product, each term in the result is obtained by choosing either xx or yy from each of the nn factors. A generic term will be of the form xnkykx^{n-k}y^k, where kk is the number of times yy is chosen (and nkn-k is the number of times xx is chosen).

    To find the coefficient of xnkykx^{n-k}y^k, we need to determine how many ways we can choose yy from kk of the nn factors (and xx from the remaining nkn-k factors). This is precisely the definition of a binomial coefficient: the number of ways to choose kk positions for yy out of nn available positions is (nk)\binom{n}{k}.

    Therefore, the coefficient of xnkykx^{n-k}y^k is (nk)\binom{n}{k}, leading to the Binomial Theorem:

    (x+y)n=k=0n(nk)xnkyk(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k

    General Term:
    The (k+1)(k+1)-th term in the expansion of (x+y)n(x+y)^n is given by Tk+1=(nk)xnkykT_{k+1} = \binom{n}{k} x^{n-k} y^k.

    Worked Example: Expanding a Binomial

    Problem: Expand (2a3b)3(2a - 3b)^3.

    Solution:

    Step 1: Identify n,x,yn, x, y
    Here, n=3n=3, x=2ax=2a, and y=3by=-3b.

    Step 2: Apply the Binomial Theorem formula

    (2a3b)3=k=03(3k)(2a)3k(3b)k(2a - 3b)^3 = \sum_{k=0}^3 \binom{3}{k} (2a)^{3-k} (-3b)^k

    Step 3: Expand for each value of kk from 00 to 33

    For k=0k=0:

    (30)(2a)30(3b)0=1(2a)31=8a3\binom{3}{0} (2a)^{3-0} (-3b)^0 = 1 \cdot (2a)^3 \cdot 1 = 8a^3

    For k=1k=1:

    (31)(2a)31(3b)1=3(2a)2(3b)=34a2(3b)=36a2b\binom{3}{1} (2a)^{3-1} (-3b)^1 = 3 \cdot (2a)^2 \cdot (-3b) = 3 \cdot 4a^2 \cdot (-3b) = -36a^2b

    For k=2k=2:

    (32)(2a)32(3b)2=3(2a)1(9b2)=32a9b2=54ab2\binom{3}{2} (2a)^{3-2} (-3b)^2 = 3 \cdot (2a)^1 \cdot (9b^2) = 3 \cdot 2a \cdot 9b^2 = 54ab^2

    For k=3k=3:

    (33)(2a)33(3b)3=1(2a)0(27b3)=11(27b3)=27b3\binom{3}{3} (2a)^{3-3} (-3b)^3 = 1 \cdot (2a)^0 \cdot (-27b^3) = 1 \cdot 1 \cdot (-27b^3) = -27b^3

    Step 4: Sum the terms

    (2a3b)3=8a336a2b+54ab227b3(2a - 3b)^3 = 8a^3 - 36a^2b + 54ab^2 - 27b^3

    Answer: 8a336a2b+54ab227b3\boxed{8a^3 - 36a^2b + 54ab^2 - 27b^3}

    ---

    3. The Multinomial Theorem

    The Binomial Theorem is a special case of the Multinomial Theorem, which provides a formula for expanding powers of a sum with more than two terms. This is particularly relevant when dealing with expressions like (x1+x2++xk)n(x_1 + x_2 + \dots + x_k)^n.

    📐 The Multinomial Theorem

    For any non-negative integer nn and any positive integer kk:

    (x1+x2++xk)n=n1+n2++nk=nni0n!n1!n2!nk!x1n1x2n2xknk(x_1 + x_2 + \dots + x_k)^n = \sum_{\substack{n_1+n_2+\dots+n_k=n \\ n_i \ge 0}} \frac{n!}{n_1!n_2!\dots n_k!} x_1^{n_1} x_2^{n_2} \dots x_k^{n_k}

    Variables:

      • nn = the exponent of the multinomial

      • kk = the number of terms in the base sum

      • x1,x2,,xkx_1, x_2, \dots, x_k = the terms of the multinomial

      • n1,n2,,nkn_1, n_2, \dots, n_k = non-negative integer exponents for each term xix_i, such that their sum equals nn.

      • n!n1!n2!nk!\frac{n!}{n_1!n_2!\dots n_k!} = the multinomial coefficient


    When to use: To expand multinomial expressions, find specific terms or coefficients in such an expansion, or solve problems involving distributing distinct items into distinct categories.

    Combinatorial Interpretation of Multinomial Coefficients:
    The multinomial coefficient n!n1!n2!nk!\frac{n!}{n_1!n_2!\dots n_k!} represents the number of ways to arrange nn objects where there are n1n_1 identical objects of type 1, n2n_2 identical objects of type 2, ..., nkn_k identical objects of type kk, and n1+n2++nk=nn_1 + n_2 + \dots + n_k = n.

    Alternatively, it represents the number of ways to partition a set of nn distinct items into kk distinct subsets of sizes n1,n2,,nkn_1, n_2, \dots, n_k.

    Worked Example: Finding a Specific Coefficient in a Trinomial Expansion

    Problem: Find the coefficient of a2b3c1a^2 b^3 c^1 in the expansion of (a+b+c)6(a + b + c)^6.

    Solution:

    Step 1: Identify n,kn, k and the desired exponents
    Here, n=6n=6, and we have k=3k=3 terms (a,b,ca, b, c).
    We want the term an1bn2cn3a^{n_1} b^{n_2} c^{n_3} where n1=2,n2=3,n3=1n_1=2, n_2=3, n_3=1.

    Step 2: Verify that the exponents sum to nn
    n1+n2+n3=2+3+1=6n_1 + n_2 + n_3 = 2 + 3 + 1 = 6. This matches n=6n=6.

    Step 3: Apply the Multinomial Theorem to find the coefficient
    The coefficient is n!n1!n2!n3!\frac{n!}{n_1!n_2!n_3!}.

    Coefficient=6!2!3!1!\text{Coefficient} = \frac{6!}{2!3!1!}

    Step 4: Calculate the factorial values

    6!=7206! = 720

    2!=22! = 2

    3!=63! = 6

    1!=11! = 1

    Step 5: Substitute and calculate

    Coefficient=720261=72012=60\text{Coefficient} = \frac{720}{2 \cdot 6 \cdot 1} = \frac{720}{12} = 60

    Answer: 60\boxed{60}

    Worked Example: Finding a Specific Coefficient with Internal Coefficients (Similar to PYQ concept)

    Problem: What is the coefficient of x4x^4 in the expansion of (1+2x+x2)3(1 + 2x + x^2)^3?

    Solution:

    Step 1: Identify n,kn, k and the terms in the base
    Here, n=3n=3. The base has k=3k=3 terms: 11, 2x2x, and x2x^2.
    Let y1=1y_1=1, y2=2xy_2=2x, y3=x2y_3=x^2.
    The expansion is (y1+y2+y3)3(y_1 + y_2 + y_3)^3.
    A general term in the expansion is 3!n1!n2!n3!(y1)n1(y2)n2(y3)n3\frac{3!}{n_1!n_2!n_3!} (y_1)^{n_1} (y_2)^{n_2} (y_3)^{n_3}, where n1+n2+n3=3n_1+n_2+n_3=3.

    Step 2: Substitute the terms back in
    The general term is 3!n1!n2!n3!(1)n1(2x)n2(x2)n3\frac{3!}{n_1!n_2!n_3!} (1)^{n_1} (2x)^{n_2} (x^2)^{n_3}.
    This simplifies to 3!n1!n2!n3!(2n2)xn2+2n3\frac{3!}{n_1!n_2!n_3!} (2^{n_2}) x^{n_2 + 2n_3}.

    Step 3: Set up the conditions for the desired term
    We need the coefficient of x4x^4, so the power of xx must be 44:

    n2+2n3=4n_2 + 2n_3 = 4

    And the sum of exponents must be nn:
    n1+n2+n3=3n_1 + n_2 + n_3 = 3

    Also, n1,n2,n3n_1, n_2, n_3 must be non-negative integers.

    Step 4: Find all possible combinations of (n1,n2,n3)(n_1, n_2, n_3) that satisfy both conditions
    We can systematically list possibilities for n3n_3 (since it has a multiplier of 2):

    Case 1: n3=0n_3 = 0
    From n2+2n3=4n2+0=4n2=4n_2 + 2n_3 = 4 \Rightarrow n_2 + 0 = 4 \Rightarrow n_2 = 4.
    From n1+n2+n3=3n1+4+0=3n1=1n_1 + n_2 + n_3 = 3 \Rightarrow n_1 + 4 + 0 = 3 \Rightarrow n_1 = -1.
    This is not a valid combination as n1n_1 must be non-negative.

    Case 2: n3=1n_3 = 1
    From n2+2n3=4n2+2(1)=4n2=2n_2 + 2n_3 = 4 \Rightarrow n_2 + 2(1) = 4 \Rightarrow n_2 = 2.
    From n1+n2+n3=3n1+2+1=3n1=0n_1 + n_2 + n_3 = 3 \Rightarrow n_1 + 2 + 1 = 3 \Rightarrow n_1 = 0.
    This gives the valid combination (n1,n2,n3)=(0,2,1)(n_1, n_2, n_3) = (0, 2, 1).

    Case 3: n3=2n_3 = 2
    From n2+2n3=4n2+2(2)=4n2=0n_2 + 2n_3 = 4 \Rightarrow n_2 + 2(2) = 4 \Rightarrow n_2 = 0.
    From n1+n2+n3=3n1+0+2=3n1=1n_1 + n_2 + n_3 = 3 \Rightarrow n_1 + 0 + 2 = 3 \Rightarrow n_1 = 1.
    This gives the valid combination (n1,n2,n3)=(1,0,2)(n_1, n_2, n_3) = (1, 0, 2).

    Case 4: n33n_3 \ge 3
    If n3=3n_3=3, then n2+2(3)=4n2=2n_2+2(3)=4 \Rightarrow n_2 = -2, which is not valid. So no more cases.

    The valid combinations are (0,2,1)(0, 2, 1) and (1,0,2)(1, 0, 2).

    Step 5: Calculate the coefficient for each valid combination and sum them

    For (n1,n2,n3)=(0,2,1)(n_1, n_2, n_3) = (0, 2, 1):
    Coefficient term is 3!0!2!1!(22)=61214=34=12\frac{3!}{0!2!1!} (2^{2}) = \frac{6}{1 \cdot 2 \cdot 1} \cdot 4 = 3 \cdot 4 = 12.

    For (n1,n2,n3)=(1,0,2)(n_1, n_2, n_3) = (1, 0, 2):
    Coefficient term is 3!1!0!2!(20)=61121=31=3\frac{3!}{1!0!2!} (2^{0}) = \frac{6}{1 \cdot 1 \cdot 2} \cdot 1 = 3 \cdot 1 = 3.

    Step 6: Sum the coefficients
    Total coefficient of x4=12+3=15x^4 = 12 + 3 = 15.

    Answer: 15\boxed{15}

    ---

    4. Sums Involving Binomial Coefficients

    Various identities involve sums of binomial coefficients. These are frequently tested for their direct application or as steps in proofs.

    Identity 1: Sum of all Binomial Coefficients

    📐 Sum of All Binomial Coefficients
    k=0n(nk)=2n\sum_{k=0}^n \binom{n}{k} = 2^n

    Variables:

      • nn = the upper limit of the sum


    When to use: To find the total number of subsets of a set with nn elements, or to sum coefficients in binomial expansions of (1+1)n(1+1)^n.

    Proof (Combinatorial Argument):
    Consider a set with nn elements. The total number of subsets of this set is 2n2^n (each element can either be in a subset or not in a subset).
    Alternatively, we can count the number of subsets by size:

    • Number of subsets of size 00 is (n0)\binom{n}{0}.

    • Number of subsets of size 11 is (n1)\binom{n}{1}.

    • ...

    • Number of subsets of size nn is (nn)\binom{n}{n}.


    Summing these counts gives the total number of subsets:
    k=0n(nk)=(n0)+(n1)++(nn)\sum_{k=0}^n \binom{n}{k} = \binom{n}{0} + \binom{n}{1} + \dots + \binom{n}{n}

    Since both methods count the same quantity, we have k=0n(nk)=2n\sum_{k=0}^n \binom{n}{k} = 2^n.

    Proof (Using Binomial Theorem):
    Set x=1x=1 and y=1y=1 in the Binomial Theorem (x+y)n=k=0n(nk)xnkyk(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k:

    (1+1)n=k=0n(nk)(1)nk(1)k(1+1)^n = \sum_{k=0}^n \binom{n}{k} (1)^{n-k} (1)^k

    2n=k=0n(nk)112^n = \sum_{k=0}^n \binom{n}{k} \cdot 1 \cdot 1

    2n=k=0n(nk)2^n = \sum_{k=0}^n \binom{n}{k}

    Identity 2: Alternating Sum of Binomial Coefficients

    📐 Alternating Sum
    k=0n(1)k(nk)=0for n1\sum_{k=0}^n (-1)^k \binom{n}{k} = 0 \quad \text{for } n \ge 1

    Variables:

      • nn = the upper limit of the sum


    When to use: To calculate sums with alternating signs or as a component in more complex combinatorial proofs.

    Proof (Using Binomial Theorem):
    Set x=1x=1 and y=1y=-1 in the Binomial Theorem (x+y)n=k=0n(nk)xnkyk(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k:

    (1+(1))n=k=0n(nk)(1)nk(1)k(1+(-1))^n = \sum_{k=0}^n \binom{n}{k} (1)^{n-k} (-1)^k

    0n=k=0n(1)k(nk)0^n = \sum_{k=0}^n (-1)^k \binom{n}{k}

    For n1n \ge 1, 0n=00^n = 0. Thus, k=0n(1)k(nk)=0\sum_{k=0}^n (-1)^k \binom{n}{k} = 0.

    ---

    Problem-Solving Strategies

    💡 CMI Strategy: Coefficient Extraction

    When finding coefficients in multinomial expansions (e.g., (a+bx+cx2)n(a+bx+cx^2)^n):

    • Identify nn and the base terms: Clearly define nn and each term xix_i in the sum. Note any internal coefficients (e.g., bb in bxbx).

    • Formulate the general term: Write the multinomial expansion's general term: n!n1!n2!nk!(x1)n1(x2)n2(xk)nk\frac{n!}{n_1!n_2!\dots n_k!} (x_1)^{n_1} (x_2)^{n_2} \dots (x_k)^{n_k}.

    • Simplify and extract xx powers: Combine all parts involving the variable xx to get xtotal powerx^{\text{total power}}. Separate out numerical coefficients.

    • Set up system of equations:

    • The sum of exponents must equal nn: n1+n2++nk=nn_1 + n_2 + \dots + n_k = n.
      The total power of xx must equal the desired power.
    • Systematically list valid combinations: Find all non-negative integer solutions (n1,n2,,nk)(n_1, n_2, \dots, n_k) that satisfy both equations. Start by iterating on the exponent with the largest multiplier or the one that significantly constrains others.

    • Calculate and sum contributions: For each valid combination, calculate the specific coefficient n!n1!n2!nk!×(product of internal numerical coefficients)\frac{n!}{n_1!n_2!\dots n_k!} \times (\text{product of internal numerical coefficients}). Sum these contributions to get the final answer.

    ---

    Common Mistakes

    ⚠️ Avoid These Errors
      • Ignoring internal coefficients: When expanding (1+2x+x2)3(1+2x+x^2)^3, students might forget the '2' in 2x2x and incorrectly use xn2x^{n_2} instead of (2x)n2=2n2xn2(2x)^{n_2} = 2^{n_2}x^{n_2}.
    Correct approach: Ensure each term xix_i is treated as a complete entity, including its numerical coefficient, e.g., (2x)n2(2x)^{n_2} becomes 2n2xn22^{n_2}x^{n_2}.
      • Incorrectly setting up exponent sums: In multinomial expansions, forgetting that the sum of the exponents n1+n2++nkn_1+n_2+\dots+n_k must equal nn.
    Correct approach: Always verify that the chosen exponents sum to the total power nn.
      • Missing combinations for multinomial coefficients: Failing to identify all valid sets of exponents (n1,,nk)(n_1, \dots, n_k) that contribute to the desired term.
    Correct approach: Systematically iterate through possible values for one exponent (often starting from 0 or the max possible) and deduce others, checking for non-negativity and the sum constraint at each step.
      • Factorial calculation errors: Miscalculating n!n! or 0!0!.
    Correct approach: Remember 0!=10! = 1. Use a calculator for larger factorials if permitted, or simplify fractions before multiplying/dividing.
      • Sign errors: Especially when dealing with negative terms in binomial or multinomial expansions (e.g., (xy)n(x-y)^n).
    Correct approach: Treat negative terms (e.g., y-y) as yy' (e.g., (1)y(-1)y) and ensure the (1)(-1) factor is raised to the correct power kk.

    ---

    Practice Questions

    :::question type="MCQ" question="What is the coefficient of x3y4x^3y^4 in the expansion of (2xy)7(2x - y)^7?" options=["-140","140","-280","280"] answer="280" hint="Use the general term formula for binomial expansion: Tk+1=(nk)xnkykT_{k+1} = \binom{n}{k} x^{n-k} y^k. Identify nn, the first term, and the second term carefully." solution="Step 1: Identify nn, XX, and YY.
    The expression is (2xy)7(2x - y)^7.
    Here, n=7n=7. The first term is X=2xX = 2x. The second term is Y=yY = -y.

    Step 2: Determine the value of kk for the desired term.
    We are looking for the coefficient of x3y4x^3y^4.
    In the general term (nk)XnkYk\binom{n}{k} X^{n-k} Y^k, the power of YY is kk. So, yky^k means k=4k=4.
    The power of XX is nk=74=3n-k = 7-4 = 3. This means (2x)3(2x)^3.
    This matches the desired x3x^3 and y4y^4.

    Step 3: Substitute these values into the general term formula.
    The term is (74)(2x)74(y)4\binom{7}{4} (2x)^{7-4} (-y)^4.

    Tk+1=T4+1=(74)(2x)3(y)4T_{k+1} = T_{4+1} = \binom{7}{4} (2x)^3 (-y)^4

    Step 4: Calculate the binomial coefficient.

    (74)=7!4!(74)!=7!4!3!=7×6×53×2×1=35\binom{7}{4} = \frac{7!}{4!(7-4)!} = \frac{7!}{4!3!} = \frac{7 \times 6 \times 5}{3 \times 2 \times 1} = 35

    Step 5: Simplify the powers of the terms.

    (2x)3=23x3=8x3(2x)^3 = 2^3 x^3 = 8x^3

    (y)4=(1)4y4=1y4(-y)^4 = (-1)^4 y^4 = 1y^4

    Step 6: Multiply all parts to find the complete term.

    Term=35(8x3)(y4)=(35×8)x3y4=280x3y4\text{Term} = 35 \cdot (8x^3) \cdot (y^4) = (35 \times 8) x^3 y^4 = 280 x^3 y^4

    The coefficient of x3y4x^3y^4 is 280280.
    Answer: 280\boxed{280}"
    :::

    :::question type="NAT" question="In the expansion of (1+x+x2)5(1 + x + x^2)^5, what is the coefficient of x3x^3?" answer="30" hint="Use the Multinomial Theorem. Systematically find all combinations of exponents (n1,n2,n3)(n_1, n_2, n_3) that sum to 55 and result in x3x^3." solution="Step 1: Identify nn and the terms.
    The expression is (1+x+x2)5(1 + x + x^2)^5. Here n=5n=5.
    Let y1=1y_1=1, y2=xy_2=x, y3=x2y_3=x^2.
    A general term in the expansion is 5!n1!n2!n3!(y1)n1(y2)n2(y3)n3\frac{5!}{n_1!n_2!n_3!} (y_1)^{n_1} (y_2)^{n_2} (y_3)^{n_3}, where n1+n2+n3=5n_1+n_2+n_3=5.

    Step 2: Substitute the terms and simplify for the power of xx.
    The general term is 5!n1!n2!n3!(1)n1(x)n2(x2)n3=5!n1!n2!n3!xn2+2n3\frac{5!}{n_1!n_2!n_3!} (1)^{n_1} (x)^{n_2} (x^2)^{n_3} = \frac{5!}{n_1!n_2!n_3!} x^{n_2+2n_3}.

    Step 3: Set up the system of equations.
    We need the coefficient of x3x^3, so the power of xx must be 33:

    n2+2n3=3n_2 + 2n_3 = 3

    And the sum of exponents must be 55:
    n1+n2+n3=5n_1 + n_2 + n_3 = 5

    All nin_i must be non-negative integers.

    Step 4: Find all valid combinations of (n1,n2,n3)(n_1, n_2, n_3).
    Iterate through possible values for n3n_3 (since it has a multiplier):

    Case 1: n3=0n_3 = 0
    From n2+2n3=3n2+0=3n2=3n_2 + 2n_3 = 3 \Rightarrow n_2 + 0 = 3 \Rightarrow n_2 = 3.
    From n1+n2+n3=5n1+3+0=5n1=2n_1 + n_2 + n_3 = 5 \Rightarrow n_1 + 3 + 0 = 5 \Rightarrow n_1 = 2.
    Combination: (n1,n2,n3)=(2,3,0)(n_1, n_2, n_3) = (2, 3, 0).

    Case 2: n3=1n_3 = 1
    From n2+2n3=3n2+2(1)=3n2=1n_2 + 2n_3 = 3 \Rightarrow n_2 + 2(1) = 3 \Rightarrow n_2 = 1.
    From n1+n2+n3=5n1+1+1=5n1=3n_1 + n_2 + n_3 = 5 \Rightarrow n_1 + 1 + 1 = 5 \Rightarrow n_1 = 3.
    Combination: (n1,n2,n3)=(3,1,1)(n_1, n_2, n_3) = (3, 1, 1).

    Case 3: n3=2n_3 = 2
    From n2+2n3=3n2+2(2)=3n2=1n_2 + 2n_3 = 3 \Rightarrow n_2 + 2(2) = 3 \Rightarrow n_2 = -1.
    This is not valid as n2n_2 must be non-negative. No further cases are possible for n3n_3.

    The valid combinations are (2,3,0)(2, 3, 0) and (3,1,1)(3, 1, 1).

    Step 5: Calculate the coefficient for each combination and sum them.

    For (n1,n2,n3)=(2,3,0)(n_1, n_2, n_3) = (2, 3, 0):
    Coefficient term is 5!2!3!0!=120261=12012=10\frac{5!}{2!3!0!} = \frac{120}{2 \cdot 6 \cdot 1} = \frac{120}{12} = 10.

    For (n1,n2,n3)=(3,1,1)(n_1, n_2, n_3) = (3, 1, 1):
    Coefficient term is 5!3!1!1!=120611=1206=20\frac{5!}{3!1!1!} = \frac{120}{6 \cdot 1 \cdot 1} = \frac{120}{6} = 20.

    Step 6: Sum the coefficients.
    Total coefficient of x3=10+20=30x^3 = 10 + 20 = 30.
    Answer: 30\boxed{30}"
    :::

    :::question type="MCQ" question="Which of the following statements about binomial coefficients is/are true?" options=["(nk)=(nnk)\binom{n}{k} = \binom{n}{n-k}","(n0)+(n1)++(nn)=2n\binom{n}{0} + \binom{n}{1} + \dots + \binom{n}{n} = 2^n","(nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}","All of the above"] answer="All of the above" hint="Recall the fundamental properties and identities of binomial coefficients." solution="Statements A, B, and C correspond to the fundamental properties of binomial coefficients discussed:
    A. (nk)=(nnk)\binom{n}{k} = \binom{n}{n-k} is the Symmetry Property. This is true.
    B. (n0)+(n1)++(nn)=2n\binom{n}{0} + \binom{n}{1} + \dots + \binom{n}{n} = 2^n is the Sum of All Binomial Coefficients Identity. This is true.
    C. (nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k} is Pascal's Identity. This is true.
    Since A, B, and C are all true, option D is the correct answer.
    Answer: All of the above\boxed{\text{All of the above}}"
    :::

    :::question type="SUB" question="Prove the identity k=0nk(nk)=n2n1\sum_{k=0}^n k \binom{n}{k} = n 2^{n-1} for n1n \ge 1 using the Binomial Theorem by differentiation." answer="n 2^{n-1}" hint="Consider the binomial expansion of (1+x)n(1+x)^n. Differentiate both sides with respect to xx, then substitute a suitable value for xx." solution="Step 1: Start with the Binomial Theorem expansion for (1+x)n(1+x)^n.

    (1+x)n=k=0n(nk)(1)nkxk(1+x)^n = \sum_{k=0}^n \binom{n}{k} (1)^{n-k} x^k

    (1+x)n=k=0n(nk)xk(1+x)^n = \sum_{k=0}^n \binom{n}{k} x^k

    Step 2: Differentiate both sides with respect to xx.
    Differentiating the left side:

    ddx(1+x)n=n(1+x)n1\frac{d}{dx} (1+x)^n = n(1+x)^{n-1}

    Differentiating the right side term by term:

    ddx(k=0n(nk)xk)=k=0n(nk)ddx(xk)\frac{d}{dx} \left( \sum_{k=0}^n \binom{n}{k} x^k \right) = \sum_{k=0}^n \binom{n}{k} \frac{d}{dx} (x^k)

    =k=0n(nk)kxk1= \sum_{k=0}^n \binom{n}{k} k x^{k-1}

    Note that for k=0k=0, the term 0(n0)x10 \cdot \binom{n}{0} x^{-1} is 00, so the sum effectively starts from k=1k=1.
    =k=1nk(nk)xk1= \sum_{k=1}^n k \binom{n}{k} x^{k-1}

    Step 3: Equate the differentiated expressions.

    n(1+x)n1=k=1nk(nk)xk1n(1+x)^{n-1} = \sum_{k=1}^n k \binom{n}{k} x^{k-1}

    Step 4: Substitute x=1x=1 into the equation.

    n(1+1)n1=k=1nk(nk)(1)k1n(1+1)^{n-1} = \sum_{k=1}^n k \binom{n}{k} (1)^{k-1}

    n(2)n1=k=1nk(nk)n(2)^{n-1} = \sum_{k=1}^n k \binom{n}{k}

    Step 5: Adjust the summation index.
    Since the term for k=0k=0 in k=0nk(nk)\sum_{k=0}^n k \binom{n}{k} is 0(n0)=00 \cdot \binom{n}{0} = 0, the sum from k=1k=1 is equivalent to the sum from k=0k=0:

    k=1nk(nk)=k=0nk(nk)\sum_{k=1}^n k \binom{n}{k} = \sum_{k=0}^n k \binom{n}{k}

    Step 6: Conclude the proof.
    Therefore, we have proved the identity:

    k=0nk(nk)=n2n1\sum_{k=0}^n k \binom{n}{k} = n 2^{n-1}

    Answer: n2n1\boxed{n 2^{n-1}}"
    :::

    ---

    Summary

    Key Takeaways for CMI

    • Binomial Coefficients: Understand (nk)=n!k!(nk)!\binom{n}{k} = \frac{n!}{k!(n-k)!} as the number of ways to choose kk items from nn. Master properties like symmetry ((nk)=(nnk)\binom{n}{k} = \binom{n}{n-k}) and Pascal's Identity ((nk)=(n1k1)+(n1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}).

    • Binomial Theorem: Remember the expansion (x+y)n=k=0n(nk)xnkyk(x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k. Be able to identify the general term and apply it to find specific coefficients.

    • Multinomial Theorem: Crucial for CMI, especially for problems with more than two terms. The formula is (x1++xk)n=n1++nk=nn!n1!nk!x1n1xknk(x_1 + \dots + x_k)^n = \sum_{n_1+\dots+n_k=n} \frac{n!}{n_1!\dots n_k!} x_1^{n_1} \dots x_k^{n_k}. Practice systematically finding all combinations of exponents (n1,,nk)(n_1, \dots, n_k) that sum to nn and satisfy the variable power requirements.

    • Sums of Coefficients: Know k=0n(nk)=2n\sum_{k=0}^n \binom{n}{k} = 2^n and k=0n(1)k(nk)=0\sum_{k=0}^n (-1)^k \binom{n}{k} = 0. These are often used in direct questions or as parts of larger problems.

    • Systematic Approach: For complex coefficient problems, systematically list all valid combinations of exponents and sum their contributions. Do not miss any combinations or numerical factors within terms.

    ---

    What's Next?

    💡 Continue Learning

    This topic connects to:

      • Generating Functions: The Binomial and Multinomial Theorems are foundational for understanding and deriving generating functions, which are powerful tools for solving recurrence relations and combinatorial problems.

      • Probability Theory: Binomial coefficients appear naturally in the Binomial Probability Distribution, describing the number of successes in a sequence of independent Bernoulli trials. Multinomial coefficients extend this to the Multinomial Distribution.

      • Inclusion-Exclusion Principle: Understanding counting principles like combinations is prerequisite for applying the Inclusion-Exclusion Principle to solve more complex counting problems.


    Master these connections for comprehensive CMI preparation!

    Here's the chapter conclusion for "Counting Techniques" for CMI preparation:

    ---

    Chapter Summary

    📖 Counting Techniques - Key Takeaways

    • Fundamental Principles are Paramount: Master the Product Rule (for sequential, independent choices) and the Sum Rule (for mutually exclusive alternatives or cases). These are the bedrock of all counting problems.

    • Permutations vs. Combinations: Clearly distinguish when order matters (Permutations, P(n,k)P(n,k)) versus when it doesn't (Combinations, C(n,k)C(n,k) or (nk)\binom{n}{k}). Pay close attention to whether items are distinct or identical.

    • Principle of Inclusion-Exclusion (PIE): Essential for problems involving "at least one" or "neither A nor B" conditions where sets overlap. Remember the alternating sum formula: AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|, extendable for more sets.

    • Stars and Bars: A powerful technique for finding the number of non-negative integer solutions to equations like x1+x2++xk=nx_1 + x_2 + \dots + x_k = n, or for distributing nn identical items into kk distinct bins. The formula is (n+k1k1)\binom{n+k-1}{k-1} or (n+k1n)\binom{n+k-1}{n}.

    • The Binomial Theorem: Understand its formula, k=0n(nk)xnkyk=(x+y)n\sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k = (x+y)^n. Be adept at finding specific coefficients, and use it to derive combinatorial identities by substituting specific values for xx and yy.

    • Complementary Counting & Casework: Often, it's easier to count the total number of arrangements and subtract the "unwanted" arrangements (complementary counting). For complex problems, break them down into disjoint, exhaustive cases. Always check for overcounting or undercounting.

    • Problem-Solving Strategies: Look for symmetry, simplify constraints, and practice translating word problems into appropriate counting models. Drawing diagrams can be helpful.

    ---

    Chapter Review Questions

    :::question type="MCQ" question="How many distinct permutations of the letters of the word 'MISSISSIPPI' have at least two 'S's adjacent?" options=["27300","34650","7350","20000"] answer="27300" hint="Consider the total permutations and subtract permutations where no two 'S's are adjacent. For 'no two adjacent', use the gap method." solution="Let the letters be M (1)(1), I (4)(4), S (4)(4), P (2)(2). Total letters = 1111.

    Step 1: Calculate total distinct permutations.
    The total number of distinct permutations of 'MISSISSIPPI' is given by the multinomial coefficient formula:

    11!4!4!2!1!=39,916,800242421=39,916,8001152=34,650\frac{11!}{4! \cdot 4! \cdot 2! \cdot 1!} = \frac{39,916,800}{24 \cdot 24 \cdot 2 \cdot 1} = \frac{39,916,800}{1152} = 34,650

    Step 2: Calculate permutations where no two 'S's are adjacent.
    To ensure no two 'S's are adjacent, we first arrange the other letters (M, I, I, I, I, P, P) and then place the 'S's in the gaps created.
    Number of other letters = 1+4+2=71+4+2 = 7.
    Permutations of these 7 letters:

    7!4!2!1!=50402421=504048=105\frac{7!}{4! \cdot 2! \cdot 1!} = \frac{5040}{24 \cdot 2 \cdot 1} = \frac{5040}{48} = 105

    These 77 letters create 7+1=87+1=8 possible gaps where the 'S's can be placed:
    `_` L `_` L `_` L `_` L `_` L `_` L `_` L `_`
    We need to choose 44 of these 88 gaps for the 44 'S's. Since the 'S's are identical, the order of choosing the gaps doesn't matter, and placing them in the chosen gaps is unique.
    Number of ways to choose 44 gaps from 88:
    (84)=87654321=70\binom{8}{4} = \frac{8 \cdot 7 \cdot 6 \cdot 5}{4 \cdot 3 \cdot 2 \cdot 1} = 70

    So, the number of permutations where no two 'S's are adjacent is 105×70=7350105 \times 70 = 7350.

    Step 3: Calculate permutations where at least two 'S's are adjacent.
    This is found by subtracting the "no two 'S's adjacent" case from the total permutations:

    34,6507,350=27,30034,650 - 7,350 = 27,300

    Answer: 27300\boxed{27300}"
    :::

    :::question type="NAT" question="Find the number of non-negative integer solutions to the equation x1+x2+x3=10x_1 + x_2 + x_3 = 10 such that x14x_1 \le 4 and x22x_2 \ge 2." answer="35" hint="First, apply the lower bound constraint. Then, use complementary counting for the upper bound constraint." solution="We are looking for non-negative integer solutions to x1+x2+x3=10x_1 + x_2 + x_3 = 10 with conditions x14x_1 \le 4 and x22x_2 \ge 2.

    Step 1: Apply the lower bound constraint.
    Let x2=x22x_2' = x_2 - 2. Since x22x_2 \ge 2, we have x20x_2' \ge 0.
    Substitute x2=x2+2x_2 = x_2' + 2 into the equation:
    x1+(x2+2)+x3=10x_1 + (x_2' + 2) + x_3 = 10
    x1+x2+x3=8x_1 + x_2' + x_3 = 8
    Now we need to find non-negative integer solutions to this new equation, subject to x14x_1 \le 4.

    Step 2: Find total non-negative solutions without the upper bound.
    Using Stars and Bars for x1+x2+x3=8x_1 + x_2' + x_3 = 8 (where x1,x2,x30x_1, x_2', x_3 \ge 0):
    Number of solutions = (n+k1k1)=(8+3131)=(102)=1092=45\binom{n+k-1}{k-1} = \binom{8+3-1}{3-1} = \binom{10}{2} = \frac{10 \cdot 9}{2} = 45.

    Step 3: Apply the upper bound constraint using complementary counting.
    We need x14x_1 \le 4. It's easier to count the solutions where x15x_1 \ge 5 and subtract them from the total.
    Let x1=x15x_1' = x_1 - 5. Since x15x_1 \ge 5, x10x_1' \ge 0.
    Substitute x1=x1+5x_1 = x_1' + 5 into x1+x2+x3=8x_1 + x_2' + x_3 = 8:
    (x1+5)+x2+x3=8(x_1' + 5) + x_2' + x_3 = 8
    x1+x2+x3=3x_1' + x_2' + x_3 = 3
    Now, find the number of non-negative integer solutions to this equation:
    Number of solutions = (3+3131)=(52)=542=10\binom{3+3-1}{3-1} = \binom{5}{2} = \frac{5 \cdot 4}{2} = 10.

    Step 4: Subtract to find the desired solutions.
    The number of solutions satisfying x14x_1 \le 4 and x22x_2 \ge 2 (and x30x_3 \ge 0) is:
    Total solutions (from Step 2) - Solutions where x15x_1 \ge 5 (from Step 3)
    4510=3545 - 10 = 35.
    Answer: 35\boxed{35}"
    :::

    :::question type="MCQ" question="What is the value of the sum k=0nk(nk)\sum_{k=0}^{n} k \binom{n}{k}?" options=["2n2^n","n2nn2^n","n2n1n2^{n-1}","(n+1)2n(n+1)2^n"] answer="n2n1n2^{n-1}" hint="Consider the Binomial Theorem and differentiation, or a combinatorial argument." solution="We need to evaluate the sum S=k=0nk(nk)S = \sum_{k=0}^{n} k \binom{n}{k}.

    Method 1: Using the Binomial Theorem and Differentiation
    Recall the Binomial Theorem:

    (1+x)n=k=0n(nk)xk(1+x)^n = \sum_{k=0}^{n} \binom{n}{k} x^k

    Differentiate both sides with respect to xx:
    ddx(1+x)n=ddx(k=0n(nk)xk)\frac{d}{dx} (1+x)^n = \frac{d}{dx} \left( \sum_{k=0}^{n} \binom{n}{k} x^k \right)

    n(1+x)n1=k=0n(nk)kxk1n(1+x)^{n-1} = \sum_{k=0}^{n} \binom{n}{k} k x^{k-1}

    Now, substitute x=1x=1 into the equation:
    n(1+1)n1=k=0n(nk)k(1)k1n(1+1)^{n-1} = \sum_{k=0}^{n} \binom{n}{k} k (1)^{k-1}

    n2n1=k=0nk(nk)n \cdot 2^{n-1} = \sum_{k=0}^{n} k \binom{n}{k}

    So, the sum is n2n1n2^{n-1}.

    Method 2: Combinatorial Argument
    Consider a group of nn people. We want to form a committee of any size and select a leader for that committee.
    * Approach 1: Choose the leader first. There are nn choices for the leader. Once the leader is chosen, the remaining n1n-1 people can either be in the committee or not. For each of the n1n-1 people, there are 22 choices (in or out). So, there are n2n1n \cdot 2^{n-1} ways to choose a leader and form a committee around them.
    * Approach 2: Choose the committee first.
    If the committee has kk members, there are (nk)\binom{n}{k} ways to choose the kk members.
    Once the kk members are chosen, there are kk ways to choose a leader from them.
    So, for a committee of size kk, there are k(nk)k \binom{n}{k} ways.
    Summing over all possible committee sizes kk from 00 to nn:

    k=0nk(nk)\sum_{k=0}^{n} k \binom{n}{k}

    Since both approaches count the same thing, they must be equal:
    k=0nk(nk)=n2n1\sum_{k=0}^{n} k \binom{n}{k} = n 2^{n-1}

    Answer: n2n1\boxed{n2^{n-1}}"
    :::

    :::question type="NAT" question="A group consists of 44 married couples. How many ways are there to form a committee of 44 people such that no two members of the committee are married to each other?" answer="16" hint="Since no two members can be married, each person selected must come from a different couple." solution="We have 44 married couples, which means there are 4×2=84 \times 2 = 8 people in total. Let the couples be (H1,W1),(H2,W2),(H3,W3),(H4,W4)(H_1, W_1), (H_2, W_2), (H_3, W_3), (H_4, W_4).
    We need to form a committee of 44 people such that no two members are married to each other. This implies that if a husband is selected, his wife cannot be selected, and vice versa.

    To satisfy the condition, each of the 44 committee members must come from a different couple.
    Step 1: Choose the 44 couples from which the committee members will be drawn.
    Since there are exactly 44 couples, we must choose all 44 couples. There is (44)=1\binom{4}{4} = 1 way to do this.

    Step 2: From each chosen couple, select one person.
    For the first couple chosen, there are 22 options (either the husband or the wife).
    For the second couple chosen, there are 22 options.
    For the third couple chosen, there are 22 options.
    For the fourth couple chosen, there are 22 options.
    So, the number of ways to select one person from each of the 44 chosen couples is 2×2×2×2=24=162 \times 2 \times 2 \times 2 = 2^4 = 16.

    Step 3: Total ways.
    The total number of ways to form the committee is the product of the ways from Step 1 and Step 2:
    1×16=161 \times 16 = 16.
    Answer: 16\boxed{16}"
    :::

    ---

    What's Next?

    💡 Continue Your CMI Journey

    You've mastered Counting Techniques! This foundational chapter is crucial for many areas of higher mathematics, especially in Discrete Mathematics and Probability.

    Key connections:
    Builds on previous learning: Your understanding of basic set theory, algebraic manipulation, and logical reasoning from earlier chapters (or prerequisites) is heavily utilized here.
    Prepares you for Probability: Many probability problems are fundamentally counting problems. You'll use permutations, combinations, and PIE extensively to calculate sample spaces and event probabilities. This chapter directly feeds into understanding discrete probability distributions like the Binomial, Hypergeometric, and Poisson distributions.
    Essential for Graph Theory: Counting paths, cycles, subgraphs, and various graph properties often relies on the techniques learned here.
    Foundation for Generating Functions: For advanced counting problems, especially those involving sequences and recurrence relations, generating functions build directly upon the principles of combinations and series expansions.
    * Crucial for CMI Entrance: Counting is a recurring theme in CMI entrance exams, often integrated into problems involving number theory, combinatorics, and logic puzzles. A strong grasp here will significantly boost your problem-solving capabilities.

    🎯 Key Points to Remember

    • Master the core concepts in Counting Techniques before moving to advanced topics
    • Practice with previous year questions to understand exam patterns
    • Review short notes regularly for quick revision before exams

    Related Topics in Discrete Mathematics

    More Resources

    Why Choose MastersUp?

    🎯

    AI-Powered Plans

    Personalized study schedules based on your exam date and learning pace

    📚

    15,000+ Questions

    Verified questions with detailed solutions from past papers

    📊

    Smart Analytics

    Track your progress with subject-wise performance insights

    🔖

    Bookmark & Revise

    Save important questions for quick revision before exams

    Start Your Free Preparation →

    No credit card required • Free forever for basic features