Answered step by step
Verified Expert Solution
Question
1 Approved Answer
It is often useful to have a solution with u > 0. Modify your program so that it returns a solution with u > 0
It is often useful to have a solution with u > 0. Modify your program so that it returns a solution with u > 0 and u as small as possible. [Hint. If (u, v) is a solution, then so is (u + b/g, v a/g).]
Pairs to test:
(31313,143)
(1333337, 7331)
(8675309, 1337)
See the screenshot for the program.
def gcd_eea(a,b): u = 1 y = b x = 0 while (y != %): q = floor(g/y) t = int(mod(8,y)) S = u - q*x u = X g = y X = 5 y = t v = (g - a*u)/b return (g,u,v) def gcd_eea(a,b): u = 1 y = b x = 0 while (y != %): q = floor(g/y) t = int(mod(8,y)) S = u - q*x u = X g = y X = 5 y = t v = (g - a*u)/b return (g,u,v)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started