Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Devise a recursive algorithm to find a2na, where a is a real number and n is a positive integer. [Hint: Use the equalitya2n+1=(a2n)2 .]

Short Answer

Expert verified

The recursive algorithm is,

procedurepower(a:realnumber,n:positiveintegers)ifn=1thenreturna2elsereturn(power(a,n-1))2

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Describe the given information

The objective is to write the recursive algorithm for computing a2n.

02

Give a recursive algorithm for computing a2n

Call the “power” algorithm and real number and a positive integer .

procedure power (a: real number,n: positive integers)

When the integer n is 1 , then

a2n=a21=a2

Therefore,

if n = 1 then

returna2

Use,a2n=a2n12=a2n12when n is at least 2.

else return(power(a,n1))2

By combining all the steps, the required algorithm will be as follows.

procedurepower(a:realnumber,n:positiveintegers)ifn=1thenreturna2elsereturn(power(a,n-1))2

Hence, the required algorithm is shown above.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Prove that the algorithm you devised in Exercise 17 is correct.

Let P (n) be the statement that a postage of n cents can be formed using just 3-cent stamps and 5-cent stamps. The parts of this exercise outline a strong induction proof that P (n) is true for n ≥ 8.

a) Show that the statements P (8), P (9), and P (10) are true, completing the basis step of the proof.

b) What is the inductive hypothesis of the proof?

c) What do you need to prove in the inductive step?

d) Complete the inductive step for k ≥ 10.

e) Explain why these steps show that this statement is true whenever n ≥ 8.

Prove that the first player has a winning strategy for the game of Chomp, introduced in Example 12 in Section 1.8, if the initial board is square. [Hint: Use strong induction to show that this strategy works. For the first move, the first player chomps all cookies except those in the left and top edges. On subsequent moves, after the second player has chomped cookies on either the top or left edge, the first player chomps cookies in the same relative positions in the left or top edge, respectively.]

(a) Determine which amounts of postage can be formed using just 4-cent and 11-cent stamps.

(b) Prove your answer to (a) using the principle of mathematical induction. Be sure to state explicitly your inductive hypothesis in the inductive step.

(c) Prove your answer to (a) using strong induction. How does the inductive hypothesis in this proof differ from that in the inductive hypothesis for a proof using mathematical induction?

In the proof of Lemma 1 we mentioned that many incorrect methods for finding a vertex such that the line segment is an interior diagonal of have been published. This exercise presents some of the incorrect ways has been chosen in these proofs. Show, by considering one of the polygons drawn here, that for each of these choices of , the line segment is not necessarily an interior diagonal of .

a) p is the vertex of P such that the angleabpis smallest.

b) p is the vertex of P with the least -coordinate (other than ).

c) p is the vertex of P that is closest to .

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free