Updated: Mar 2026
First Chapter - 100% FREE

GATE CS Short Notes

Quick revision short notes for GATE CS. 61+ chapters of concise, exam-focused content. First chapter FREE!

61+

Chapters

10

Subjects

FREE

First Chapter

⚑

Quick Revision

FREE PREVIEW
Engineering Mathematics β€’ Discrete Mathematics

πŸ“– Combinatorics

Combinatorics

Overview

In the study of computer science, we are fundamentally concerned with discrete structures and the algorithms that operate upon them. Combinatorics, the branch of mathematics dealing with the enumeration, combination, and permutation of sets of elements, provides the essential language and toolkit for this analysis. It is the art and science of countingβ€”not merely by listing, but by developing systematic methods to determine the number of possible outcomes or arrangements under specified constraints. A firm grasp of combinatorial techniques is therefore indispensable for the analysis of algorithms, the design of data structures, and the understanding of discrete probability, all of which are central to the GATE syllabus.

This chapter is structured to build a comprehensive understanding of combinatorial problem-solving, from foundational principles to more advanced methodologies. We begin with the fundamental Counting Principles, including the sum and product rules, permutations, and combinations, which form the bedrock of all enumeration. Subsequently, we shall explore Recurrence Relations, a powerful formalism for describing sequences and problems that possess a recursive structure, such as the complexity analysis of many divide-and-conquer algorithms. The solution of these relations, particularly linear recurrences of the form an=c1anβˆ’1+c2anβˆ’2+…a_n = c_1 a_{n-1} + c_2 a_{n-2} + \dots, is a frequently tested skill.

Finally, we introduce the concept of Generating Functions. This advanced technique provides a unified and elegant algebraic framework for solving complex counting problems and recurrence relations. By encoding a sequence of numbers as the coefficients of a formal power series, we can manipulate the series to extract information that might be difficult to obtain through direct combinatorial arguments. Mastery of the topics presented herein is not merely an academic exercise; it is a prerequisite for tackling a significant portion of questions in the Engineering Mathematics and Discrete Mathematics sections of the GATE examination.

---

Chapter Contents

| # | Topic | What You'll Learn |
|---|-------|-------------------|
| 1 | Counting Principles | Mastering fundamental rules for counting objects. |
| 2 | Recurrence Relations | Solving problems using recursive definitions/methods. |
| 3 | Generating Functions | Using power series to solve enumerations. |

---

Learning Objectives

After completing this chapter, you will be able to:

  • Apply the sum and product rules, permutations, and combinations represented by (nk)\binom{n}{k}, to solve fundamental counting problems.

  • Formulate recurrence relations for combinatorial problems and solve linear homogeneous and non-homogeneous recurrence relations using characteristic equations.

  • Utilize the Principle of Inclusion-Exclusion and the Pigeonhole Principle to address more complex enumeration scenarios.

  • Employ generating functions to model and solve intricate counting problems and recurrence relations.
  • ---

    We now turn our attention to Counting Principles...
    ## Part 1: Counting Principles

    Key Definitions

    ---

    Essential Formulas

    This framework is critical for solving a wide variety of distribution problems. Identify if items (balls) and containers (bins) are distinct or identical.

    | Items (kk) | Bins (nn) | Any # per bin | β‰₯1\geq 1 per bin |
    |--------------|------------|-----------------|----------------|
    | Distinct | Distinct | nkn^k | βˆ‘i=0n(βˆ’1)i(ni)(nβˆ’i)k\sum_{i=0}^{n} (-1)^i \binom{n}{i} (n-i)^k |
    | Identical| Distinct| (n+kβˆ’1k)\binom{n+k-1}{k} | (kβˆ’1nβˆ’1)\binom{k-1}{n-1} |
    | Distinct | Identical| βˆ‘i=1nS(k,i)\sum_{i=1}^n S(k,i) | S(k,n)S(k,n) |
    | Identical| Identical| Partitions of kk into at most nn parts | Partitions of kk into exactly nn parts |

    Note: S(k,n)S(k,n) is the Stirling Number of the Second Kind. The formula in the first row is the PIE application for surjective functions.

    ---

    Must Remember

  • Distinct or Identical? First, classify the items being counted (balls) and the containers they are placed into (bins). This is the most crucial step.

  • Order Matters? If the order of selection or arrangement creates a new outcome, use Permutations. If not, use Combinations.

  • Use Complementary Counting: For "at least one" problems, it is often simpler to calculate the total number of cases and subtract the number of cases where the condition is not met ("none").

  • Element-by-Element Choices: For problems involving subsets or properties (e.g., forming pairs (A,B)(A,B) such that AβŠ†BA \subseteq B), consider the choices available for each individual element of the universal set. For an element xx, it can be in AA and BB, in BB but not AA, or in neither.
  • ---

    Common Mistakes

    ❌ Permutation vs. Combination: Using (53)\binom{5}{3} to find the number of 3-digit numbers from {1,2,3,4,5} without repetition. The order of digits matters (123 β‰ \neq 321).
    βœ… Correct: This is an arrangement, so use Permutation: P(5,3)=5!2!=60P(5,3) = \frac{5!}{2!} = 60.

    ❌ Identical vs. Distinct Items in Bins: Counting ways to distribute 5 identical chocolates to 3 distinct children as 353^5. This formula is for distinct items.
    βœ… Correct: This is "identical items, distinct bins" (Stars and Bars). Use (3+5βˆ’15)=(75)=21\binom{3+5-1}{5} = \binom{7}{5} = 21.

    ❌ Forgetting Constraints: When distributing 5 identical items into 3 distinct bins such that no bin is empty, using the standard Stars and Bars formula.
    βœ… Correct: First, place one item in each bin. Then distribute the remaining 5βˆ’3=25-3=2 items normally: (3+2βˆ’12)=(42)=6\binom{3+2-1}{2} = \binom{4}{2} = 6. This is equivalent to (kβˆ’1nβˆ’1)\binom{k-1}{n-1}.

    ---

    Quick Practice

    type="MCQ" question="How many binary strings of length 8 are there that start with a '1' or end with '00'?" options=["160", "156", "192", "128"] answer="160" hint="Use the Principle of Inclusion-Exclusion: ∣AβˆͺB∣=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣|A \cup B| = |A| + |B| - |A \cap B|." solution="Let A be the set of strings starting with '1'. The first bit is fixed, the other 7 can be anything. So, ∣A∣=27=128|A| = 2^7 = 128.
    Let B be the set of strings ending with '00'. The last two bits are fixed, the other 6 can be anything. So, ∣B∣=26=64|B| = 2^6 = 64.
    A∩BA \cap B is the set of strings starting with '1' AND ending with '00'. The first bit and last two bits are fixed. The remaining 8βˆ’1βˆ’2=58-1-2=5 bits can be anything. So, ∣A∩B∣=25=32|A \cap B| = 2^5 = 32.
    By PIE,

    ∣AβˆͺB∣=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣=128+64βˆ’32=160|A \cup B| = |A| + |B| - |A \cap B| = 128 + 64 - 32 = 160

    Answer: \boxed{160}"

    type="NAT" question="In how many ways can 5 distinct research papers be assigned to 3 identical review panels such that each panel receives at least one paper?" answer="25" hint="This is a problem of partitioning a set of distinct items into a fixed number of non-empty identical subsets. This maps directly to a specific counting number." solution="This is a direct application of Stirling Numbers of the Second Kind, S(k,n)S(k,n), for distributing kk distinct items into nn identical bins with no bin empty. Here, k=5k=5 and n=3n=3.
    The recurrence relation is

    S(k,n)=S(kβˆ’1,nβˆ’1)+nβ‹…S(kβˆ’1,n)S(k,n) = S(k-1, n-1) + n \cdot S(k-1, n)

    We need to calculate S(5,3)S(5,3).
    S(5,3)=S(4,2)+3β‹…S(4,3)S(5,3) = S(4,2) + 3 \cdot S(4,3)

    We need to calculate the base values:
    S(n,1)=1S(n,1) = 1, S(n,n)=1S(n,n) = 1.
    S(3,2)=S(2,1)+2β‹…S(2,2)=1+2(1)=3S(3,2) = S(2,1) + 2 \cdot S(2,2) = 1 + 2(1) = 3

    S(4,3)=S(3,2)+3β‹…S(3,3)=3+3(1)=6S(4,3) = S(3,2) + 3 \cdot S(3,3) = 3 + 3(1) = 6

    S(4,2)=S(3,1)+2β‹…S(3,2)=1+2(3)=7S(4,2) = S(3,1) + 2 \cdot S(3,2) = 1 + 2(3) = 7

    Finally,
    S(5,3)=S(4,2)+3β‹…S(4,3)=7+3(6)=7+18=25S(5,3) = S(4,2) + 3 \cdot S(4,3) = 7 + 3(6) = 7 + 18 = 25

    Answer: \boxed{25}"

    ---

    Remember

    > The foundation of all counting is breaking down a problem into two questions: (1) Are the items/positions distinct or identical? (2) Does the order of selection matter?

    See full notes for detailed explanations!

    ---

    ---

    Part 2: Recurrence Relations

    Key Definitions

    An equation that defines a sequence recursively, where each term is a function of preceding terms. Example: The Fibonacci sequence F(n)=F(nβˆ’1)+F(nβˆ’2)F(n) = F(n-1) + F(n-2).

    ---

    Essential Formulas

    The two primary methods for solving common recurrence relations are the Characteristic Equation method for linear recurrences and the Master Theorem for divide-and-conquer recurrences.

    | Case | Condition on f(n)f(n) | Asymptotic Solution T(n)T(n) |
    |---|---|---|
    | Case 1 | f(n)=O(nlog⁑baβˆ’Ο΅)f(n) = O(n^{\log_b a - \epsilon}) for some Ο΅>0\epsilon > 0 | Θ(nlog⁑ba)\Theta(n^{\log_b a}) |
    | Case 2 | f(n)=Θ(nlog⁑balog⁑kn)f(n) = \Theta(n^{\log_b a} \log^k n) for some kβ‰₯0k \ge 0 | Θ(nlog⁑balog⁑k+1n)\Theta(n^{\log_b a} \log^{k+1} n) |
    | Case 3 | f(n)=Ξ©(nlog⁑ba+Ο΅)f(n) = \Omega(n^{\log_b a + \epsilon}) for some Ο΅>0\epsilon > 0, AND the regularity condition holds: af(n/b)≀cf(n)a f(n/b) \le c f(n) for some constant c<1c < 1 and large nn. | Θ(f(n))\Theta(f(n)) |

    ---

    Must Remember

  • Identify the Recurrence Type:

  • * Linear: Form c0an+c1anβˆ’1+β‹―=F(n)c_0 a_n + c_1 a_{n-1} + \dots = F(n). Use the characteristic equation method.
    * Divide and Conquer: Form T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n). Use the Master Theorem.
    * Non-standard: Form T(n)=T(n)+…T(n) = T(\sqrt{n}) + \dots. Use substitution (e.g., let n=2kn=2^k or n=22kn=2^{2^k}).

  • Solving Non-Homogeneous Relations: For an=(LHRRΒ part)+F(n)a_n = (\text{LHRR part}) + F(n), the total solution is an=an(h)+an(p)a_n = a_n^{(h)} + a_n^{(p)}.

  • * an(h)a_n^{(h)} is the solution to the homogeneous part.
    * an(p)a_n^{(p)} is the particular solution. Guess its form based on F(n)F(n).

  • The Particular Solution Trap: If your guess for the particular solution an(p)a_n^{(p)} is already part of the homogeneous solution an(h)a_n^{(h)}, you must multiply your guess by nmn^m, where mm is the multiplicity of the corresponding root in the characteristic equation.
  • Dominant Term: For asymptotic analysis of LHRRs, the complexity is determined by the root with the largest absolute value. If ∣rmax∣|r_{max}| is the largest magnitude root, the complexity is Θ(∣rmax∣n)\Theta(|r_{max}|^n).
  • ---

    Common Mistakes

    ---

    Quick Practice

    type="MCQ" question="A recurrence relation is defined by T(n)=6T(nβˆ’1)βˆ’9T(nβˆ’2)T(n) = 6T(n-1) - 9T(n-2) for nβ‰₯2n \ge 2, with initial conditions T(0)=1T(0) = 1 and T(1)=6T(1) = 6. What is the asymptotic bound for T(n)T(n)?" options=["Θ(3n)\Theta(3^n)","Θ(n3n)\Theta(n 3^n)","Θ(n23n)\Theta(n^2 3^n)","Θ(6n)\Theta(6^n)"] answer="Θ(n3n)\Theta(n 3^n)" hint="Form the characteristic equation and check for repeated roots." solution="The characteristic equation is

    r2βˆ’6r+9=0r^2 - 6r + 9 = 0

    which is
    (rβˆ’3)2=0(r-3)^2 = 0

    This gives a repeated root r=3r=3 with multiplicity 2. The general solution is
    T(n)=(c1+c2n)3nT(n) = (c_1 + c_2 n)3^n

    Using initial conditions:
    T(0)=1β€…β€ŠβŸΉβ€…β€Š(c1+0)30=1β€…β€ŠβŸΉβ€…β€Šc1=1T(0)=1 \implies (c_1 + 0)3^0 = 1 \implies c_1=1

    T(1)=6β€…β€ŠβŸΉβ€…β€Š(c1+c2)31=6β€…β€ŠβŸΉβ€…β€Š(1+c2)3=6β€…β€ŠβŸΉβ€…β€Šc2=1T(1)=6 \implies (c_1 + c_2)3^1 = 6 \implies (1+c_2)3=6 \implies c_2=1

    The solution is
    T(n)=(1+n)3nT(n) = (1+n)3^n

    The dominant term is n3nn3^n, so the complexity is Θ(n3n)\Theta(n3^n).
    Answer: \boxed{\Theta(n3^n)}"

    type="NAT" question="Consider the recurrence T(n)=T(nβˆ’1)+2nβˆ’1T(n) = T(n-1) + 2n - 1 for nβ‰₯1n \ge 1, with the base case T(0)=0T(0) = 0. Calculate the value of T(10)T(10)." answer="100" hint="Unfold the recurrence or recognize the sum. T(n)=βˆ‘i=1n(2iβˆ’1)T(n) = \sum_{i=1}^{n} (2i-1)." solution="This recurrence represents the sum of the first nn odd integers. The sum of the first nn odd integers is n2n^2.

    T(n)=T(nβˆ’1)+2nβˆ’1T(n) = T(n-1) + 2n-1

    T(n)=T(nβˆ’2)+(2(nβˆ’1)βˆ’1)+(2nβˆ’1)T(n) = T(n-2) + (2(n-1)-1) + (2n-1)

    ...
    T(n)=T(0)+βˆ‘i=1n(2iβˆ’1)=0+n2=n2T(n) = T(0) + \sum_{i=1}^{n} (2i-1) = 0 + n^2 = n^2

    Therefore,
    T(10)=102=100T(10) = 10^2 = 100

    Answer: \boxed{100}"

    ---

    Remember

    > First, classify the recurrence relation (Linear, Divide-and-Conquer, or Other). Then, apply the corresponding standard technique systematically.

    See full notes for detailed derivations and more complex examples!

    ---

    ---

    Part 3: Generating Functions

    Key Definitions

    An Ordinary Generating Function (OGF) for an infinite sequence {a0,a1,a2,… }\{a_0, a_1, a_2, \dots\} is a formal power series where the coefficient of xnx^n is the nn-th term of the sequence, ana_n. It acts as a "clothesline" for the sequence.

    The OGF A(x)A(x) is defined as:

    A(x)=βˆ‘n=0∞anxn=a0+a1x+a2x2+…A(x) = \sum_{n=0}^{\infty} a_n x^n = a_0 + a_1 x + a_2 x^2 + \dots

    Here, xx is a formal variable, not a number to be evaluated.

    ---

    Essential Formulas

    The core of using generating functions is recognizing and manipulating their closed-form representations.

    ---

    Must Remember

    Operations on generating functions correspond directly to operations on their sequences. This is their primary utility. Let A(x)↔{an}A(x) \leftrightarrow \{a_n\} and B(x)↔{bn}B(x) \leftrightarrow \{b_n\}.

  • Addition/Subtraction: Adding two generating functions corresponds to adding their respective sequences term by term.

  • A(x)+B(x)=βˆ‘(an+bn)xnA(x) + B(x) = \sum (a_n + b_n)x^n

  • Multiplication (Convolution): Multiplying two generating functions results in a new generating function whose coefficients are the convolution of the original sequences. This is the most powerful tool for solving partition and combination problems.

  • C(x)=A(x)B(x)β€…β€ŠβŸΉβ€…β€Šcn=βˆ‘k=0nakbnβˆ’kC(x) = A(x)B(x) \implies c_n = \sum_{k=0}^{n} a_k b_{n-k}

    * Example: Finding the number of ways to make change for nn cents using pennies and nickels. The GF for pennies is (1+x+x2+… )(1+x+x^2+\dots) and for nickels is (1+x5+x10+… )(1+x^5+x^{10}+\dots). The product's xnx^n coefficient gives the answer.
  • Finding a specific coefficient: The primary goal is often finding [xn]A(x)[x^n]A(x), which means "the coefficient of xnx^n in the series expansion of A(x)A(x)". This coefficient is the answer to a counting problem for size nn.
  • ---

    Common Mistakes

    ---

    Quick Practice

    type="NAT" question="A problem can be modeled by finding the coefficient of x10x^{10} in the expansion of the generating function A(x)=(11βˆ’x)4A(x) = (\frac{1}{1-x})^4. What is the numerical value of this coefficient?" answer="286" hint="This is equivalent to finding the number of non-negative integer solutions to e1+e2+e3+e4=10e_1+e_2+e_3+e_4 = 10. Use the formula for the coefficient of xnx^n in (1βˆ’x)βˆ’k(1-x)^{-k}." solution="We need to find [x10][x^{10}] in (1βˆ’x)βˆ’4(1-x)^{-4}. The formula for the coefficient of xnx^n in the expansion of (1βˆ’x)βˆ’k(1-x)^{-k} is (n+kβˆ’1kβˆ’1)\binom{n+k-1}{k-1}. Here, n=10n=10 and k=4k=4.
    The coefficient is

    (10+4βˆ’14βˆ’1)=(133)=13Γ—12Γ—113Γ—2Γ—1=13Γ—2Γ—11=286\binom{10+4-1}{4-1} = \binom{13}{3} = \frac{13 \times 12 \times 11}{3 \times 2 \times 1} = 13 \times 2 \times 11 = 286

    Answer: \boxed{286}"

    type="MCQ" question="Which generating function models the problem of selecting nn items from three distinct types, where the first type must be selected an even number of times, the second an odd number of times, and the third any number of times?" options=["1(1βˆ’x2)(1βˆ’x)\frac{1}{(1-x^2)(1-x)}","x(1βˆ’x2)(1βˆ’x)\frac{x}{(1-x^2)(1-x)}","x(1βˆ’x)2(1+x)3\frac{x}{(1-x)^2(1+x)^3}","x(1βˆ’x)3(1+x)2\frac{x}{(1-x)^3(1+x)^2}"] answer="x(1βˆ’x)3(1+x)2\frac{x}{(1-x)^3(1+x)^2}" hint="Construct the generating function for each constraint separately and multiply them together. The GF for even powers is 1/(1βˆ’x2)1/(1-x^2) and for odd powers is x/(1βˆ’x2)x/(1-x^2)." solution="GF for even selections (type 1):

    G1(x)=1+x2+x4+β‹―=11βˆ’x2G_1(x) = 1+x^2+x^4+\dots = \frac{1}{1-x^2}

    GF for odd selections (type 2):
    G2(x)=x+x3+x5+β‹―=x(1+x2+… )=x1βˆ’x2G_2(x) = x+x^3+x^5+\dots = x(1+x^2+\dots) = \frac{x}{1-x^2}

    GF for any number of selections (type 3):
    G3(x)=1+x+x2+β‹―=11βˆ’xG_3(x) = 1+x+x^2+\dots = \frac{1}{1-x}

    The combined generating function is the product:
    G(x)=G1(x)G2(x)G3(x)=11βˆ’x2β‹…x1βˆ’x2β‹…11βˆ’x=x(1βˆ’x2)2(1βˆ’x)G(x) = G_1(x)G_2(x)G_3(x) = \frac{1}{1-x^2} \cdot \frac{x}{1-x^2} \cdot \frac{1}{1-x} = \frac{x}{(1-x^2)^2(1-x)}

    Simplifying the denominator:
    (1βˆ’x2)2(1βˆ’x)=((1βˆ’x)(1+x))2(1βˆ’x)=(1βˆ’x)2(1+x)2(1βˆ’x)=(1βˆ’x)3(1+x)2(1-x^2)^2(1-x) = ((1-x)(1+x))^2(1-x) = (1-x)^2(1+x)^2(1-x) = (1-x)^3(1+x)^2

    Thus,
    G(x)=x(1βˆ’x)3(1+x)2G(x) = \frac{x}{(1-x)^3(1+x)^2}

    Answer: \boxed{\frac{x}{(1-x)^3(1+x)^2}}"

    ---

    Remember

    > Generating functions transform complex combinatorial counting problems into problems of algebraic manipulation of power series. Your goal is almost always to find the coefficient of xnx^n.

    See full notes for detailed explanations!

    ---

    Chapter Summary

    In this chapter, we have explored the fundamental principles of counting and their application in solving complex problems. A thorough understanding of these concepts is indispensable for success in the GATE examination. The most critical points to retain are as follows:

    • The Fundamental Principles of Counting: We have established that the Sum and Product Rules are the foundational axioms upon which combinatorial analysis is built. The ability to correctly identify whether a scenario requires addition (for disjoint choices) or multiplication (for sequential tasks) is a primary skill.
    • Permutations and Combinations: We have drawn a clear distinction between arrangements where order matters (permutations) and selections where it does not (combinations). Mastery of the associated formulas, including those for arrangements with repetitions and circular permutations, is essential for a wide range of problems. The core formulas are P(n,k)=n!(nβˆ’k)!P(n, k) = \frac{n!}{(n-k)!} and C(n,k)=(nk)=n!k!(nβˆ’k)!C(n, k) = \binom{n}{k} = \frac{n!}{k!(n-k)!}.
    • The Principle of Inclusion-Exclusion: For counting problems involving non-disjoint sets, we have seen that a simple application of the Sum Rule is insufficient. The Principle of Inclusion-Exclusion provides a systematic method for handling such cases by alternately adding and subtracting the cardinalities of intersecting sets.
    • Recurrence Relations: We have learned to model counting problems recursively, defining a term in a sequence based on its predecessors. A key technique introduced was the solution of linear homogeneous recurrence relations with constant coefficients by finding the roots of the characteristic equation.
    • Generating Functions: We have introduced generating functions as a powerful algebraic tool for solving counting problems and recurrence relations. A sequence {an}\{a_n\} can be encoded as a power series G(x)=βˆ‘n=0∞anxnG(x) = \sum_{n=0}^{\infty} a_n x^n, transforming a combinatorial problem into one of manipulating algebraic expressions. The coefficient of xnx^n in the resulting series provides the solution ana_n.

    ---

    Chapter Review Questions

    type="MCQ" question="Let ana_n denote the number of bit strings of length nn that do not contain the substring '11'. Which of the following recurrence relations, along with its initial conditions, correctly describes ana_n?" options=["an=anβˆ’1+2anβˆ’2a_n = a_{n-1} + 2a_{n-2} for nβ‰₯2n \ge 2; a0=1,a1=2a_0=1, a_1=2","an=anβˆ’1+anβˆ’2a_n = a_{n-1} + a_{n-2} for nβ‰₯2n \ge 2; a0=1,a1=2a_0=1, a_1=2","an=2anβˆ’1βˆ’anβˆ’2a_n = 2a_{n-1} - a_{n-2} for nβ‰₯2n \ge 2; a0=1,a1=2a_0=1, a_1=2","an=anβˆ’1+anβˆ’2a_n = a_{n-1} + a_{n-2} for nβ‰₯2n \ge 2; a0=1,a1=1a_0=1, a_1=1"] answer="B" hint="Consider a valid bit string of length nn. It can end with either a '0' or a '1'. Analyze the constraints on the prefix of length nβˆ’1n-1 or nβˆ’2n-2 in each case." solution="Let ana_n be the count of valid bit strings of length nn. We can construct such a string by considering its last bit.

    Case 1: The string ends with '0'.
    If the last bit is '0', the prefix of length nβˆ’1n-1 can be any valid bit string of length nβˆ’1n-1 that does not contain '11'. The number of such prefixes is, by definition, anβˆ’1a_{n-1}.

    Case 2: The string ends with '1'.
    If the last bit is '1', the bit at position nβˆ’1n-1 cannot be '1' (to avoid the substring '11'). Therefore, the bit at position nβˆ’1n-1 must be '0'. This means the string must end in '01'. The prefix of length nβˆ’2n-2 can be any valid bit string of length nβˆ’2n-2. The number of such prefixes is anβˆ’2a_{n-2}.

    Since these two cases are exhaustive and disjoint, we can use the Sum Rule to write the recurrence relation:

    an=anβˆ’1+anβˆ’2forΒ nβ‰₯2a_n = a_{n-1} + a_{n-2} \quad \text{for } n \ge 2

    Now, we must establish the initial conditions.

    • For n=0n=0: The empty string is a valid string. So, a0=1a_0 = 1.

    • For n=1n=1: The strings are "0" and "1". Both are valid. So, a1=2a_1 = 2.


    Let's check our recurrence with these values for n=2n=2:
    a2=a1+a0=2+1=3a_2 = a_1 + a_0 = 2 + 1 = 3

    The valid strings of length 2 are "00", "01", "10". The invalid string is "11". The count is indeed 3.
    Thus, the correct recurrence is an=anβˆ’1+anβˆ’2a_n = a_{n-1} + a_{n-2} with initial conditions a0=1,a1=2a_0=1, a_1=2. This corresponds to the Fibonacci sequence, shifted.
    Answer: \boxed{B}"

    type="NAT" question="A committee of 5 members is to be formed from a group of 6 men and 4 women. In how many ways can the committee be formed if it must contain at least 2 men and at least 2 women?" answer="180" hint="The constraints are 'at least 2 men' and 'at least 2 women'. Since the committee size is fixed at 5, this leaves only a few specific compositions. Calculate the number of ways for each valid composition and sum them up." solution="
    The total number of members is 6 men and 4 women. The committee size is 5.
    The constraints are:

  • Number of men β‰₯2\ge 2

  • Number of women β‰₯2\ge 2
  • Let mm be the number of men and ww be the number of women in the committee. We must have m+w=5m+w=5.
    We can enumerate the possible compositions of the committee that satisfy the given constraints:

    Case 1: 2 men and 3 women
    The number of ways to choose 2 men from 6 is (62)\binom{6}{2}.
    The number of ways to choose 3 women from 4 is (43)\binom{4}{3}.
    Total ways for this case =

    (62)Γ—(43)=6Γ—52Γ—1Γ—41=15Γ—4=60\binom{6}{2} \times \binom{4}{3} = \frac{6 \times 5}{2 \times 1} \times \frac{4}{1} = 15 \times 4 = 60

    Case 2: 3 men and 2 women
    The number of ways to choose 3 men from 6 is (63)\binom{6}{3}.
    The number of ways to choose 2 women from 4 is (42)\binom{4}{2}.
    Total ways for this case =

    (63)Γ—(42)=6Γ—5Γ—43Γ—2Γ—1Γ—4Γ—32Γ—1=20Γ—6=120\binom{6}{3} \times \binom{4}{2} = \frac{6 \times 5 \times 4}{3 \times 2 \times 1} \times \frac{4 \times 3}{2 \times 1} = 20 \times 6 = 120

    Are there any other cases? If we select 4 men, we can only select 1 woman, which violates the 'at least 2 women' constraint. Similarly, if we select 4 women, we can only select 1 man, violating the 'at least 2 men' constraint.

    Therefore, the total number of ways to form the committee is the sum of the ways from the two disjoint cases:
    Total ways = (Ways for Case 1) + (Ways for Case 2) = 60+120=18060 + 120 = 180.
    Answer: \boxed{180}"

    type="MCQ" question="What is the coefficient of x10x^{10} in the expansion of the generating function G(x)=x2(1βˆ’2x)3G(x) = \frac{x^2}{(1-2x)^3}?" options=["45β‹…2745 \cdot 2^7","55β‹…2855 \cdot 2^8","66β‹…2866 \cdot 2^8","45β‹…2845 \cdot 2^8"] answer="D" hint="Recall the generalized binomial theorem, specifically the expansion for (1βˆ’z)βˆ’k(1-z)^{-k}. You will need to account for the x2x^2 term in the numerator." solution="
    We are asked to find the coefficient of x10x^{10} in the expression G(x)=x2β‹…(1βˆ’2x)βˆ’3G(x) = x^2 \cdot (1-2x)^{-3}.
    This is equivalent to finding the coefficient of x8x^8 in the expansion of (1βˆ’2x)βˆ’3(1-2x)^{-3}.
    Using the generalized binomial theorem, we have:

    (1βˆ’z)βˆ’k=βˆ‘n=0∞(n+kβˆ’1kβˆ’1)zn(1-z)^{-k} = \sum_{n=0}^{\infty} \binom{n+k-1}{k-1} z^n

    In our problem, we have z=2xz=2x and k=3k=3. We need the term where the power of xx is 8, so we set n=8n=8.
    The coefficient of xnx^n in (1βˆ’2x)βˆ’3(1-2x)^{-3} is (n+3βˆ’13βˆ’1)2n=(n+22)2n\binom{n+3-1}{3-1} 2^n = \binom{n+2}{2} 2^n.
    For n=8n=8, the coefficient is:
    (8+22)28=(102)28\binom{8+2}{2} 2^8 = \binom{10}{2} 2^8

    Now, we calculate the binomial coefficient:
    (102)=10Γ—92Γ—1=45\binom{10}{2} = \frac{10 \times 9}{2 \times 1} = 45

    Thus, the coefficient is 45β‹…2845 \cdot 2^8.
    Answer: \boxed{D}"

    type="NAT" question="In a university, every student must take at least one course from the following three: Computer Science (CS), Electronics (EC), and Mathematics (MA). In a batch of 200 students, it is known that 150 students have taken CS, 100 have taken EC, and 80 have taken MA. If 60 students have taken both CS and EC, 50 have taken both EC and MA, and 70 have taken both CS and MA, how many students have taken all three courses?" answer="30" hint="Use the Principle of Inclusion-Exclusion for three sets. The total number of students in the union of the three sets is given in the problem." solution="
    Let SS be the set of all students in the batch. Let CC, EE, and MM be the sets of students who have taken Computer Science, Electronics, and Mathematics, respectively.
    We are given the following information:

    • Total number of students, ∣S∣=200|S| = 200.

    • Every student takes at least one course, so ∣CβˆͺEβˆͺM∣=200|C \cup E \cup M| = 200.

    • ∣C∣=150|C| = 150

    • ∣E∣=100|E| = 100

    • ∣M∣=80|M| = 80

    • ∣C∩E∣=60|C \cap E| = 60

    • ∣E∩M∣=50|E \cap M| = 50

    • ∣C∩M∣=70|C \cap M| = 70


    We need to find the number of students who have taken all three courses, which is ∣C∩E∩M∣|C \cap E \cap M|.

    We use the Principle of Inclusion-Exclusion for three sets:

    ∣CβˆͺEβˆͺM∣=∣C∣+∣E∣+∣Mβˆ£βˆ’(∣C∩E∣+∣E∩M∣+∣C∩M∣)+∣C∩E∩M∣|C \cup E \cup M| = |C| + |E| + |M| - (|C \cap E| + |E \cap M| + |C \cap M|) + |C \cap E \cap M|

    Substituting the given values into the formula:
    200=(150+100+80)βˆ’(60+50+70)+∣C∩E∩M∣200 = (150 + 100 + 80) - (60 + 50 + 70) + |C \cap E \cap M|

    200=330βˆ’(180)+∣C∩E∩M∣200 = 330 - (180) + |C \cap E \cap M|

    200=150+∣C∩E∩M∣200 = 150 + |C \cap E \cap M|

    Solving for ∣C∩E∩M∣|C \cap E \cap M|:
    ∣C∩E∩M∣=200βˆ’150=30|C \cap E \cap M| = 200 - 150 = 30

    Therefore, 30 students have taken all three courses.
    Answer: \boxed{30}"

    ---

    What's Next?

    Combinatorics is a foundational pillar of discrete mathematics, with profound implications across computer science and engineering. As you advance, you will find these principles interwoven with other critical areas:

    • Set Theory: The concepts of permutations and combinations are built upon the fundamental definitions and operations of set theory, providing a quantitative lens to analyze set structures.
    • Probability: Combinatorial techniques are indispensable for calculating probabilities, especially in discrete probability spaces where outcomes are finite and equally likely. Understanding "how many ways" an event can occur is the first step to determining "how likely" it is.
    • Analysis of Algorithms: Recurrence relations are the primary tool for analyzing the time and space complexity of recursive algorithms, particularly those employing divide-and-conquer strategies. Generating functions offer an alternative, often more elegant, method for solving these recurrences.
    • Graph Theory: Many graph problems, such as counting paths, cycles, or spanning trees, rely heavily on combinatorial reasoning and techniques.
    By mastering combinatorics, you are not just learning to count; you are developing a powerful analytical toolkit that will serve you throughout your studies and career in computer science.

    ... content continues

    All Short Notes Chapters

    Engineering Mathematics

    πŸ“– Combinatorics
    FREE
    πŸ”’ Graph Theory
    Premium
    πŸ”’ Propositional and First-Order Logic
    Premium
    πŸ”’ Algebraic Structures
    Premium
    πŸ”’ Set Theory, Relations, and Functions
    Premium
    πŸ”’ LU Decomposition
    Premium
    πŸ”’ Matrices and Determinants
    Premium
    πŸ”’ System of Linear Equations
    Premium
    πŸ”’ Eigenvalues and Eigenvectors
    Premium
    πŸ”’ Limits, Continuity, and Differentiability
    Premium
    πŸ”’ Integration
    Premium
    πŸ”’ Applications of Differentiation
    Premium
    πŸ”’ Probability Distributions
    Premium
    πŸ”’ Descriptive Statistics
    Premium
    πŸ”’ Probability Theory
    Premium

    Digital Logic

    πŸ”’ Boolean Algebra and Minimization
    Premium
    πŸ”’ Sequential Circuits
    Premium
    πŸ”’ Combinational Circuits
    Premium
    πŸ”’ Computer Arithmetic
    Premium
    πŸ”’ Number Representations
    Premium

    Computer Organization and Architecture

    πŸ”’ CPU Components
    Premium
    πŸ”’ Instruction Set Architecture (ISA)
    Premium
    πŸ”’ Memory Hierarchy
    Premium
    πŸ”’ I/O Interface
    Premium
    πŸ”’ Instruction Pipelining
    Premium

    Programming and Data Structures

    πŸ”’ Graphs
    Premium
    πŸ”’ Trees
    Premium
    πŸ”’ Core C Programming
    Premium
    πŸ”’ Recursion
    Premium
    πŸ”’ Arrays, Stacks, and Queues
    Premium
    πŸ”’ Linked Lists
    Premium

    Algorithms

    πŸ”’ Shortest Paths
    Premium
    πŸ”’ Minimum Spanning Trees (MST)
    Premium
    πŸ”’ Graph Traversals
    Premium
    πŸ”’ Asymptotic Complexity
    Premium
    πŸ”’ Searching, Sorting, and Hashing
    Premium
    πŸ”’ Dynamic Programming
    Premium
    πŸ”’ Greedy Algorithms
    Premium
    πŸ”’ Divide and Conquer
    Premium

    Theory of Computation

    πŸ”’ Context-Free Languages and Push-Down Automata
    Premium
    πŸ”’ Regular Languages and Finite Automata
    Premium
    πŸ”’ Turing Machines and Undecidability
    Premium

    Compiler Design

    πŸ”’ Code Optimization
    Premium
    πŸ”’ Runtime Environments
    Premium
    πŸ”’ Intermediate Code Generation
    Premium
    πŸ”’ Lexical Analysis
    Premium
    πŸ”’ Syntax-Directed Translation
    Premium
    πŸ”’ Parsing (Syntax Analysis)
    Premium

    Operating System

    πŸ”’ Concurrency and Synchronization
    Premium
    πŸ”’ Deadlock
    Premium
    πŸ”’ Processes, Threads, and System Calls
    Premium
    πŸ”’ Memory Management
    Premium
    πŸ”’ CPU and I/O Scheduling
    Premium
    πŸ”’ File Systems
    Premium

    Databases

    πŸ”’ ER-Model
    Premium
    πŸ”’ Relational Model
    Premium
    πŸ”’ Transactions and Concurrency Control
    Premium
    πŸ”’ File Organization and Indexing
    Premium
    πŸ”’ SQL
    Premium
    πŸ”’ Integrity Constraints and Normal Forms
    Premium

    Computer Networks

    πŸ”’ Layering Concepts and Switching
    Premium

    Why Use Short Notes?

    ⚑

    Quick Revision

    Cover entire syllabus in less time

    🎯

    Exam Focused

    Only important points and formulas

    πŸ“±

    Mobile Friendly

    Study on the go, anywhere

    Frequently Asked Questions

    What are short notes?

    Short notes are condensed, exam-focused summaries covering key concepts, formulas, and important points - perfect for quick revision before exams.

    Is the first chapter free?

    Yes! The first chapter's short notes are completely FREE with full content. Try before upgrading.

    How are short notes different from study notes?

    Short notes are concise summaries for quick revision, while study notes provide detailed explanations with examples and practice problems.

    Can I use short notes for last-minute revision?

    Absolutely! Short notes are specifically designed for quick revision before exams, covering all key points in minimal time.

    More GATECS 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