9.8 Jeff ASagarin WED. 9. REVIE QUESTIONS.123-136 including evens, CLT: 104, 105, 106. No calculators. https://en.wikipedia.org/wiki/Square_root_of_2 CONSTRUCTIVE PROOF. ############################################### #program squareroot # 2022 April 18 Monday print("What number do you want the square root of?") number = int(input()) #This asks for the user to input a number on the screen, #and makes it an integer type, not a string. print("\n") print("What is your initial guess as to the square root of",number,"?") guess = int(input()) print("\n") print("How many iterations do you want this estimate to run for") number_of_iterations = int(input()) print("\n") print("You have chosen the number to square rooted to be", number, ", the \ initial guess to be", guess, ", and the number of iterations to be", number_of_iterations, ".\n") estimate = guess iteration = 0 for item in range(number_of_iterations): iteration = iteration+1 last_estimate = estimate estimate = .5*(last_estimate + number/last_estimate) print("On iteration", iteration, "the last estimate of sqrt(",number, ") was", \ last_estimate, ", and the new estimate is ", estimate,".\n") """ program squareroot ! 2022 April 18 Monday IMPLICIT DOUBLE PRECISION (A-H, O-Z) 1 write(6,*) 'enter number to find square root of, initial guess,', & ' iterations' read(5,*,end=30) z,x00,numitr x=x00 y=x00 iter=0 write(6,*) 'number initial guess estimate', & ' actual iteration' 10 iter=iter + 1 if(iter.gt.numitr) goto 20 y=z/x x0=x x=0.5d0*(x + y) write(6,*) z,x0,x,dsqrt(z),iter goto 10 20 write(6,*) z,x0,x,dsqrt(z) goto 1 30 stop end """ https://www.mathsisfun.com/numbers/euclid-square-root-2-irrational.html https://twitter.com/LongFormMath/status/1511100395925368836 Pythaogrean THeorem proof. ###################################