some simple numerical programs epsilon step epsilon** numguesses ans while abs(ans** >epsilon and ans <xans +step numguesses + print 'numguesses ='numguesses if abs(ans** >epsilonprint 'failed on square root of' elseprint ans'is close to square root of' figure approximating the square root using exhaustive enumeration once againwe are using exhaustive enumeration notice that this method for finding the square root has nothing in common with the way of finding square roots using pencil that you might have learned in middle school it is often the case that the best way to solve problem with computer is quite different from how one would approach the problem by hand when the code is runit prints numguesses is close to square root of should we be disappointed that the program didn' figure out that is perfect square and print no the program did what it was intended to do though it would have been ok to print doing so is no better than printing any value close enough to what do you think will happen if we set will it find root close to nope exhaustive enumeration is search technique that works only if the set of values being searched includes the answer in this casewe are enumerating the values between and when is between and the square root of does not lie in this interval one way to fix this is to change the first line of the while loop to while abs(ans** >epsilon and ans*ans <xnowlet' think about how long the program will take to run the number of iterations depends upon how close the answer is to zero and on the size of the steps roughly speakingthe program will execute the while loop at most /step times let' try the code on something biggere it will run for bitand then print numguesses failed on square root of what do you think happenedsurely there exists floating point number that approximates the square root of to within why didn' our program find itthe problem is that our step size was too largeand the program skipped over all the suitable answers try making step equal to epsilon** and