The Fibonacci sequence begins with 0 and 1, and each subsequent number is the sum of the two preceding numbers:
0,\ 1,\ 1,\ 2,\ 3,\ 5,\ 8,\ 13,\ 21,\ldotsBut suppose we want to find the 100th Fibonacci number. Must we calculate all the preceding terms?
Surprisingly, we can find it directly. The key is a mathematical tool called the Z-transform, which converts recurrence relations into algebraic equations.
1. The Fibonacci Problem
The Fibonacci numbers are defined by
F_{n+2}=F_{n+1}+F_n,\qquad F_0=0,\quad F_1=1.Our goal is to find a formula for F_n that does not require calculating all the preceding terms.
2. What Is the Z-Transform?
Given a sequence a_0,a_1,a_2,\ldots, its one-sided Z-transform is defined by
A(z)=\sum_{n=0}^{\infty}a_nz^{-n}.For example, consider the constant sequence 1,1,1,1,\ldots. Its Z-transform is
A(z)=1+z^{-1}+z^{-2}+\cdots=\frac{1}{1-z^{-1}}=\frac{z}{z-1},\qquad |z|>1.An infinite sequence has been represented by a simple rational function. This is the central idea behind the Z-transform.
3. Why Is the Z-Transform Useful for Recurrences?
The important property is that shifting a sequence becomes an algebraic operation. If A(z) is the Z-transform of a_n, then
\mathcal Z\{a_{n+1}\}=zA(z)-za_0.Similarly,
\mathcal Z\{a_{n+2}\}=z^2A(z)-z^2a_0-za_1.These identities follow by changing the summation index. The initial values appear naturally in the formulas. A recurrence involving shifted terms can therefore become an algebraic equation.
4. Solving the Fibonacci Recurrence
Let A(z) denote the Z-transform of the Fibonacci sequence. Applying the transform to F_{n+2}=F_{n+1}+F_n gives
z^2A(z)-z=zA(z)+A(z).Collecting terms,
(z^2-z-1)A(z)=z.Therefore,
\boxed{A(z)=\frac{z}{z^2-z-1}}.We have transformed the entire Fibonacci recurrence into a single rational function.
5. Recovering the Fibonacci Numbers
The denominator has two roots:
\alpha=\frac{1+\sqrt5}{2},\qquad\beta=\frac{1-\sqrt5}{2}.Thus,
A(z)=\frac{z}{(z-\alpha)(z-\beta)}=\frac{1}{\sqrt5}\left(\frac{z}{z-\alpha}-\frac{z}{z-\beta}\right).From the geometric series,
\mathcal Z\{r^n\}=\frac{z}{z-r},\qquad |z|>|r|.Taking the inverse Z-transform gives
\boxed{F_n=\frac{\alpha^n-\beta^n}{\sqrt5}}.Equivalently,
F_n=\frac{1}{\sqrt5}\left[\left(\frac{1+\sqrt5}{2}\right)^n-\left(\frac{1-\sqrt5}{2}\right)^n\right].This is the famous Binet formula. We have derived it without calculating individual Fibonacci numbers.
6. Finding the 100th Fibonacci Number
The number
\varphi=\frac{1+\sqrt{5}}{2}is known as the golden ratio. The other root is
\beta=\frac{1-\sqrt{5}}{2}=-\frac{1}{\varphi}.Since the absolute value of \beta is less than 1, its powers approach zero. Binet’s formula gives
F_n=\frac{\varphi^n}{\sqrt{5}}-\frac{\beta^n}{\sqrt{5}}.The absolute value of the second term is always less than one-half. Since Fibonacci numbers are integers, this means that F_n is exactly the nearest integer to \varphi^n/\sqrt{5}. Thus,
F_n=\operatorname{round}\left(\frac{\varphi^n}{\sqrt{5}}\right).In particular, using sufficiently accurate arithmetic, we obtain
\boxed{F_{100}=354224848179261915075}.We have found a Fibonacci number with 21 digits without calculating the preceding 99 terms.
7. A More Challenging Example
The Z-transform is not limited to the Fibonacci sequence. Consider the recurrence
a_{n+2}=3a_{n+1}-2a_n+2^n,\qquad a_0=a_1=0.Unlike the Fibonacci recurrence, this equation contains an additional term 2^n, called a forcing term.
Let A(z) be the Z-transform of a_n. Applying the transform gives
z^2A(z)=3zA(z)-2A(z)+\frac{z}{z-2}.Hence,
A(z)=\frac{z}{(z-1)(z-2)^2}.Partial fractions produce
A(z)=\frac{z}{z-1}-\frac{z}{z-2}+\frac{z}{(z-2)^2}.To invert the last term, we use
\mathcal Z\{nr^{n-1}\}=\frac{z}{(z-r)^2},\qquad |z|>|r|.Taking inverse transforms gives
\boxed{a_n=1-2^n+n2^{n-1}}.The first few terms are
0,\ 0,\ 1,\ 5,\ 17,\ 49,\ldots.The forcing term and the recurrence were handled together through algebra. The repeated factor (z-2)^2 produces a term involving n2^n.
8. Where Is the Z-Transform Used?
The Z-transform is useful whenever a mathematical model evolves in discrete steps. Examples include:
- Digital signal processing: analyzing filters that process sampled measurements.
- Population models: studying populations that change from one generation to the next.
- Numerical methods: analyzing recurrences produced by algorithms for differential equations.
- Discrete dynamical systems: studying the long-term behavior and stability of sequences.
In each application, shifts of a sequence become algebraic expressions in the transformed variable.
9. A Connection to Generating Functions
The ordinary generating function of a sequence is
G(x)=\sum_{n=0}^{\infty}a_nx^n.Comparing definitions,
A(z)=G\left(\frac1z\right).Thus, the one-sided Z-transform is closely related to generating functions, a classical tool in combinatorics and number theory. Generating functions are often used for counting problems, while the Z-transform is especially useful for discrete systems and signal processing.
10. The Bigger Picture
The Z-transform illustrates a powerful mathematical strategy: rather than solving a difficult problem directly, we translate it into another language where the operations become simpler.
A recurrence becomes an algebraic equation. After solving that equation, we transform back to recover the original sequence.
This idea also appears in the Laplace transform, which simplifies differential equations, and the Fourier transform, which reveals the frequencies hidden inside a signal.
In the next article of this series, How Does a Digital Filter Remove Noise?, we apply the Z-transform to a recurrence with an external input and see how it explains digital filters.
Related Reading
Mathematical transforms also play an important role in modern communication systems. For another application of mathematics to signal processing, see Why Does an OFDM Signal Have a Rayleigh Distribution?

Leave a Reply