Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. In this problem, we will prove that every non-negative integer can be written as the sum of one or more distinct, nonconsecutive Fibonacci numbers.

image text in transcribed

2. In this problem, we will prove that every non-negative integer can be written as the sum of one or more distinct, nonconsecutive Fibonacci numbers. That is, if the Fibonacci number Fi appears in the sum, it appears exactly once, and its neighbors Fi-1 and Fi+1 do not appear at all. As always, F,-0, Fi = 1 and Fn-Fn-1 + F,,-2 For example: (a) Prove that if a non-negative integer can be written as the sum of one or more distinct, noncon- secutive Fibonacci numbers, then it can be written in such a way that Fi is not used in the sum. Note that it is not enough to say that F1-F2, and therefore we can swap F1 if used for F2. (b) Give an algorithm that takes a non-negative integer parameter n and returns the representation of n as the sum of one or more distinct, nonconsecutive Fibonacci numbers. Your algorithm must use recursion as appropriate. You may use the fact stated in (a) if you would like. Your algorithm does not need to be in C+ or even in pseudo-code (c) Prove using induction that every non-negative integer can be written as the sum of one or more distinct, nonconsecutive Fibonacci numbers. 2. In this problem, we will prove that every non-negative integer can be written as the sum of one or more distinct, nonconsecutive Fibonacci numbers. That is, if the Fibonacci number Fi appears in the sum, it appears exactly once, and its neighbors Fi-1 and Fi+1 do not appear at all. As always, F,-0, Fi = 1 and Fn-Fn-1 + F,,-2 For example: (a) Prove that if a non-negative integer can be written as the sum of one or more distinct, noncon- secutive Fibonacci numbers, then it can be written in such a way that Fi is not used in the sum. Note that it is not enough to say that F1-F2, and therefore we can swap F1 if used for F2. (b) Give an algorithm that takes a non-negative integer parameter n and returns the representation of n as the sum of one or more distinct, nonconsecutive Fibonacci numbers. Your algorithm must use recursion as appropriate. You may use the fact stated in (a) if you would like. Your algorithm does not need to be in C+ or even in pseudo-code (c) Prove using induction that every non-negative integer can be written as the sum of one or more distinct, nonconsecutive Fibonacci numbers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago