Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We will now measure how large k needs to be in the bakhshali function to provide a good approximation of the square root. You will

"We will now measure how large k needs to be in the bakhshali function to provide a good approximation of the square root. You will write a SCHEME function (terms-needed-b x tol) that will evaluate to the number of terms in the infinite sum needed to be within tol, that is, the smallest k such that the difference between x and (square (bakhshali x k)) is less than tol."

This is a follow-up prompt. Earlier, I had to write a recursive Scheme program that found square root estimates using the bakhshali method.

My response to the prompt is below. As far as I and those I've asked can tell, it should work. However, it does not. Why does it not work?

(define (terms-needed-b x tol) (define (square n) (* n n) ) (define (firstv x tol k) (if (>= tol (abs (- x (square (bakhshali x k))))) k (firstv x tol (+ k 1)) ) ) (firstv x tol 0) )

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

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions

Question

How many multiples of 4 are there between 10 and 250?

Answered: 1 week ago

Question

How many three-digit numbers are divisible by 7?

Answered: 1 week ago