Question: LISP PROGRAMMING LANGUAGE Question 7 20 pts) the closest rational approximation to the square root of 2. The sequence of approximations begins with 1 3

 LISP PROGRAMMING LANGUAGE Question 7 20 pts) the closest rational approximation

LISP PROGRAMMING LANGUAGE

Question 7 20 pts) the closest rational approximation to the square root of 2. The sequence of approximations begins with 1 3 7 17 41 1 2 5 12 29 So the sequence of Pell numbers begin with 1, 2, 5, 12, 29,... The Pell numbers are defines as follow: if n = 0 1 if n = 1 2p-1P-2 otherwise Pa= rL Writ a lisp program that computes the Pell numbers for an input argument n using: a) An iterative approach b) A recursive approach For example pellnumbers (6) should return a list (e 1 2 5 12 29 70) Write at least 2 test cases for each version (a and b). Question 7 20 pts) the closest rational approximation to the square root of 2. The sequence of approximations begins with 1 3 7 17 41 1 2 5 12 29 So the sequence of Pell numbers begin with 1, 2, 5, 12, 29,... The Pell numbers are defines as follow: if n = 0 1 if n = 1 2p-1P-2 otherwise Pa= rL Writ a lisp program that computes the Pell numbers for an input argument n using: a) An iterative approach b) A recursive approach For example pellnumbers (6) should return a list (e 1 2 5 12 29 70) Write at least 2 test cases for each version (a and b)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!