Posts

Showing posts from September, 2024

Newton's Method for nth root, as an integer arithmetic for Computers

 The actual values of my previous post are truly astronomical, and when I reviewed my python3 implementation, I found I re-invented the wheel differently on paper. Here is my python3 code, with comments: It is slightly more conservative with actual values. By experiment, it gives very good square roots for 3 - 8, at 4 iterations ############## main program ############################### # # This script attempts to calculate the nth root of k # ######################################################### k = int(input("Enter the number we are taking the root of: ")) n = int(input("Enter the power of the root: ")) i = int(input("How many iterations would you like to try? ")) a = k b = n ######################################################### # #   The formula for the Convergence Method is: x_k+1 = x_k - {[x_k^n]- K #                                                             n[x_k]^n-1} #   This is also represented as # #         [n-1/n (x_k)]+ [K/n * (1/x_

Newton's Method of converging on the nth root of C, represented as an Integer computation:

Image
 Newton's method is known to converge slowly, and I do not have an associated margin of error at this time. Newton proved: x(k+1) = x(k) - [x(k)^n + C]/[n * x(k)^n-1] converges on the nth root of C. My first step is to rewrite x(k) as (a/b)(k) or a(k)/b(k) From this we obtain: (a/b)(k+1) = (a/b)(k) - [(a/b)(k)^n - C / n * (a/b)(k) ^ (n-1)] Focusing on x(k), we begin: I do not know how to use the editor that does notation.