We consider the following recursive algorithm for computing the gcd of two integers: Binary Euclidean Algorithm

Input: a, b exist in N >0; Output: gcd(a,b) exist in N

1. If a = b then return a;

2. If both a and b are even return 2 * gcd(a/2, b/2);

3. If exactly one of the two numbers, say a, is even then return gcd(a/2,b);

4. If both a and b are odd and, say, a > b, then return gcd((a – b)/2, b).

Question: (i) Run the algorithm on the following examples: (a) 34, 21 (b) 136, 51 (c) 481, 325 (d) 8771, 3206 .

(ii) Prove that the algorithm works correctly.

(iii) Find a “good” upper bound on the recursion depth of the algorithm, and show that it takes O(n*n) word operations on inputs of length at most n.

(iv) Modify the algorithm so that it additionally computes s,t exist in N such that sa + tb = gcd(a,b).

The price is based on these factors:

Academic level

Number of pages

Urgency

Basic features

- Free title page and bibliography
- Unlimited revisions
- Plagiarism-free guarantee
- Money-back guarantee
- 24/7 support

On-demand options

- Writer’s samples
- Part-by-part delivery
- Overnight delivery
- Copies of used sources
- Expert Proofreading

Paper format

- 275 words per page
- 12 pt Arial/Times New Roman
- Double line spacing
- Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Delivering a high-quality product at a reasonable price is not enough anymore.

That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more