Solution if c a34 then by the denition of the oor

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A. (d) [5 points] Explain how to check whether C = A3/4 , again using only O(1) additions, subtractions, multiplications, and comparisons. Hint: Recall how the floor function is defined. Solution: If C = A3/4 , then by the definition of the floor function, we have C ≤ A3/4 and C + 1 > A3/4 . We can check both of these using the technique from part (c). 9 6.006 Quiz 2 Solutions Name (e) [5 points] Give a brief description of an algorithm that takes as input a d-digit positive integer A and computes A3/4 . The only arithmetic operations you can use are integer addition, integer subtraction, integer multiplication, integer division, and integer comparison. Your algorithm should use Θ(lg d) arithmetic operations in total, but partial credit will be awarded for using Θ(d) arithmetic operations. For this question, you may assume that Newton’s Method has a quadratic rate of convergence for whatever function you devise. Solution: Θ(lg d) Solution: The technique from part (b) didn’t work beca...
View Full Document

This document was uploaded on 03/17/2014 for the course ELECTRICAL 6.006 at MIT.

Ask a homework question - tutors are online