BCA151 Discrete Structure

Discrete StructureUnit 59 min read

Sequences, Induction: Proofs, Recurrence, Trees

Unit 5 of Discrete Structure covers sequences (arithmetic/geometric), mathematical induction (strong/weak), recurrence relations (linear/nonlinear), and their applications in algorithms and combinatorics—with visual proofs, real-world examples, and exam-focused strategies.

TAKEAWAYS:

  • Sequences are ordered lists defined by explicit or recursive formulas (e.g., Fibonacci: ).
  • Mathematical induction proves statements for all via a base case and inductive step (weak/strong forms).
  • Recurrence relations model problems like tree heights or algorithm steps (e.g., merge sort’s ).
  • Binary trees (e.g., expression trees) visualize recursion and counting (e.g., Catalan numbers for valid parentheses).
  • Real-world ties: Loan interest (geometric sequences), Pathao’s ride allocation (recurrence), and NEPSE stock trends (induction proofs).
  • Exam focus: Prove statements step-by-step with clear assumptions; solve recurrences using substitution/method of characteristics.

1. Sequences: Definitions and Types

A sequence is an ordered list of elements (finite or infinite) defined by a rule. Sequences are classified by their generating formula:

A. Explicit vs. Recursive Definitions

Type Definition Example Visualization
Explicit Direct formula for 1, 4, 7, 10, ...
Recursive Defined using previous terms Fibonacci spiral (nature)
0.511.522.533.544.55510152025xyRecursive: aₙ = aₙ₋₁ * 2, a₁=2n=1n=2n=3
Explicit vs recursive definition of geometric sequence aₙ = 2ⁿ

B. Common Sequence Types

  1. Arithmetic Sequence:

    • Formula:
    • Example: Monthly loan repayments (fixed amount + interest).
    • Real-world: NTC’s monthly electricity bill increase by Rs. 50 (arithmetic with ).
  2. Geometric Sequence:

    • Formula:
    • Example: Compound interest in banks (e.g., ).
    • Real-world: Daraz’s "Buy 1 Get 1 Free" discount (halving price each step: ).
  3. Fibonacci Sequence:

    • Recurrence:
    • Application: Modeling population growth or tree branching.

2. Mathematical Induction: The Proof Technique

Induction proves statements for all natural numbers by:

  1. Base Case: Verify for (or ).
  2. Inductive Step: Assume true for (weak) or all (strong), then prove for .

A. Weak vs. Strong Induction

Feature Weak Induction Strong Induction
Assumption is true are true
Use Case Simple recurrences (e.g., ) Complex dependencies (e.g., Fibonacci)
Example Prove Prove (Fibonacci bounded by golden ratio)

B. Worked Example: Sum of Odd Numbers

Statement: Prove for all .

Proof:

  1. Base Case ():
  2. Inductive Step:
    • Assume true for : .
    • Prove for :
    • Conclusion: By induction, the statement holds for all .

Visualization:

0123456789101 = 1²1+3=4=2²1+3+5=9=3²1+3+5+7=16=4²
Sum of first n odd numbers = n² (visual proof for base cases)

C. Common Pitfalls

  • Skipping the base case: Always verify !
  • Incorrect inductive hypothesis: For strong induction, assume all previous cases.
  • Algebraic errors: Double-check expansions (e.g., ).
startAssume P(k)Prove P(k+1)ValidBase CaseInductive StepConclusion
Induction proof structure (common mistake: skipping base case)

3. Recurrence Relations: Modeling Problems

A recurrence relation defines a sequence based on previous terms. Solving it gives a closed-form formula.

A. Types of Recurrences

  1. Linear Recurrence:

    • Form:
    • Example: Fibonacci ().
  2. Nonlinear Recurrence:

    • Form: (e.g., Ackermann function).

B. Solving Methods

Method When to Use Example
Substitution Simple patterns (e.g., ) Binary search recurrence
Method of Characteristics Linear homogeneous recurrences (merge sort)
Generating Functions Complex recurrences (e.g., Fibonacci)

C. Worked Example: Merge Sort Recurrence

Recurrence: (divide-and-conquer). Solution:

  1. Guess: .
  2. Verify using substitution:
    • Assume for some .
    • Show .
    • For large , is dominated by , so the guess holds.

Real-world Tie: Pathao’s ride allocation splits orders into regions (divide), processes them (conquer), and combines results (merge).


4. Binary Trees and Recursion

Recursion is visualized using binary trees, where:

  • Nodes represent recursive calls.
  • Leaves represent base cases.

A. Expression Trees

Convert arithmetic expressions to trees to evaluate recursively:

Post-order traversal: → Evaluates to .

B. Counting Trees: Catalan Numbers

The number of valid binary trees with nodes is the th Catalan number: Example: (all possible binary trees for 3 nodes).

Real-world Tie: NEPSE’s stock price brackets (valid parentheses) or Daraz’s nested discount categories.


5. In the Real World

Company/Product Concept Applied How It Works
Ncell (Nepal) Geometric sequences Data plans: "Buy 1GB, get 50% extra" →
Khalti (eSewa) Recurrence relations Loan EMI calculation:
Pathao (Ride-hailing) Divide-and-conquer (merge sort analogy) Splits city into zones, allocates drivers recursively.
NTC (Electricity) Arithmetic sequences Fixed monthly charge + Rs. 50 increment per unit over threshold.
Banks (Loan Interest) Compound interest (geometric sequence) → Monthly installments grow exponentially.

6. Exam Tip: Proving with Induction

  1. Structure:
    • Header: Clearly state "By mathematical induction, we prove..."
    • Base Case: Show (or ) holds.
    • Inductive Step:
      • Assume is true.
      • Prove using the assumption.
  2. Common Exam Questions:
    • Prove .
    • Solve (recurrence for insertion sort).
  3. Avoid:
    • Circular logic (e.g., assuming what you need to prove).
    • Skipping justification (always explain why the step follows).

7. Practice Problems

  1. Prove using induction: .
  2. Solve the recurrence: with .
  3. Draw the binary tree for and compute post-order traversal.
  4. Real-world: If Daraz offers "Buy 2 items, get 1 free," model the discount sequence.

8. Summary Table

Topic Key Idea Example Exam Weight
Sequences Ordered lists (explicit/recursive) Loan EMIs, Fibonacci 15%
Induction Base case + inductive step Sum proofs, divisibility 30%
Recurrences Closed-form solutions Merge sort, Fibonacci 25%
Binary Trees Recursive structure Expression trees, Catalan nums 20%
Applications Real-world modeling Banks, e-commerce, algorithms 10%

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

Discussion

Loading…