Course Hero Logo

LucasNumbersPoints-WPI2019-1 (1).pdf - PROGRAMMING...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 2 out of 2 pages.

PROGRAMMING ASSIGNMENT #2CS 2223 B-TERM 2019RECURRENCES, LUCAS NUMBERS, &BRUTE FORCE/EXHAUSTIVE SEARCHFORTY POINTSDUE: FRIDAY, NOVEMBER 8, 2019 6 PM1. Consider the recurrenceR(n) = 4R(n-1)-3R(n-2) with initial conditionsR(0) = 2 andR(1) = 8.(4 Points)Find its characteristic equation, and use it to create a formula for the recur-rence that depends only onn, i.e. is not recursive.What is the recurrence’s order of growth? Use Θ(n) if you can.2. The Lucas numbers, named for 19th century French mathematician´EdouardLucas, are defined exactly as the Fibonacci numbers, except that they haveever-so-slightly different initial conditions. The Lucas numbers are given by:L(0) = 2L(1) = 1L(n) =L(n-1) +L(n-2) forn >1Write a C++ program that accepts as input a valuenand writes as outputthe sequenceL(0), L(1), . . . , L(n).Your program should compute the valuesrecursively with a separate function that uses the definition above. You mayhardcode the initial conditions.(7 Points)What else is Lucas known for?3. Use theclock()function from< time.h >

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 2 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
RUIZ
Tags
Characteristic polynomial, Recurrence relation, Fibonacci number

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture