08.08.2013 Views

Ex10 - Cs.ioc.ee

Ex10 - Cs.ioc.ee

Ex10 - Cs.ioc.ee

SHOW MORE
SHOW LESS

Transform your PDFs into Flipbooks and boost your revenue!

Leverage SEO-optimized Flipbooks, powerful backlinks, and multimedia content to professionally showcase your products and significantly increase your reach.

Concrete Mathematics, Lesson 10: Exercises<br />

Exercise<br />

Silvio Capobianco<br />

Revised: November 20, 2012<br />

Define the Fibonacci number fn for negative integer n.<br />

Solution. What we really want, is that the defining relation fn+1 = fn + fn−1<br />

with the conditions f0 = 0, f1 = 1 still holds when n is an arbitrary integer.<br />

So: what can f−1 be? From the defining relation, we must have f1 = f0+f−1,<br />

that is, 1 = 0 + f−1: which yields f−1 = 1 = f1.<br />

Could it be that f−n = fn for arbitrary n > 0? Well, it must be f0 =<br />

f−1 + f−2, that is, 0 = 1 + f−2, which yields f−2 = −1 = −f2: so our<br />

hypothesis is disproved.<br />

But could it be that f−n = (−1) n−1 fn for arbitrary n > 0? Well, we have<br />

two consecutive cases where this is true, and the defining relation is of the<br />

second order, so we can just go by induction: suppose f−n = (−1) n−1 fn and<br />

f−(n−1) = (−1) n−2 fn−1. Then, as f−n+1 = f−n + f−n−1, we get<br />

f−(n+1) = f−(n−1) − f−n<br />

= (−1) n−2 fn−1 − (−1) n−1 fn<br />

= (−1) n−2 fn−1 + (−1) n fn<br />

= (−1) n fn+1 ,<br />

because n − 2 and n are either both even or both odd.<br />

Exercise 6.7<br />

Show that Cassini’s identity<br />

fn+1fn−1 − f 2 n = (−1) n<br />

1<br />

(1)


is in fact an instance of the more general equation<br />

fn+k = fkfn+1 + fk−1fn , (2)<br />

and prove (2).<br />

Solution. We have just s<strong>ee</strong>n that Fibonacci numbers may be defined for<br />

negative index as<br />

f−n = (−1) n−1 fn ,<br />

which preserves the fundamental identity fn = fn−1+fn−2. If we set k = 1−n<br />

in (2), we get<br />

f1 = (−1) n−2 fn−1fn+1 + (−1) n fnfn ,<br />

which is just (1) multiplied by (−1) n .<br />

To prove (2), define the proposition P (n) as<br />

Then P (0) is<br />

∀k ∈ Z : fn+k = fkfn+1 + fk−1fn .<br />

∀k ∈ Z : fk = fkf1 + fk−1f0 ,<br />

which is true because f1 = 1 and f0 = 0, while P (1) is<br />

∀k ∈ Z : fk+1 = fkf2 + fk−1f1 ,<br />

which is true because f1 = f2 = 1. Suppose now that n ≥ 1, and that P (n)<br />

and P (n − 1) are true: then for every k ∈ Z,<br />

fkfn+2 + fk−1fn+1 = fkfn+1 + fkfn + fk−1fn + fk−1fn−1<br />

= (fkfn+1 + fk−1fn) + (fkf(n−1)+1 + fk−1fn−1)<br />

= fn+k + fn−1+k by inductive hypothesis<br />

= fn+1+k<br />

which means that P (n + 1) is true as well: this proves P (n) for every n ≥ 0.<br />

For n < 0, suppose that P (n + 1) and P (n + 2) are true: then for every<br />

k ∈ Z,<br />

fn+k = fn+2+k − fn+1+k<br />

= fkfn+2+1 + fk−1fn+2 − (fkfn+1+1 + fk−1fn+1)<br />

= fk(fn+3 − fn+2) + fk−1(fn+2 − fn+1)<br />

= fkfn+1 − fk−1fn ,<br />

that is, P (n) is true as well.<br />

2


Exercise 6.27<br />

Prove the law of greatest common divisor (6.111) for Fibonacci numbers.<br />

Solution. We are required to prove that, for positive m and n,<br />

gcd(fm, fn) = fgcd(m,n) . (3)<br />

We observe that this is true for n = m + 1, because of Cassini’s identity: in<br />

fact, every common factor of fm and fm+1 is also a factor of fm+1fm−1 −f 2 m =<br />

(−1) m , so ind<strong>ee</strong>d gcd(fm, fm+1) = 1 = f1 = fgcd(m,m+1).<br />

Let us now prove the general case. Suppose for convenience n > m. By<br />

taking (2) and replace n with n − m and k with m, we get fn = fmfn−m+1 +<br />

fm−1fn−m: then<br />

gcd(fm, fn) = gcd(fn mod fm, fm) = gcd(fm−1fn−m, fm) = gcd(fn−m, fm) ,<br />

because consecutive Fibonacci numbers are relatively prime. But we can<br />

continue subtracting m until n − km becomes smaller than m, that is, until<br />

k = ⌊n/m⌋ and n − km = n mod m: then<br />

gcd(fm, fn) = gcd(fn mod m, fn) .<br />

But the equality above means that we can run the Euclidean algorithm on the<br />

indices of the Fibonacci numbers, instead of the Fibonacci numbers themselves!<br />

The thesis clearly follows.<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!