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.

ປັດຈຸບັນ​ທ່ານ ບໍ່ມີ​ເຄື່ອງ​ຄິດໄລ່​ທີ່​ຈະ​ແກ້ໄຂ​ບັນຫາ​ນີ້​ໄດ້, ແຕ່​ສ່ວນ​ຂອງ​ມັນ​ສາມາດ​ຄິດໄລ່​ໄດ້. ພະຍາຍາມ​ອັນ​ໃດ​ອັນ​ໜຶ່ງ​ຂ້າງ​ລຸ່ມນີ້ ຫຼື ພິມ​ຕົວ​ເອງ​ເອງ.

ຮັກສາ​ການ​ເຮັດວຽກ​ຂອງ​ທ່ານ​ໄວ້

ບັນຊີຟຣີ ເພີ່ມ​ຂໍ້​ມູນ​ໃສ່​ບົດຮຽນ​ທຸກ​ບົດ, ບັນທຶກ​ຂອງ​ສິ່ງທີ່​ທ່ານ​ໄດ້​ເຮັດ​ແລ້ວ, ບັນຫາ​ທີ່​ທ່ານ​ໄດ້​ແກ້​ໄຂ​ໄວ້​ໃນ​ບ່ອນ​ດຽວ ແລະ ຄູ​ສອນ​ທີ່​ທ່ານ​ສາມາດ​ຖາມ​ກ່ຽວກັບ​ໜ້າ​ນີ້. ຄະນິດສາດ​ເອງ​ແມ່ນ​ເປີດ​ໃຫ້​ທຸກ​ຄົນ, ບໍ່​ວ່າ​ຈະ​ໄດ້​ເຂົ້າ​ສູ່​ລະບົບ ຫຼື ບໍ່.

ລົງທະບຽນ ចូល

ຕົວ​ສະ​ແດງ​ທີ່​ໃຊ້​ຢູ່​ທີ່​ນີ້

ກົດ​ຕົວ​ອັກສອນ​ໃດ​ໜຶ່ງ​ເພື່ອ​ເບິ່ງ​ຄວາມ​ໝາຍ​ເຕັມ, ຮູບ ແລະ ຕົວອັກສອນ​ແຕ່ລະ​ຕົວ​ໃນ​ມັນ​ໝາຍ​ຄວາມ​ວ່າ​ແນວໃດ.

ຄໍາຖາມທີ່ຄົນຖາມ

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.

ບາງສ່ວນຂອງ ໜ້າ ນີ້ ຖືກປັບແຕ່ງຈາກ Keller & Trotter, Applied Combinatorics (CC BY-SA 4.0). ຖືກ​ປະສົມ​ປະສານ​ແລະ​ອະທິບາຍ​ຄືນ​ໃໝ່​ທີ່​ນີ້; ຄວາມ​ຜິດ​ພາດ​ແມ່ນ​ຂອງ​ເຮົາ.

ເພີ່ມເຕີມໃນ Combinatorics & Graph Theory