Question: a. Consider the ordinary paper and pencil algorithm for long division: dividing a by b, which yields a quotient q and remainder r. Show that

a. Consider the ordinary "paper and pencil" algorithm for long division: dividing a by b, which yields a quotient q and remainder r. Show that this method requires O((1 + lg q) lg b) bit operations.

b. Define µ(a, b) = (1 + lg a)(1 + lg b). Show that the number of bit operations performed by EUCLID in reducing the problem of computing gcd(a, b) to that of computing gcd (b, a mod b) is at most c(µ (a, b) − µ (b, a mod b)) for some sufficiently large constant c > 0.

c. Show that EUCLID.a, b) requires O(µ (a, b)) bit operations in general and O(β2) bit operations when applied to two β-bit inputs.

Step by Step Solution

3.40 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Number of comparisons and subtractions lceil lg a rceil lceil lg b rceil 1 lceil lg q rceillg... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Algorithms Questions!