Questions tagged [generating-functions]

Generating functions are formed by making a series $\sum_{n\geq 0} a_n x^n$ out of a sequence $a_n$. They are used to count objects in enumerative combinatorics.

A generating function is a formal power series of the form \begin{equation*} f(x)=\sum^{\infty}_{n=0}a_nx^n \end{equation*} whose coefficients contain information about $a_n$, the sequence of numbers. For instance, suppose that the sequence is the Fibonacci sequence $0,1,1,2,3,5,8,\ldots$ Then$$f(x)=x+x^2+2x^3+3x^4+5x^5+\cdots,$$$$xf(x)=x^2+x^3+2x^4+3x^5+\cdots,$$and$$x^2f(x)=x^3+x^4+2x^5+\cdots.$$Then, it follows from the definition of the Fibonacci sequence that$$(1-x-x^2)f(x)=x$$This fact can be used to prove properties of the sequence, such as that its $n^\text{th}$ term is$$F_n = \frac{\varphi^n-(-\varphi)^{-n}}{\sqrt5},$$where $\varphi$ is the golden ratio.

3957 questions
99
votes
4 answers

Factorial and exponential dual identities

There are two identities that have a seemingly dual correspondence: $$e^x = \sum_{n\ge0} {x^n\over n!}$$ and $$n! = \int_0^{\infty} {x^n\over e^x}\ dx.$$ Is there anything to this comparison? (I vaguely remember a generating function/integration…
Mitch
  • 8,123
  • 2
  • 35
  • 68
55
votes
4 answers

The generating function for the Fibonacci numbers

Prove that $$1+z+2z^2+3z^3+5z^4+8z^5+13z^6+...=\frac{1}{1-(z+z^2)}$$ The coefficients are Fibonacci numbers, i.e., the sequence $\left\{1,1,2,3,5,8,13,21,...\right\}$.
50
votes
8 answers

Why are generating functions useful?

I was under the mistaken impression that if one could find the generating function for a sequence of numbers, you could just plug in a natural number $n$ to find the nth term of the sequence. I realize now that I was confusing this with a closed…
Dani Hobbes
  • 2,625
  • 1
  • 25
  • 32
45
votes
3 answers

Expected maximum number of unpaired socks

Like all combinatoric problems, this one is probably equivalent to another, well-known one, but I haven't managed to find such an equivalent problem (and OEIS didn't help), so I offer this one as being possibly new and possibly interesting. Problem…
Martin Kochanski
  • 3,388
  • 8
  • 18
44
votes
3 answers

Combinatorial Argument for Exponential and Logarithmic Function Being Inverse

Consider the following two generating functions: $$e^x=\sum_{n=0}^{\infty}\frac{x^n}{n!}$$ $$\log\left(\frac{1}{1-x}\right)=\sum_{n=1}^{\infty}\frac{x^n}{n}.$$ If we live in function-land, it's clear enough that there is an inverse relationship…
Milo Brandt
  • 58,703
  • 5
  • 98
  • 184
42
votes
8 answers

How are we able to calculate specific numbers in the Fibonacci Sequence?

I was reading up on the Fibonacci Sequence, $1,1,2,3,5,8,13,\ldots $ when I noticed some were able to calculate specific numbers. So far I've only figured out creating an array and counting to the value, which is incredibly simple, but I reckon I…
40
votes
2 answers

Generating function solution to previous question $a_{n}=a_{\lfloor n/2\rfloor}+a_{\lfloor n/3 \rfloor}+a_{\lfloor n/6\rfloor}$

In attempting to answer this question, I reduced it to a seemingly simple generating functions question, but after days of work was unable to construct a proof. Since I do not have experience trying to do asymptotics with generating functions, I…
38
votes
5 answers

Unexpected Proofs Using Generating Functions

I recently came across this beautiful proof by Erdős that uses generating functions in a unique way: Let $S = \{a_1, \cdots, a_n \}$ be a finite set of positive integers such that no two subsets of $S$ have the same sum. Prove that $$\sum_{i=1}^n…
Sandeep Silwal
  • 7,853
  • 1
  • 21
  • 44
38
votes
2 answers

Why do engineers use the Z-transform and mathematicians use generating functions?

For a (complex valued) sequence $(a_n)_{n\in\mathbb{N}}$ there is the associated generating function $$ f(z) = \sum_{n=0}^\infty a_nz^n$$ and the $z$-Transform $$ Z(a)(z) = \sum_{n=0}^\infty a_nz^{-n}$$ which only differ by the sign of the exponent…
Dirk
  • 11,270
  • 34
  • 57
37
votes
5 answers

A nice but somewhat challenging binomial identity

When working on a problem I was faced with the following binomial identity valid for integers $m,n\geq 0$: …
epi163sqrt
  • 94,265
  • 6
  • 88
  • 219
34
votes
4 answers

A sequence of coefficients of $x+(x+(x+(x+(x+(x+\dots)^6)^5)^4)^3)^2$

Let's consider a function (or a way to obtain a formal power series): $$f(x)=x+(x+(x+(x+(x+(x+\dots)^6)^5)^4)^3)^2$$ Where $\dots$ is replaced by an infinite sequence of nested brackets raised to $n$th power. The function is defined as the limit…
Yuriy S
  • 30,220
  • 5
  • 48
  • 168
32
votes
7 answers

Making Change for a Dollar (and other number partitioning problems)

I was trying to solve a problem similar to the "how many ways are there to make change for a dollar" problem. I ran across a site that said I could use a generating function similar to the one quoted below: The answer to our problem (293) is the …
Peter
  • 435
  • 1
  • 4
  • 6
31
votes
2 answers

Connection between the Laplace transform and generating functions

As I was sitting through a boring lecture rehashing basic techniques to solve ordinary differential equations, I began thinking about the Laplace transform and scribbled down a few ideas that I've copied below. Consider the Laplace transform…
30
votes
3 answers

How many connected graphs over V vertices and E edges?

Is there a way to calculate the number of simple connected graphs possible over given edges and vertices? Eg: 3 vertices and 2 edges will have 3 connected graphs But 3 vertices and 3 edges will have 1 connected graph Then 4 edges and 3 will have 4…
Nishad
  • 301
  • 1
  • 4
  • 4
30
votes
4 answers

How can I learn about generating functions?

The intent of this question is to provide a list of learning resources for people who are new to generating functions and would like to learn about them. I'm personally interested in combinatorics, and I sometimes use generating functions in…
awkward
  • 12,848
  • 1
  • 18
  • 30
1
2 3
99 100