BCA151 Discrete Structure

Discrete StructureUnit 99 min read

Combinatorial Proofs & Recurrence Relations: Techniques, Trees & Real-World Models

Unit 9 of Discrete Structure covers combinatorial proofs (proving identities via counting), recurrence relations (recursive sequences), and their applications in algorithms, finance, and combinatorics—with step-by-step visual traces and real-world ties to Nepalese tech (eSewa, Daraz) and global platforms (Google, Whats

TAKEAWAYS:

  • Combinatorial proofs prove identities by counting the same object in two different ways (e.g., proving by counting subsets of a set).
  • Recurrence relations define sequences recursively (e.g., Fibonacci ), solved via substitution, trees, or generating functions.
  • Binary trees model recursive algorithms (e.g., merge sort’s divide-and-conquer) and are counted via Catalan numbers.
  • Real-world links: eSewa’s transaction queues (recurrence), Daraz’s order routing (trees), and WhatsApp’s message delivery (combinatorial paths).
  • Exam focus: Prove identities combinatorially (not algebraically), solve recurrences with clear steps, and link proofs to counting principles.

1. Combinatorial Proofs: Counting Twice

Combinatorial proofs establish identities by interpreting both sides of an equation as counts of the same object. The key steps:

  1. Choose an identity (e.g., ).
  2. Interpret the LHS as one way to count the object (e.g., subsets of a set by size).
  3. Interpret the RHS as another way (e.g., subsets by inclusion/exclusion).
  4. Conclude equality because both count the same thing.

Example: Proving

LHS interpretation: Count the number of ways to form a committee of any size from people, where one member is the leader (marked by ).

  • For each , choose leaders (but only 1 leader per committee), then choose others: .
  • Sum over all possible committee sizes .

RHS interpretation: First pick the leader ( choices), then let each of the remaining people choose independently to join or not: .

Conclusion: Both count the same thing (committees with a leader), so the identity holds.

graph LR
    A["LHS: Sum over k of k*C(n,k)"] -->|"Committee with leader"| B["Count by committee size"]
    C["RHS: n*2^(n-1)"] -->|"Pick leader, then others"| B
    B --> D["Same object: Committees with a leader"]

Daraz’s delivery system routes orders through multiple hubs. Suppose an order passes through hubs, and at each hub, it can go left or right. The total number of possible paths is . If we instead count paths by the number of left turns (), we get: This matches our identity: Daraz’s system must handle "left-turn" paths to ensure all routes are accounted for.


2. Recurrence Relations: Defining Sequences Recursively

A recurrence relation defines a sequence based on previous terms. Examples:

  • Fibonacci: , , .
  • Binary trees: (each node splits into 2 subtrees).
  • Merge sort: (divide, sort, merge).

Solving Recurrences: Methods

Method When to Use Example
Substitution Simple guess-and-check patterns →
Recursion trees Algorithmic recurrences (e.g., divide-and-conquer) Merge sort’s
Generating functions Linear recurrences with constant coefficients

Example: Solving (Merge Sort)

Recursion tree approach:

  1. Draw the tree where each node splits into 2 children, and the cost at each level is .
  2. The total cost is the sum of all nodes:
  3. Visual:
    
    

Real-World Link: eSewa’s Transaction Queue eSewa processes transactions in batches. Suppose each batch splits into 2 sub-batches, and processing each batch costs units. The total cost follows the same recurrence: Solving this shows eSewa’s system scales as , explaining why transaction times grow slowly even for large .


3. Binary Trees and Catalan Numbers

Binary trees are fundamental in recursion and combinatorics. The number of full binary trees with leaves is the -th Catalan number:

Example: Counting Valid Parentheses

The number of valid parentheses sequences with pairs is . For :

  • Valid sequences: ((())), (()()), (())(), ()(()), ()()() → .

Combinatorial proof:

  1. LHS: Count all possible sequences of opens and closes.
  2. RHS: Use Catalan’s formula or a recursive bijection to binary trees.

Real-World Link: WhatsApp’s Message Delivery WhatsApp’s message delivery can be modeled as a binary tree where each node represents a routing decision (e.g., forward to server A or B). The number of valid delivery paths for hops is , ensuring no deadlocks.


4. Proof Techniques for Recurrences

Technique Steps Example
Induction Base case + inductive step (assume , prove ) Prove for Fibonacci-like sequences
Substitution Guess a closed form, verify by substitution →
Recursion trees Sum costs at each level of the tree Merge sort’s

Example: Proving for

  1. Base case: .
  2. Inductive step: Assume . Then:
  3. Conclusion: By induction, for all .

5. Comparing Proof Methods

Method Strengths Weaknesses Best For
Combinatorial Intuitive, visual Requires clever counting Identities like
Induction Rigorous, generalizable Can be tedious for complex recurrences Proving statements for all
Substitution Quick for simple patterns Guesswork required Linear recurrences with constants

6. Common Mistakes to Avoid

  1. Algebraic vs. combinatorial proofs: Never manipulate symbols without a counting interpretation.
    • ❌ Wrong: "Because , set ."
    • ✅ Right: "Both sides count subsets of an -element set."
  2. Ignoring base cases: Recurrence solutions must satisfy initial conditions.
  3. Misapplying Catalan numbers: Only use for binary trees or balanced structures.

In the Real World

  1. eSewa’s Transaction Processing

    • Idea: Recurrence relations model the cost of splitting transactions into sub-batches.
    • How: The recurrence describes how processing time scales with batch size, helping eSewa optimize server loads.
  2. Daraz’s Order Routing

    • Idea: Binary trees represent possible paths for orders through warehouses.
    • How: The number of valid routing paths is a Catalan number, ensuring Daraz can pre-allocate resources efficiently.
  3. WhatsApp’s Message Delivery

    • Idea: Valid delivery sequences (no deadlocks) are counted by Catalan numbers.
    • How: For hops, ensures all possible delivery trees are accounted for, minimizing retries.
  4. Nepal Rastra Bank’s Loan Amortization

    • Idea: Recurrence relations model loan repayment schedules.
    • How: The monthly payment satisfies , derived from a recurrence on remaining principal.

Exam Tip

  1. For combinatorial proofs:

    • Always state what you’re counting (e.g., "committees," "paths").
    • Show two interpretations (LHS and RHS) with clear sentences.
    • Example starter:

      "We prove by counting subsets of an -element set in two ways: ..."

  2. For recurrences:

    • Label your steps: "Base case," "Inductive hypothesis," "Inductive step."
    • Draw recursion trees for divide-and-conquer recurrences (e.g., merge sort).
    • Verify solutions by plugging in small values (e.g., ).
  3. Common exam pitfalls:

    • Forgetting to define the recurrence’s base case.
    • Using algebraic manipulation instead of combinatorial reasoning.
    • Misapplying Catalan numbers (e.g., to unbalanced trees).

Visual Summary:

mindmap
  root((Combinatorial Proofs & Recurrences))
    Combinatorial Proofs
      Count twice
      Example: Committees
      Real: Daraz paths
    Recurrence Relations
      Define recursively
      Solve via substitution/trees
      Real: eSewa transactions
    Binary Trees
      Catalan numbers
      Real: WhatsApp delivery
    Proof Techniques
      Induction
      Substitution
      Recursion trees

Based on the TU BCA syllabus for Discrete Structure (BCA151), unit 9.

Discussion

Loading…