Discrete Mathematics for CS
Spring 2005
Clancy/Wagner
HW 3
Due Thursday, February 10
Coverage:
This assignment involves topics from the February 1 and 3 lectures and from sections 3.4
through 3.6 of Rosen.
Administrative reminders:
We will accept only unformatted text files or PDF files for homework sub
mission. Include your name, login name, section number, and partner list in your submission. Give the
command
submit hw3
to submit your answers to this assignment.
Homework exercises:
1. (14 pts.)
Fibonacci numbers
The Fibonacci numbers are defined as follows:
F
0
=
0
F
1
=
1
F
n
=
F
n

2
+
F
n

1
for
n
>
1
(a) List the first ten Fibonacci numbers (
F
0
through
F
9
).
(b) Consider the following Scheme procedure that, given n, returns
F
n
.
(define (fib n)
(cond
((= n 0) 0)
((= n 1) 1)
(else (+ (fib ( n 1)) (fib ( n 2)))) ) )
Let
T
n
be the number of addition operations required in the computation of
(fib n)
. List the
values
T
0
through
T
9
.
(c) State and prove a relationship between the
T
numbers and the
F
numbers.
(d) Prove that
F
n
+
1
F
n

1

F
2
n
= (

1
)
n
.
CS 70, Spring 2005, HW 3
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 PAPADIMITROU
 rooted binary tree

Click to edit the document details