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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:50, juan3937
The instruction ishl (shift left integer) exists in jvm but not in ijvm. it uses the top two values on the stack, replacing the two with a single value, the result. the sec- ond-from-top word of the stack is the operand to be shifted. its content is shifted left by a value between 0 and 31, inclusive, depending on the value of the 5 least signifi- cant bits of the top word on the stack (the other 27 bits of the top word are ignored). zeros are shifted in from the right for as many bits as the shift count. the opcode for ishl is 120 (0x78).a. what is the arithmetic operation equivalent to shifting left with a count of 2? b. extend the microcode to include this instruction as a part of ijv.
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, petergriffin6772
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
image
Computers and Technology, 24.06.2019 10:40, 29delphina
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
image
Computers and Technology, 24.06.2019 13:20, ana9340
3. ranga ramasesh is the operations manager for a firm that is trying to decide which one of four countries it should research for possible outsourcing providers. the first step is to select a country based on cultural risk factors, which are critical to eventual business success with the provider. ranga has reviewed outsourcing provider directories and found that the four countries in the table that follows have an ample number of providers from which they can choose. to aid in the country selection step, he has enlisted the aid of a cultural expert, john wang, who has provided ratings of the various criteria in the table. the resulting ratings are on a 1 to 10 scale, where 1 is a low risk and 10 is a high risk. john has also determined six criteria weightins: trust, with a weight of 0.3; quality, with 0.2; religious, with 0.1; individualism, with 0.2; time, with 0.1; and uncertainity, with 0.1. using the factor-rating method, which country should ranga select? why? (2 points)
Answers: 3
You know the right answer?
Explain an algorithm that computes 2^n using Θ(log n) multiplications. Justify why your algorithm us...

Questions in other subjects:

Konu
Mathematics, 17.10.2019 20:30