Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java Eclipse Problem 1[50 pts]: Write a program that prompts the user to enter two positive integers named a and b. Then, output the

Using Java Eclipse

image text in transcribed

Problem 1[50 pts]: Write a program that prompts the user to enter two positive integers named a and b. Then, output the Bezout coefficients of a, b. Recall that the Bezout coefficients are (any) integers s, t such that: as + bt = gcd(a, b). Problem 2[50 pts]: Write a program that prompts the user to enter three positive integers a, b, n. Then, output the general form of solutions to the congruence equation arb (mod n) if there is such a solution. If there is no solution output "NO SOLUTION" For example, suppose l enter a 2 b 3, n 6 the output should be NO SOLUTION" If on the other hand, I enter a 2.b= 4,n = 6 then the general solution is r 2 (mod 3) so your program outputs r 2 (mod 3) Ffint: Recall that ue have seen hou to solve congruences take arleb (mod n) if geala, Clearly you can check if ged(a,n) 1 and if so you know what to do. If that is not the case hauerer, then first show that the equation has a solution iff db where d-gcd(a n) and in this case it is enough to solve the equation (a/d)(ba) nod (nld) Also conunce yourself uhy gcd a d,n/d) = 1 Not use hou, to solve congruences or the type you have seen m class

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions