Question: suppose that for some reason you want an algorithm that computes base-5 logarithms of real numbers greater than or equal to 1. For real numbers

suppose that for some reason you want an algorithm that computes base-5 logarithms of real numbers greater than or equal to 1. For real numbers x such that 1<=x<=5 you can call a function Lookup(x) that will find a close approximation to log base-5 (x). However, for numbers 5 or larger you have to come up with your own way of calculating log base-5 (x). Since log base-5 (x)=1+log base-5 (x/5), one approach would be to compute log base-5 (x/5) and add 1 to the result. Write pseudocode for a recursive algorithm based on this idea. Your algorithm may call Lookup to get logarithms of numbers greater than or equal to 1 buy less than 5, and needn't work at all for numbers less than 1. Your algorithm must be recursive.

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!