Generating Functions Part I - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Generating Functions Part I

Description:

Find the asymptotic form (O notation) of an increasing function f for which f(n) ... converges for |bx| 1, or |x| 1/|b| Generating function for combinations. Reading ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 14
Provided by: VasileiosH9
Category:

less

Transcript and Presenter's Notes

Title: Generating Functions Part I


1
Generating FunctionsPart I
  • Vasileios Hatzivassiloglou
  • University of Texas at Dallas

2
Exams
  • Quiz Wednesday, September 30
  • Midterm Wednesday, October 7
  • Goal Understand, do not memorize
  • You can bring a two-sided piece of paper (up to
    regular letter page size) with formulas,
    theorems, and notes
  • You do not need calculators

3
Review problems
  • Find the asymptotic form (O notation) of an
    increasing function f for which f(n) 3f(n/3)
    3 when n is divisible by 3.
  • Solve the recurrence relation T(n) 4T(n/2) 2,
    T(1) 2 when n is a power of 2.
  • An elimination tournament has n 2k teams in
    each round, all surviving teams play exactly one
    game and the winners advance to the next round.
    Construct recurrence relations for (a) the number
    of rounds played (b) the total number of games
    played.

4
The Master Theorem
  • Theorem 2 Let f(n) be an increasing function
    with f(n) af(n/b) cnd whenever n is a power
    of b, where a1, b integer greater than 1, c a
    positive real, and d a non-negative real. Then,
  • if altbd, f(n) O(nd)
  • if abd, f(n) O(ndlogn)
  • if agtbd, f(n) O(nlogba)
  • Observe that we compare d to logba

5
Applying Theorem 2
  • Merge sort
  • f(n) 2f(n/2) cn
  • a2, b2, d1
  • bd 21 2 a
  • O(n1logn) O(nlogn)

6
Multiplication complexity
  • Classical
  • O(n2)
  • Recursive
  • f(n) 4f(n/2) c1n
  • a 4, b 2, d 1
  • a gt bd so O(nlogba) O(nlog24) O(n2)
  • Fast
  • f(n) 3f(n/2) c2n
  • a 3, b 2, d 1
  • a gt bd so O(nlogba) O(nlog23) O(n1.6)

7
Generating Functions
  • An alternative representation of sequences
  • Definition If ak is a sequence, then its
    generating function is the infinite series
  • If ak is finite,
  • the generating function is a polynomial

8
Usefulness of generating functions
  • Can be used to solve some counting
    (combinatorial) problems with constraints
  • Can be used to solve recurrences
  • Can be used to prove new combinatorial theorems
  • Can be used to obtain asymptotic results
  • Benefit Use calculus tools

9
Technical issues
  • Generating functions represent a sequence as a
    power series
  • Two main issues
  • Does the series converge?
  • We really care for an interval around zero
  • Is the representation unique?

10
Examples
  • an 1
  • an b
  • an bn

converges for xlt1
converges for bxlt1, or xlt1/b
11
Generating function for combinations

12
Reading
  • Section 7.3 (Theorem 2 to Example 11)
  • Section 7.4 (Up to Example 5)

13
Review Problems
  • Find the asymptotic form (O notation) of an
    increasing function f for which f(n) 8f(n/4)
    n whenever n is divisible by 4.
  • What is the generating function for the finite
    sequence 1, 4, 16, 64, 256?
  • What is the generating function for the sequence
    an with an 0 if nlt3 and an 1 if n3?
Write a Comment
User Comments (0)
About PowerShow.com