   Chapter 11.5, Problem 13ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# Exercises 12—15 refer to the following algorithm segment. For each positive integer n, let b n be the number of iterations of the while loop. while   ( n > 0 ) n : = n   d i v   3 end while 13. Find a recurrence relation for b n

To determine

Find a recurrence relation for bn.

Explanation

Given information:

For each positive integer n, let bn be the number of iterations of the while loop. while ( n > 0)

n := n div 3

end whileCalculation:

We have:

while(n>0)    n:=n div 3end while

bn= Number of iterations of the while-loop when the input to the algorithm is n

When the input to the algorithm is n, then we determine n div 3 in the first iteration of the while-loop.

n div 3=n3

We then also replace n by the value n div 3=n3 and thus the number of iterations requires when the input is n is 1 more than the number of iterations requires when the input is n div 3=n3

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 