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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.3 SOLVING RECURRENCES 335<br />

Let’s look at some small cases. It’s pretty easy to enumerate the spanning<br />

trees <strong>for</strong> n = 1, 2, and 3:<br />

- 21 A &I! /I +I<br />

f, = 1 f2 = 3 f3 = 8<br />

(We need not show the labels on the vertices, if we always draw vertex 0 at<br />

the left.) What about the case n = O? At first it seems reasonable to set<br />

fc = 1; but we’ll take fo = 0, because the existence of a fan of order 0 (which<br />

should have 2n - 1 = -1 edges) is dubious.<br />

Our four-step procedure tells us to find a recurrence <strong>for</strong> f, that holds <strong>for</strong><br />

all n. We can get a recurrence by observing how the topmost vertex (vertex n)<br />

is connected to the rest of the spanning tree. If it’s not connected to vertex 0,<br />

it must be connected to vertex n - 1, since it must be connected to the rest of<br />

the graph. In this case, any of the f,- 1 spanning trees <strong>for</strong> the remaining fan<br />

(on the vertices 0 through n - 1) will complete a spanning tree <strong>for</strong> the whole<br />

graph. Otherwise vertex n is connected to 0, and there’s some number k < n<br />

such that vertices n, n- 1, . . , k are connected directly but the edge between<br />

k and k - 1 is not in the subtree. Then there can’t be any edges between<br />

0 and {n - 1,. . . , k}, or there would be a cycle. If k = 1, the spanning tree<br />

is there<strong>for</strong>e determined completely. And if k > 1, any of the fk-r ways to<br />

produce a spanning tree on {0, 1, . . . , k - l} will yield a spanning tree on the<br />

whole graph. For example, here’s what this analysis produces when n = 4:<br />

f4 f3 f3 f2<br />

The general equation, valid <strong>for</strong> n 2 1, is<br />

fn = f,-1 + f,-1 + f,-1 + fn-3 +. . . + f, + 1 .<br />

k=4 k=3 k=2 k=l<br />

+<br />

/I<br />

1<br />

(It almost seems as though the ‘1’ on the end is fo and we should have chosen<br />

fo = 1; but we will doggedly stick with our choice.) A few changes suffice to<br />

make the equation valid <strong>for</strong> all integers n:<br />

f, = f,-j + 2 fk + [n>O] .<br />

kin

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

Saved successfully!

Ooh no, something went wrong!