Module 3 Combinatorics Counting Notes and Question Paper

Table of contents

  1. Module 3 – Combinatorics & Counting
  2. 45-Mark Scenario-Based Question Paper
  3. Topic-to-Question Mapping

1. Module 3 – Combinatorics & Counting

1.1 Fundamental counting principles

The fundamental counting principles provide methods for determining the number of possible outcomes in a sequence of events. The addition principle applies when tasks can be performed in mutually exclusive alternatives, meaning the total number of ways is the sum of the ways for each alternative.

The multiplication principle (or product rule) applies when a task consists of successive steps; the total number of ways is the product of the number of ways for each step 1.

  • Addition principle: Used for "OR" situations where choices are mutually exclusive.
  • Multiplication principle: Used for "AND" situations where a sequence of choices is made.

📝 If a student can choose between 4 different math books or 3 different physics books, the total number of choices is 4+3=74 + 3 = 7 books 1.

1.2 Counting by cases

This method involves breaking down a complex counting problem into smaller, non-overlapping subproblems or cases. The total number of solutions is found by solving each case individually and then summing the results.

This ensures that every possible outcome is counted exactly once 1.

1.3 Permutations

A permutation is an arrangement of objects where the order of the objects is important. The formula for the number of permutations of nn distinct objects taken rr at a time is given by P(n,r)=n!(n−r)!P(n,r) = \frac{n!}{(n-r)!} 1.

  • Permutation: Order matters.
  • Formula: P(n,r)=n!(n−r)!P(n,r) = \frac{n!}{(n-r)!}

📝 To arrange 3 students from a group of 5, the number of permutations is P(5,3)=5!(5−3)!=1202=60P(5,3) = \frac{5!}{(5-3)!} = \frac{120}{2} = 60 1.

1.4 Combinations

A combination is a selection of objects where the order of selection does not matter. The formula for the number of combinations of nn distinct objects taken rr at a time is given by C(n,r)=n!r!(n−r)!C(n,r) = \frac{n!}{r!(n-r)!} 1.

  • Combination: Order does not matter.
  • Formula: C(n,r)=n!r!(n−r)!C(n,r) = \frac{n!}{r!(n-r)!}

📝 To select 3 students from a group of 5, the number of combinations is C(5,3)=5!3!(5−3)!=1206×2=10C(5,3) = \frac{5!}{3!(5-3)!} = \frac{120}{6 \times 2} = 10 1.

1.5 Permutations with repetition

When arranging objects where some are identical, the number of distinct permutations is calculated by dividing the factorial of the total number of objects by the factorials of the counts of each repeated object. The formula is n!p!q!r!...\frac{n!}{p!q!r!...}, where nn is the total number of objects, and p,q,r,...p, q, r,... are the frequencies of each distinct repeated object 1.

  • Formula: n!p!q!r!...\frac{n!}{p!q!r!...}

1.6 Circular permutations

For nn distinct objects arranged in a circle, the number of distinct arrangements is (n−1)!(n-1)!. This is because rotations of the same arrangement are considered identical 1.

  • Formula: (n−1)!(n-1)!

📝 If 5 people are to be seated around a circular table, the number of distinct arrangements is (5−1)!=4!=24(5-1)! = 4! = 24 1.

1.7 Combinations with repetition

This counts the number of ways to select rr objects from nn distinct types of objects, where repetition is allowed. The formula is C(n+r−1,r)C(n+r-1, r) 1.

  • Formula: C(n+r−1,r)C(n+r-1, r)

📝 If you want to select 3 chocolates from 4 different types, the number of ways is C(4+3−1,3)=C(6,3)=6!3!3!=20C(4+3-1, 3) = C(6,3) = \frac{6!}{3!3!} = 20 1.

1.8 Stars and bars

The "stars and bars" method is used to find the number of non-negative integer solutions to an equation of the form x1+x2+...+xn=rx_1 + x_2 +... + x_n = r.

The number of solutions is given by C(r+n−1,n−1)C(r+n-1, n-1). If each variable must be at least one (xi≥1x_i \ge 1), first assign 1 to each variable, then solve for the remaining r−nr-n items, yielding C((r−n)+n−1,n−1)=C(r−1,n−1)C((r-n)+n-1, n-1) = C(r-1, n-1) solutions 1.

  • Formula for xi≥0x_i \ge 0: C(r+n−1,n−1)C(r+n-1, n-1)
  • Formula for xi≥1x_i \ge 1: C(r−1,n−1)C(r-1, n-1)

📝 To distribute 7 identical chocolates among 3 students such that each student gets at least one, we solve x1+x2+x3=7x_1+x_2+x_3=7 with xi≥1x_i \ge 1. This is equivalent to distributing 7−3=47-3=4 chocolates among 3 students with xi≥0x_i \ge 0, giving C(4+3−1,3−1)=C(6,2)=15C(4+3-1, 3-1) = C(6,2) = 15 ways 1.

1.9 Binomial theorem

The binomial theorem provides a formula for expanding powers of a binomial (a+b)n(a+b)^n. The expansion is given by the sum ∑r=0nC(n,r)an−rbr\sum_{r=0}^{n} C(n,r)a^{n-r}b^r.

The coefficients C(n,r)C(n,r) are the binomial coefficients 1.

  • Formula: (a+b)n=∑r=0nC(n,r)an−rbr(a+b)^n = \sum_{r=0}^{n} C(n,r)a^{n-r}b^r

📝 Expanding (a+b)3(a+b)^3 gives C(3,0)a3b0+C(3,1)a2b1+C(3,2)a1b2+C(3,3)a0b3=1a3+3a2b+3ab2+1b3C(3,0)a^3b^0 + C(3,1)a^2b^1 + C(3,2)a^1b^2 + C(3,3)a^0b^3 = 1a^3 + 3a^2b + 3ab^2 + 1b^3 1.

1.10 Binomial coefficients properties

Binomial coefficients, denoted as C(n,r)C(n,r) or (nr)\binom{n}{r}, have several useful properties. They are symmetric, meaning C(n,r)=C(n,n−r)C(n,r) = C(n, n-r).

Also, C(n,0)=C(n,n)=1C(n,0) = C(n,n) = 1 2.

  • Symmetry: C(n,r)=C(n,n−r)C(n,r) = C(n, n-r)
  • Boundary values: C(n,0)=1C(n,0) = 1, C(n,n)=1C(n,n) = 1

📝 C(7,3)=7!3!4!=35C(7,3) = \frac{7!}{3!4!} = 35, and C(7,4)=7!4!3!=35C(7,4) = \frac{7!}{4!3!} = 35. Thus, C(7,3)=C(7,4)C(7,3) = C(7,4) 2.

1.11 Pascal's identity

Pascal's identity states that C(n,r)=C(n−1,r−1)+C(n−1,r)C(n,r) = C(n-1, r-1) + C(n-1, r). This identity is fundamental to the construction of Pascal's triangle, where each number is the sum of the two numbers directly above it 2.

  • Identity: C(n,r)=C(n−1,r−1)+C(n−1,r)C(n,r) = C(n-1, r-1) + C(n-1, r)

📝 C(5,2)=C(4,1)+C(4,2)=4+6=10C(5,2) = C(4,1) + C(4,2) = 4 + 6 = 10 2.

1.12 Combinatorial identities

Several important identities exist for binomial coefficients. The sum of binomial coefficients for a given nn, ∑r=0nC(n,r)\sum_{r=0}^{n} C(n,r), equals 2n2^n.

This represents the total number of subsets of a set with nn elements 2.

  • Sum of coefficients: ∑r=0nC(n,r)=2n\sum_{r=0}^{n} C(n,r) = 2^n

📝 For n=4n=4, C(4,0)+C(4,1)+C(4,2)+C(4,3)+C(4,4)=1+4+6+4+1=16C(4,0)+C(4,1)+C(4,2)+C(4,3)+C(4,4) = 1+4+6+4+1 = 16, which equals 242^4 2.

1.13 Inclusion–Exclusion Principle

The Inclusion-Exclusion Principle is used to count the number of elements in the union of multiple sets. For two sets A and B, ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|.

For three sets A, B, and C, the formula is ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|. The general idea is to add the sizes of individual sets, subtract the sizes of pairwise intersections, add the sizes of three-way intersections, and so on, alternating addition and subtraction 2.

  • Two sets: ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|
  • Three sets: ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−(∣A∩B∣+∣A∩C∣+∣B∩C∣)+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - (|A \cap B| + |A \cap C| + |B \cap C|) + |A \cap B \cap C|

📝 If 30 people know Python, 20 know C, and 10 know both, then 30+20−10=4030 + 20 - 10 = 40 people know at least one of the languages 2.

1.14 Derangements

A derangement is a permutation of the elements of a set such that no element appears in its original position. The number of derangements of nn elements, denoted by !n!n or DnD_n, can be calculated using the formula $!n = n!

\sum_{k=0}^{n} \frac{(-1)^k}{k!}$ 2.

  • Concept: No element in its original position.
  • Formula: !n=n!∑k=0n(−1)kk!!n = n! \sum_{k=0}^{n} \frac{(-1)^k}{k!}

📝 For n=3n=3, the number of derangements is !3=3!((−1)00!+(−1)11!+(−1)22!+(−1)33!)=6(1−1+12−16)=6(3−16)=2!3 = 3! (\frac{(-1)^0}{0!} + \frac{(-1)^1}{1!} + \frac{(-1)^2}{2!} + \frac{(-1)^3}{3!}) = 6 (1 - 1 + \frac{1}{2} - \frac{1}{6}) = 6 (\frac{3-1}{6}) = 2. The arrangements are BCA and CAB for {A, B, C} 2.

1.15 Pigeonhole Principle

The Pigeonhole Principle states that if NN items are put into kk containers, with N>kN > k, then at least one container must contain more than one item. The generalized form states that at least one container must contain at least ⌈N/k⌉\lceil N/k \rceil items 2.

  • Basic form: If NN objects are in kk boxes and N>kN > k, at least one box has ≥2\ge 2 objects.
  • Generalized form: At least one box has ≥⌈N/k⌉\ge \lceil N/k \rceil objects.

📝 If 100 students are divided into 9 groups, at least one group must have ⌈100/9⌉=⌈11.11⌉=12\lceil 100/9 \rceil = \lceil 11.11 \rceil = 12 students 2.

1.16 Counting and key-space sizing

The key space of a password or code is the total number of possible combinations. If a password has nn positions and each position can be one of AA possible characters, the total key space is AnA^n.

This principle is crucial in cryptography and security for assessing password strength 2.

  • Formula: Key space = AnA^n

📝 A password system using 8 lowercase letters has a key space of 26826^8, which is approximately 2.09×10112.09 \times 10^{11} possible passwords 2.

1.17 Birthday problem and collision counting

The Birthday Problem deals with the probability that in a set of randomly chosen people, at least two share the same birthday. In a counting context, if there are nn people and 365 possible birthdays, the total number of birthday assignments is 365n365^n.

The number of assignments where all birthdays are distinct is P(365,n)P(365, n). Therefore, the number of assignments with at least one collision is 365n−P(365,n)365^n - P(365, n) 2.

  • Total assignments: 365n365^n
  • Assignments with no collisions: P(365,n)P(365, n)
  • Assignments with at least one collision: 365n−P(365,n)365^n - P(365, n)

The hash connection relates this to hash functions. An mm-bit hash function has 2m2^m possible outputs.

If more than 2m2^m inputs are processed, the Pigeonhole Principle guarantees that at least one collision (two different inputs mapping to the same output) must occur. This is the basis for understanding hash collisions and birthday-style attacks 2.

1.18 Recurrence relations as counting tools

Recurrence relations define a sequence where each term is a function of preceding terms. They are powerful tools for solving counting problems where the solution for a problem of size nn can be expressed in terms of solutions for smaller sizes 3.

📝 A staircase can be climbed using 1-step or 2-step moves. Let ana_n be the number of ways to climb nn steps. Then an=an−1+an−2a_n = a_{n-1} + a_{n-2} (Fibonacci-like sequence), with base cases a1=1a_1=1 and a2=2a_2=2. This leads to a3=3a_3=3, a4=5a_4=5, a5=8a_5=8 3.

1.19 Generating functions

A generating function for a sequence a0,a1,a2,...a_0, a_1, a_2,... is a power series G(x)=a0+a1x+a2x2+...G(x) = a_0 + a_1x + a_2x^2 +.... Generating functions transform counting problems into algebraic manipulations, allowing complex sequences to be analyzed using polynomial and series algebra 3.

  • Concept: Converts counting sequences into algebraic expressions.
  • Example: For the sequence 1,1,1,...1, 1, 1,..., the generating function is G(x)=1+x+x2+...=11−xG(x) = 1 + x + x^2 +... = \frac{1}{1-x} 3.

1.20 Catalan numbers

Catalan numbers are a sequence of natural numbers that occur in various counting problems, often involving recursively defined objects. The nn-th Catalan number is given by the formula Cn=1n+1(2nn)C_n = \frac{1}{n+1} \binom{2n}{n}.

The sequence starts 1,1,2,5,14,42,...1, 1, 2, 5, 14, 42,... 3.

  • Formula: Cn=1n+1(2nn)C_n = \frac{1}{n+1} \binom{2n}{n}
  • Applications: Counting valid parenthesis arrangements, binary tree structures, polygon triangulations.

📝 The 3rd Catalan number is C3=13+1(2×33)=14(63)=14×20=5C_3 = \frac{1}{3+1} \binom{2 \times 3}{3} = \frac{1}{4} \binom{6}{3} = \frac{1}{4} \times 20 = 5 3.

1.21 Quick formula sheet 3

TopicFormula
Addition Principlem + n
Multiplication Principlem * n
PermutationnPr = n!/(n−r)!
CombinationnCr = n!/[r!(n−r)!]
Permutation with repetitionn!/(p!q!...)
Circular permutation(n−1)!
Combination with repetitionC(n+r−1,r)
Stars & bars (xi >= 0)C(r+n−1,n−1)
Binomial theorem(a+b)^n = Σ C(n,r)a^(n−r)b^r
Pascal's identityC(n,r) = C(n−1,r−1) + C(n−1,r)
Inclusion–Exclusion (2 sets)—
Derangement!n = n!Σ(−1)^k/k!
Pigeonhole Principle (generalized)ceil(N/k)
Key spaceA^n
Catalan numbersC_n = C(2n,n)/(n+1)

2. 45-Mark Scenario-Based Question Paper

2.1 Question 1 — Cybersecurity Password System [15 Marks

This question assesses the application of fundamental counting principles to password system design.

(a) Repetition allowed: The total number of possible passwords is calculated using the multiplication principle. If each of the 8 characters can be one of 26 lowercase letters, 26 uppercase letters, or 10 digits (total 62 possibilities), and repetition is allowed, the total is 62862^8.

The counting principle used is the multiplication principle for successive independent choices 4.

(b) Distinct characters and repetition: This part requires applying multiple principles.

  • The first 3 characters must be distinct uppercase letters: P(26,3)P(26,3) permutations.
  • The next 3 characters must be distinct digits: P(10,3)P(10,3) permutations.
  • The last 2 characters can be any lowercase letter with repetition allowed: 26226^2 possibilities. The total number of passwords is the product of these: P(26,3)×P(10,3)×262P(26,3) \times P(10,3) \times 26^2. This uses the product rule and permutations 4.

(c) 6-digit PIN and Pigeonhole Principle: A 6-digit PIN has 106=1,000,00010^6 = 1,000,000 possible combinations (000000 to 999999). If more than 1,000,000 different PIN assignments are attempted, the Pigeonhole Principle guarantees that at least two assignments must be identical, leading to a collision 4.

2.2 Question 2 — Student Selection & Distribution [15 Marks

This question focuses on combinations, distributions, and circular arrangements.

(a) Team selection: To select 4 students from 10 for a team, the number of ways is C(10,4)C(10,4). This is a combination because the order in which students are selected for the team does not matter; a team consisting of students A, B, C, D is the same regardless of the selection order 4.

(b) Prize distribution: Stars-and-bars equation: Distributing 8 identical prizes among 4 students, where each can receive zero or more, can be formulated as x1+x2+x3+x4=8x_1 + x_2 + x_3 + x_4 = 8, where xix_i is the number of prizes for student ii 1. Number of distributions: Using the stars and bars formula C(r+n−1,n−1)C(r+n-1, n-1) with r=8r=8 (prizes) and n=4n=4 (students), the number of distributions is C(8+4−1,4−1)=C(11,3)C(8+4-1, 4-1) = C(11,3) 2.

At least one prize: If each student must receive at least one prize, we first give one prize to each of the 4 students, leaving 8−4=48-4=4 prizes to distribute. The equation becomes y1+y2+y3+y4=4y_1 + y_2 + y_3 + y_4 = 4, where yi≥0y_i \ge 0.

The number of distributions is C(4+4−1,4−1)=C(7,3)C(4+4-1, 4-1) = C(7,3) 3 4.

(c) Circular arrangement: To seat 3 students from 10 around a circular table, we first select the 3 students (C(10,3)C(10,3) ways) and then arrange them circularly. The number of circular arrangements for nn distinct objects is (n−1)!(n-1)!.

So, for 3 students, there are $(3-1)! = 2!

= 2arrangements.Thetotalnumberofwaysisarrangements. The total number of ways isC(10,3) \times (3-1)!$ 4.

📝 To select 4 students from 10 for a team, the number of ways is C(10,4)C(10,4). This is a combination because the order in which students are selected for the team does not matter 4.

2.3 Question 3 — Hash Collisions & Structural Counting [15 Marks

This question explores hash functions, recurrence relations, and Catalan numbers.

(a) Hash outputs and collisions: A hash function output of 4 hexadecimal digits means each digit can be one of 16 symbols (0-9, A-F). The total number of possible hash outputs is 16416^4.

If more inputs than this number are processed, the Pigeonhole Principle guarantees that at least two different inputs must map to the same hash output, resulting in a collision 4.

(b) Recurrence relations and generating functions: Calculate terms: For Tn=Tn−1+Tn−2T_n = T_{n-1} + T_{n-2} with T1=1,T2=2T_1=1, T_2=2 1:

  • T3=T2+T1=2+1=3T_3 = T_2 + T_1 = 2 + 1 = 3
  • T4=T3+T2=3+2=5T_4 = T_3 + T_2 = 3 + 2 = 5
  • T5=T4+T3=5+3=8T_5 = T_4 + T_3 = 5 + 3 = 8
  • T6=T5+T4=8+5=13T_6 = T_5 + T_4 = 8 + 5 = 13. Recurrence as counting: Such a recurrence can represent a counting problem where the solution for size nn depends on solutions for smaller sizes, such as problems involving sequential choices or structures built from smaller components (e.g., climbing stairs) 2. Generating function idea: For a general sequence T0,T1,T2,...T_0, T_1, T_2,..., the generating function is G(x)=T0+T1x+T2x2+...G(x) = T_0 + T_1x + T_2x^2 +....

For the given recurrence, G(x)G(x) would be manipulated algebraically to find a closed-form expression 3 4.

(c) Catalan numbers: The calculation for C3C_3 is 13+1(2×33)=14(63)=14×20=5\frac{1}{3+1} \binom{2 \times 3}{3} = \frac{1}{4} \binom{6}{3} = \frac{1}{4} \times 20 = 5. One combinatorial structure counted by Catalan numbers is the number of ways to correctly match nn pairs of parentheses 4.

3. Topic-to-Question Mapping

3.1 Topic mapping to questions 5

This section maps the combinatorial topics to the specific questions in the scenario-based paper, indicating where each concept is tested.

TopicQuestion
Counting by casesQ1(a,b)
PermutationsQ1(b)
Permutations with repetitionPreparation / conceptual
Circular permutationsQ2(c)
CombinationsQ2(a)
Combinations with repetitionQ2(b)
Stars and barsQ2(b)
Binomial theoremPreparation / practice
Binomial coefficientsPreparation / practice
Pascal's identityPreparation / practice
Combinatorial identitiesPreparation / practice
Inclusion-exclusionPreparation / practice
DerangementsPreparation / practice
Pigeonhole principleQ1(c), Q3(a)
Key-space sizingQ1, Q3
Birthday/collisionsQ3
Recurrence relationsQ3(b)
Generating functionsQ3(b)
Catalan numbersQ3(c)

3.2 High-priority problem types

For effective study, focus on problem types that heavily emphasize application. These include permutations versus combinations, stars and bars, the inclusion-exclusion principle, the pigeonhole principle, and counting for password/key-space security and birthday/collision scenarios.

Formulating recurrence relations and understanding Catalan numbers are also critical 5.

  • Key application areas: Permutation vs. combination, stars and bars, inclusion-exclusion, pigeonhole principle, key-space counting, birthday/collision counting, recurrence formulation, Catalan numbers, derangements, binomial/Pascal identities 5.

It is recommended to also practice dedicated problems on the binomial theorem, Pascal's identity, inclusion-exclusion, and derangements for comprehensive preparation 5.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also