Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( a ) Describe your algorithm clearly in English. ( b ) Give pseudocode. ( c ) Argue correctness, even if you don t give

(a) Describe your algorithm clearly in English.
(b) Give pseudocode.
(c) Argue correctness, even if you dont give a formal proof and give a convincing
argument instead.
(d) Give with explanation the best upper bound that you can for the running time
ii)(8 points) Give a non-recursive algorithm that asymptotically performs fewer addi-
tions than the recursive algorithm. Discuss the running time of the new algorithm.
iii)(15 points) Give an algorithm to compute Fn in O(logn) time using only integer
additions and multiplications.
Hint: Observe that
[F2F1]=[1110]*[F1F0].
Can you use this observation to compute Fn?
iv)(15 points) The Fibonacci Plus numbers are defined below (n,a and b are all inte-
gers).
Pn={a,ifn=0b,ifn=1Pn-1+2Pn-2+3n,ifn2
Give an algorithm to compute Pn in O(logn) time.
Hint: Similarly to part iii), find a suitable matrix to apply to the initial vector
[P1P021]T so that P2 is an entry of the resulting vector. (Other choices of
initial vector-and accordingly, matrix-may work too.) Then show how to compute
Pn.
(b)(21 points) Now assume that adding two m-bit integers requires (m) time and that
multiplying two m-bit integers requires (m2) time. Analyze the running time of the first
three algorithms in part (a) under this more reasonable cost measure for the elementary
arithmetic operations.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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 And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago