subject

Explain an algorithm that computes 2^n using Θ(log n) multiplications. Justify why your algorithm uses Θ(log n) multiplications. a. Consider the case where n is a power of 2, i. e., n = 2^k . Use Θ(k) multiplications to obtain 2n . Hint: Note that 2^(2^k) = (2^(2^kβˆ’1) )^2 .
b. Consider the case where n = 2^k + 2^(kβˆ’1) . Use Θ(k) multiplications to obtain 2^n . Hint: Note that 2^(2^k+2^(kβˆ’1)) = 2^(2^k) Γ— 2^(2^(kβˆ’1)) .
c. Generalize the ideas in parts (a) and (b) to compute 2n using Θ(log n) multiplications for any positive integer n.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Can you make money in why are you guys so
Answers: 1
question
Computers and Technology, 22.06.2019 06:40
Match the personality traits with their description
Answers: 2
question
Computers and Technology, 22.06.2019 07:20
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display β€œenter a value to be cubed.” input value; set cube = value ^ 3 display value, β€œ cubed is β€œ, cube end while
Answers: 2
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
You know the right answer?
Explain an algorithm that computes 2^n using Θ(log n) multiplications. Justify why your algorithm us...
Questions
question
Mathematics, 04.11.2020 22:20
question
Mathematics, 04.11.2020 22:20
question
English, 04.11.2020 22:20
question
Mathematics, 04.11.2020 22:20
Questions on the website: 13722360