23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

we justify that the <strong>in</strong>ductive "step" is true for n> k, namely, we show "if q(i) is<br />

true for i > n, then q(n) is true." The comb<strong>in</strong>ation of these two pieces completes<br />

the justification by <strong>in</strong>duction.<br />

Proposition 4.20: Consider the Fibonacci function F(n), where we def<strong>in</strong>e<br />

F(1) = 1, F(2) = 2, <strong>and</strong> F(n) = F(n − 1) + F(n − 2) for n > 2. (See Section 2.2.3.)<br />

We claim thatF(n) < 2 n .<br />

Justification: We will show our claim is right by <strong>in</strong>duction.<br />

Base cases: (n ≤ 2). F(1) = 1< 2 = 2 1 <strong>and</strong> F(2) = 2 < 4 = 2 2 .<br />

Induction step: (n > 2). Suppose our claim is true for n ′ < n. Consider F(n). S<strong>in</strong>ce<br />

n > 2, F(n) = F(n − 1) + F(n − 2). Moreover, s<strong>in</strong>ce n − 1

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

Saved successfully!

Ooh no, something went wrong!