subject
Computers and Technology, 27.08.2021 23:50 qhenley

Consider the following version of the Euclidean algorithm to compute gcd(a, b). Start with computing the largest power of 2 dividing both a and b. If this is 2", then divide a and b by 2". After this "preprocessing", do the following: Step 1: Swap the numbers if necessary to have a s b;
Step 2: If a = 0, then check the parities of a and b; if a is even, and b is odd, then replace a by a/2; if both a and b are odd, then replace b by b - a; in each case, go to step (1);
Step 3: If a = 0, then return 2" b as the greatest common denominator.

Required:
a. Show that the modified Euclidean algorithm always terminates with the right answer.
b. Show that this algorithm, when applied to two 100-digit integers, does not take more than 1500 iterations.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
4.11 painting a wall (1) prompt the user to input integers for a wall's height and width. calculate and output the wall's area (integer). note that in this case there is a new line after each prompt. (submit for 1 point). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet (2) extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). assume a gallon of paint covers 350 square feet. store this value in a variable. output the amount of paint needed using the %f conversion specifier. (submit for 2 points, so 3 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons (3) extend to also calculate and output the number of 1 gallon cans needed to paint the wall. hint: use a math function to round up to the nearest gallon. (submit for 2 points, so 5 points total). enter wall height (feet): 11 enter wall width (feet): 15 wall area: 165 square feet paint needed: 0.471429 gallons
Answers: 3
question
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
For the following example of making a peanut butter and jelly sandwich, identify which are inputs, processes, or outputs: bread scooping and spreading peanut butter plate scooping and spreading jelly finished sandwich putting two pieces of covered bread together dirty plate crumbs
Answers: 2
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
You know the right answer?
Consider the following version of the Euclidean algorithm to compute gcd(a, b). Start with computing...
Questions
question
Mathematics, 06.11.2020 18:10
question
Mathematics, 06.11.2020 18:10
question
History, 06.11.2020 18:10
question
Mathematics, 06.11.2020 18:10
question
Mathematics, 06.11.2020 18:10
Questions on the website: 13722367