Discrete and its Applications

Alexander Payne March 9, 2014

1 Introduction

In these notes, we will introduce the foundations of discrete calculus (a.k.a. the calculus of finite differences) as an elegant approach to the computation of sums of sequences. Then, we will show one application of discrete calculus to the Fibonacci sequence.

2 Motivation for Discrete Calculus

Consider the most basic of sums, the sum of all integers from 0 to k.

k X n n=0

We want to find an expression for this in terms of k. Consider k(k + 1).

k(k + 1) = k + k + ··· + k | {z } k+1times

= (0+k)+(1+(k −1))+(2+(k −2))+···+((k −2)+1)+((k −1)+1)+(k +0) Now, we can see that the first terms in each of the parentheses consists of Pk exactly the terms in n=0 n, and the same goes for the second term in each of the parentheses. Thus,

k k k X X X k(k + 1) = n + n = 2 n n=0 n=0 n=0 From this, we conclude that

k X k(k + 1) n = 2 n=0 That took a bit of work for such a simple sum! It would certainly be much Pk 2 Pk n more difficult to find n=0 n , let alone n=0 n2 . A systematic approach to finding expressions for finite (and infinite) sums is clearly desirable, particularly one that won’t depend so heavily on exactly what we’re summing. It turns out that discrete calculus is exactly what we want and more.

1 3 Foundations of Discrete Calculus

In this section and for the rest of these notes, we will work with sequences f = {f0, f1, f2, ...}, where each term of the sequence is a real number. In analogy with traditional calculus, we define the discrete derivative of this sequence.

Definition 3.1. For a sequence f = {f0, f1, f2, ...}, the forward difference (also called a discrete derivative) of f is a sequence 4f, which is defined by

4f = {f1 − f0, f2 − f1, f3 − f2, ...}

The n-th term of 4f is denoted by 4nf, where by the previous definition, 4nf = fn+1 − fn. n n+1 For a specific example, let f = {2, 4, 8, 16,..., 2 ,... }. Then, 4nf = 2 − 2n = 2n(2−1) = 2n. The sequence defined by {2n} is unique (up to a constant) in that it is a nontrivial sequence that is fixed under application of the forward difference. The forward difference measures how a sequence changes since if we consider the points (0, f0), (1, f1),..., (n, fn),... in the Cartesian plane, f − f 4 f = f − f = n+1 n n n+1 n (n + 1) − n

So, 4nf is the of the line connecting the points (n, fn) and (n + 1, fn+1). The forward difference has a couple important linearity properties. This is the content of the following theorem. Theorem 3.2. For a sequence f and a sequence g, 4(f + g) = 4f + 4g. Also, for a constant real number c, if the sequence cf is defined by cf = {cf1, cf2, cf3, ...}, then 4(cf) = c 4 f. It turns out that the forward difference is very useful in computing sums. Theorem 3.3 (The Fundamental Theorem of Discrete Calculus). For any se- quences f = {f0, f1, f2, ...} and g = {g0, g1, g2, ...} where 4g = f,

k X fn = gk+1 − g1 n=0 Proof.

k k X X fn = 4ng = gk+1 + (gk − gk) + ··· + (g2 − g2) − g1 = gk+1 − g1 n=0 n=0

This short little theorem turns out to be majorly useful! It means that we Pk have just transformed the problem of computing n=0 fn to the problem of finding a sequence g such that 4g = f. For example, we may now compute Pk n n n=0 c for any real constant c 6= 1 using this theorem. We find that 4c = (c)n+1 − cn = (c − 1)cn, so using Theorem 3.2 and dividing over c − 1 to the other side (the c 6= 1 condition is used here), we get cn 4( ) = cn c − 1

2 Thus, using the Fudamental Theorem of Discrete Calculus, we find that

k X ck+1 c0 ck+1 − 1 cn = − = c − 1 c − 1 c − 1 n=0

Then, for |c| < 1,

∞ k X X ck+1 − 1 ck+1 + 1 1 cn = lim cn = lim = lim = k→+∞ k→+∞ c − 1 k→+∞ 1 − |c| 1 − c n=0 n=0 We may not always apply the Fundamental Theorem of Discrete Calculus to infinite sums. In the proof of Theorem 3.2, we took advantage of the fact that we were using a finite sum to perform rearrangements of the terms. However, in the infinite sum case, we cannot assume that rearrangements of the sum will keep the sum the same. So, for technical reasons, if we add the condition P∞ n=0 |fn| < ∞, which is called absolute convergence, to the conditions of the Fundamental Theorem of Discrete Calculus, then we get that it is true for infinite sums as well. Now, we move on to a couple more theorems which will greatly expand the types of sums we can compute.

Theorem 3.4 (Discrete Calculus ). Let f = {f0, f1, f2, ...} and g = {g0, g1, g2, ...} be sequences, and define fg = {f0g0, f1g1, f2g2, ...}. Then, 4n(fg) = (4nf)gn+1 + fn(4ng). Proof.

4n(fg) = fn+1gn+1 − fngn = fn+1gn+1 − fngn+1 + fngn+1 − fngn

= (4nf)gn+1 + fn(4ng)

Now we may sum the product rule to get a very nice expression.

Theorem 3.5 ( by Parts). Let f = {f0, f1, f2, ...} and g = {g0, g1, g2, ...} be sequences. Then,

k k X X fn(4ng) = [fk+1gk+1 − f0g0] − (4nf)gn+1 n=0 n=0 Proof. By summing the product rule and applying the Fundamental Theorem of Discrete Calculus, we get

k X 4n(fg) = [fk+1gk+1 − f0g0] n=0 and

k k k k X X X X 4n(fg) = [(4nf)gn+1 + fn(4ng)] = [(4nf)gn+1] + fn(4ng) n=0 n=0 n=0 n=0

3 Pk Then, by solving for n=0 fn(4ng), we get

k k X X fn(4ng) = [fk+1gk+1 − f0g0] − (4nf)gn+1 n=0 n=0

Pk n This allows us to compute more complicated sums like n=0 nc . Let fn = n n and 4gn = c with c 6= 1, and apply the summation by parts formula to get

k k k X X cn (k + 1)ck+1 X cn+1 ncn = n 4 ( ) = [ − 0] − ((n + 1) − n) n c − 1 c − 1 c − 1 n=0 n=0 n=0

k k+1 (k + 1)ck+1 1 X (k + 1)ck+1 1 X = − cn+1 = − ( cn − 1) c − 1 c − 1 c − 1 c − 1 n=0 n=0 (k + 1)ck+1 1 ck+2 − 1 1 ck+2 − 1 = − ( − 1) = ((k + 1)ck+1 − + 1) c − 1 c − 1 c − 1 c − 1 c − 1 Pk n k+1 k+2 In particular, n=0 n2 = (k + 1)2 − 2 + 2 =. Pk 2 Finally, to find a sum like n=0 n , we must have one more definition. Definition 3.6. The m-th falling power (a.k.a. falling factorial) of n is denoted by nm, which is defined as

nm = n(n − 1)(n − 2) ... (n − m + 2)(n − m + 1)

Falling factorials are nice because

4nm = (n + 1)m − nm = (n + 1)n . . . (n − m + 2) − n(n − 1) ... (n − m + 1)

= (n + 1 − n + m − 1)n(n − 1) ... (n − m + 1) = mnm−1 So, we may write n2 = n2 + n1, which allows us to easily compute the sum of n2.

k k X X 1 1 1 1 k(k + 1)(2k + 1) n2 = (n2 + n1) = ( (k+1)3− 03)+( (k+1)2− 02) = 3 3 2 2 6 n=0 n=0 4 Discrete Calculus and the Fibonacci Numbers

We define a sequence {F0,F1,F2,F3,F4,... }, where F0 = 1 and F1 = 1 and successive terms are constructed using the recurrence relation Fn+2 = Fn+1+Fn. This sequence is known as the Fibonacci sequence, and its first few terms are {1, 1, 2, 3, 5, 8, 13,... }. We will find an expression for the n-th term of the Fibonacci sequence using the principles of discrete calculus. Now, we may write the recurrence relation in terms of forward differences.

Fn+2 = Fn+1 + Fn

Fn+2 − Fn+1 − Fn = 0

4 Fn+2 − 2Fn+1 + Fn+1 + Fn − 2Fn = 0

(Fn+2 − 2Fn+1 + Fn) + (Fn+1 − Fn) − Fn = 0 2 (4 )nF + 4nF − Fn = 0 42 is the sequence obtained from applying the forward difference twice. This means that any sequence satisfying the recurrence relation must also satisfy the expression with the forward difference we derived. Now, we may factor this expression in a certain sense. For a constant c, (4 − c) will be thought of as the operation that sends a sequence {F0,F1,F2,F3,F4,... } to {F1 − F0 − cF0,F − 2 − F1 − cF1,F3 − F2 − cF2,... }. So, the n-th term of (4 − c) is given 2 by (4 − c)nF = 4nF − cFn. Consier the equation x + x − 1 = 0, which is the same form as the derived equation that we found above with the forward difference operators. The solutions to x2 + x − 1 = 0 are √ √ 1 5 1 5 x = − − , − + 2 2 2 2

2 . We can then see that we may factor (4 )nF + 4nF − Fn = 0 as √ √ 1 5 1 5 (4 − (− − ))(4 − (− + ))F = 0 2 2 2 2 This just says that we apply the two operators successively to F and get a sequence with all terms zero. To check this, we compute √ √ 1 5 1 5 (4 − (− + ))(4 − (− − )) F 2 2 2 2 n √ √ 1 5 1 5 = (4 − (− + )) [F − F − (− − )F ] 2 2 n n+1 n 2 2 n The term in the brackets is just the n-th term of a sequence to which we apply the next operation. √ √ 1 5 1 5 = (F − F − (− − )F ) − (F − F − (− − )F ) n+2 n+1 2 2 n+1 n+1 n 2 2 n √ √ 1 5 1 5 −(− + )(F − F − (− − )F ) 2 2 n+1 n 2 2 n

= Fn+2 − Fn+1 − Fn Thus, this factorization is legitimate. One solution to the factored formula we found would be if √ 1 5 (4 − (− − )) F = 0 2 2 n This is because √ 1 5 (4 − (− + ))(0) = 0 2 2 Now, we solve the first part of the factored formula. √ √ 1 5 1 5 0 = (4 − (− − )) F = F − F − (− − )F 2 2 n n+1 n 2 2 n

5 So, √ 1 5 F = ( − )F n+1 2 2 n Then, by iterating, we get a sequence that satisfies the Fibonacci relation. √ √ 1 5 1 5 F = ( − )nF = ( − )n n 2 2 0 2 2 Similarly, we may write √ √ 1 5 1 5 (4 − (− + ))(4 − (− − ))F = 0 2 2 2 2 And we get another sequence that satisfies the Fibonacci relation. √ 1 5 F = ( + )n n 2 2 Then, since constants can be removed from inside a foward difference and the forward difference of a sum is the sum of forward differences (Theorem 3.2), we get a general solution for the Fibonacci relation, where C and D are real constants. √ √ 1 5 1 5 F = C( + )n + D( − )n n 2 2 2 2 We know the starting conditions F0,F1 = 1, so we get √ √ 1 5 1 5 1 = F = C( + )0 + D( − )0 = C + D 0 2 2 2 2 and √ √ 1 5 1 5 1 = F = C( + ) + D( − ) 1 2 2 2 2 Solving for C and D, we find 1 1 1 1 C = + √ ,D = − √ 2 2 5 2 2 5 So, by plugging these back in, we get the expression for the n-th term of the Fibonacci sequence. √ √ 1 1 1 5 n 1 1 1 5 n Fn = ( + √ )( + ) + ( − √ )( − ) 2 2 5 2 2 2 2 5 2 2 √ √ √ √ 1 1 5 1 5 1 1 5 1 5 = √ ( + )( + )n + √ ( − )( − )n 5 2 2 2 2 5 2 2 2 2 √ √ 1 1 5 1 1 5 = √ ( + )n+1 + √ ( − )n+1 5 2 2 5 2 2 References

[1] David Gleich. Finite Calculus: A Tutorial for Solving Nasty Sums. https://www.cs.purdue.edu/homes/dgleich/publications/Gleich%202005%20- %20finite%20calculus.pdf (2005). [2] George Kunin. The Finite Difference Calculus and Applications to the In- terpolation of Sequences. MIT Undergraduate Journal of . 101- 109.

6