09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 RECURRENT PROBLEMS<br />

through any of the existing intersection points (hence it intersects them all<br />

in different places). The recurrence is there<strong>for</strong>e<br />

Lo = 1;<br />

L, = L,-l +n, <strong>for</strong> n > 0.<br />

(1.4)<br />

The known values of L1 , Lz, and L3 check perfectly here, so we’ll buy this.<br />

Now we need a closed-<strong>for</strong>m solution. We could play the guessing game<br />

again, but 1, 2, 4, 7, 11, 16, . . . doesn’t look familiar; so let’s try another<br />

tack. We can often understand a recurrence by “unfolding” or “unwinding”<br />

it all the way to the end, as follows:<br />

L, = L,_j + n<br />

= L,-z+(n-l)+n<br />

= LnP3 + (n - 2) + (n - 1) + n<br />

= Lo+1 +2+... + (n - 2) + (n - 1) + n<br />

= 1 + s,, where S, = 1 + 2 + 3 + . . + (n - 1) + n.<br />

In other words, L, is one more than the sum S, of the first n positive integers.<br />

The quantity S, pops up now and again, so it’s worth making a table of<br />

small values. Then we might recognize such numbers more easily when we<br />

see them the next time:<br />

n 1 2 3 4 5 6 7 8 9 10 11 12 13 14<br />

S, 1 3 6 10 15 21 28 36 45 55 66 78 91 105<br />

Unfolding?<br />

I’d call this<br />

“plugging in.”<br />

These values are also called the triangular numbers, because S, is the number<br />

of bowling pins in an n-row triangular array. For example, the usual four-row<br />

array ‘*:::*’ has Sq = 10 pins.<br />

To evaluate S, we can use a trick that Gauss reportedly came up with<br />

in 1786, when he was nine years old [73] (see also Euler [92, part 1, $4151): It seems a lot of<br />

stuff is attributed<br />

to Gauss-<br />

s,= 1 + 2 + 3 +...+ (n-l) + n<br />

either he was really<br />

+Sn= n + (n-l) + (n-2) + ... + 2 + 1 smart or he had a<br />

great press agent.<br />

2S, = (n+l) + (n+l) + (n+l) +...+ (n+1) + (n+l)<br />

Maybe he just<br />

We merely add S, to its reversal, so that each of the n columns on the right ~~~s~n~,!~etic<br />

sums to n + 1. Simplifying,<br />

s _ n(n+l)<br />

n-<br />

2 ’<br />

<strong>for</strong> n 3 0. (1.5)

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

Saved successfully!

Ooh no, something went wrong!