maths.free › Combinatorics & Graph Theory › Recurrence Equations › Using generating functions to solve recurrences

Using generating functions to solve recurrences

The approach we have seen thus far in this chapter is not the only way to solve recurrence equations. Additionally, it really only applies to linear recurrence equations with constant coefficients.

Using generating functions to solve recurrences

The approach we have seen thus far in this chapter is not the only way to solve recurrence equations. Additionally, it really only applies to linear recurrence equations with constant coefficients. In the remainder of the chapter, we will look at some examples of how generating functions can be used as another tool for solving recurrence equations. In this section, our focus will be on linear recurrence equations. In , we will see how generating functions can solve a nonlinear recurrence.

Our first example is the homogeneous recurrence that corresponds to the advancement operator equation in .

Example

Consider the recurrence equation \(r_{n}+r_{n-1}-6r_{n-2} = 0\) for the sequence \(\{r_n\colon n\geq 0\}\) with \(r_0=1\) and \(r_1=3\). This sequence has generating function \[\begin{aligned}\end{aligned}\] Now consider for a moment what the function \(xf(x)\) looks like. It has \(r_{n-1}\) as the coefficient on \(x_n\). Similarly, in the function \(-6x^2 f(x)\), the coefficient on \(x^n\) is \(-6r_{n-2}\).

What is our point in all of this? Well, if we add them all up, notice what happens. The coefficient on \(x_n\) becomes \(r_n+r_{n-1}-6r_{n-2}\), which is \(0\) because of the recurrence equation! Now let's see how this all lines up: \[\begin{aligned}f(x) \amp = r_0 + r_1 x + r_2x^2 + r_3 x^3 + \cdots + r_nx^n + \cdots \\ xf(x) \amp = 0 + r_0 x + r_1x^2 + r_2 x^3 + \cdots r_{n-1}x^n + \cdots \\ -6x^2f(x) \amp = 0 + 0 -6r_0x^2 - 6r_1 x^3 + \cdots - 6r_{n-2}x^n + \cdots\end{aligned}\] When we add the left-hand side, we get \(f(x)(1+x-6x^2)\). On the right-hand side, the coefficient on \(x^n\) for \(n\geq 2\) is \(0\) because of the recurrence equation. However, we are left with \(r_0 + (r_0+r_1)x = 1 + 4x\), using the initial conditions. Thus, we have the equation \[\begin{aligned}\end{aligned}\] or \(f(x) = (1+4x)/(1+x-6x^2)\). This is a generating function that we can attack using partial fractions in SageMath:

This shows us that \[\begin{aligned}\end{aligned}\]. From here, we read off \(r_n\) as the coefficient on \(x^n\) and have \(r_n = (6/5) 2^n -(1/5)(-3)^n\).

Although there's a bit more work involved, this method can be used to solve nonhomogeneous recurrence equations as well, as the next example illustrates.

Condensed: the full section is in Keller & Trotter, Applied Combinatorics.

Now you Không máy tính nào có thể tính toán được nó, nhưng các mảnh của nó có thể tính toán được. Thử một trong những cách dưới đây, hoặc gõ theo ý bạn.

Để cho anh làm việc

Một tài khoản miễn phí thêm ghi chú vào mỗi bài học, ghi chép những gì bạn đã hoàn thành, các bài toán bạn giải quyết ở một nơi, và một giáo viên bạn có thể hỏi về trang này. Toán học là mở cho mọi người, dù có đăng nhập hay không.

Đăng ký Đăng nhập

Ký hiệu được dùng ở đây

Nhấn vào bất kỳ ký hiệu nào để xem định nghĩa đầy đủ, một bức ảnh, và ý nghĩa của từng chữ cái trong nó.

Câu hỏi người ta hỏi

Permutation or combination?

Ask whether order matters. A lock code is a permutation (order matters); a hand of cards is a combination (it does not).

What is a graph in this sense?

Dots (vertices) joined by lines (edges), not a plot. Road maps, social networks and molecules are graphs; questions like "is there a route" and "how few colours" are graph theory.

Một số phần của trang này được chuyển từ Keller & Trotter, Applied Combinatorics (CC BY-SA 4.0). Được nén lại và giải thích lại ở đây; lỗi là của chúng tôi.

More in Combinatorics & Graph Theory