BuyFindarrow_forward

Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

Solutions

Chapter
Section
BuyFindarrow_forward

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
15. Find an order for the algorithm segment.

To determine

Find an order for the algorithm segment.

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:

bn=number of iterations of the while-loop

Result previous exercise:

bn=1+log3n for all integers n1

The number of iterations of the algorithm is the number of iterations of the while-loop as the algorithm only contains the while-loop. Thus the number of iterations of the algorithm is bn=1+log3n when the input is n.

We will then prove that 1+log3n is Θ(log3n), which will implies that the order of the

algorithm is log3 n.

To proof:

log3n+1 is Θ(log3n)

PROOF:

By the definition of the floor function: |xx| for all real numbers x and when n3 then n23n.

|log3n+1||log3n+1|

=|log3n+log33|

=|log3(3n)|                                 logb(xy)=logbx+logby

|log3n2|                            x

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

Chapter 11 Solutions

Show all chapter solutions add
Sect-11.1 P-5ESSect-11.1 P-6ESSect-11.1 P-7ESSect-11.1 P-8ESSect-11.1 P-9ESSect-11.1 P-10ESSect-11.1 P-11ESSect-11.1 P-12ESSect-11.1 P-13ESSect-11.1 P-14ESSect-11.1 P-15ESSect-11.1 P-16ESSect-11.1 P-17ESSect-11.1 P-18ESSect-11.1 P-19ESSect-11.1 P-20ESSect-11.1 P-21ESSect-11.1 P-22ESSect-11.1 P-23ESSect-11.1 P-24ESSect-11.1 P-25ESSect-11.1 P-26ESSect-11.1 P-27ESSect-11.1 P-28ESSect-11.2 P-1TYSect-11.2 P-2TYSect-11.2 P-3TYSect-11.2 P-4TYSect-11.2 P-5TYSect-11.2 P-6TYSect-11.2 P-1ESSect-11.2 P-2ESSect-11.2 P-3ESSect-11.2 P-4ESSect-11.2 P-5ESSect-11.2 P-6ESSect-11.2 P-7ESSect-11.2 P-8ESSect-11.2 P-9ESSect-11.2 P-10ESSect-11.2 P-11ESSect-11.2 P-12ESSect-11.2 P-13ESSect-11.2 P-14ESSect-11.2 P-15ESSect-11.2 P-16ESSect-11.2 P-17ESSect-11.2 P-18ESSect-11.2 P-19ESSect-11.2 P-20ESSect-11.2 P-21ESSect-11.2 P-22ESSect-11.2 P-23ESSect-11.2 P-24ESSect-11.2 P-25ESSect-11.2 P-26ESSect-11.2 P-27ESSect-11.2 P-28ESSect-11.2 P-29ESSect-11.2 P-30ESSect-11.2 P-31ESSect-11.2 P-32ESSect-11.2 P-33ESSect-11.2 P-34ESSect-11.2 P-35ESSect-11.2 P-36ESSect-11.2 P-37ESSect-11.2 P-38ESSect-11.2 P-39ESSect-11.2 P-40ESSect-11.2 P-41ESSect-11.2 P-42ESSect-11.2 P-43ESSect-11.2 P-44ESSect-11.2 P-45ESSect-11.2 P-46ESSect-11.2 P-47ESSect-11.2 P-48ESSect-11.2 P-49ESSect-11.2 P-50ESSect-11.2 P-51ESSect-11.3 P-1TYSect-11.3 P-2TYSect-11.3 P-3TYSect-11.3 P-1ESSect-11.3 P-2ESSect-11.3 P-3ESSect-11.3 P-4ESSect-11.3 P-5ESSect-11.3 P-6ESSect-11.3 P-7ESSect-11.3 P-8ESSect-11.3 P-9ESSect-11.3 P-10ESSect-11.3 P-11ESSect-11.3 P-12ESSect-11.3 P-13ESSect-11.3 P-14ESSect-11.3 P-15ESSect-11.3 P-16ESSect-11.3 P-17ESSect-11.3 P-18ESSect-11.3 P-19ESSect-11.3 P-20ESSect-11.3 P-21ESSect-11.3 P-22ESSect-11.3 P-23ESSect-11.3 P-24ESSect-11.3 P-25ESSect-11.3 P-26ESSect-11.3 P-27ESSect-11.3 P-28ESSect-11.3 P-29ESSect-11.3 P-30ESSect-11.3 P-31ESSect-11.3 P-32ESSect-11.3 P-33ESSect-11.3 P-34ESSect-11.3 P-35ESSect-11.3 P-36ESSect-11.3 P-37ESSect-11.3 P-38ESSect-11.3 P-39ESSect-11.3 P-40ESSect-11.3 P-41ESSect-11.3 P-42ESSect-11.3 P-43ESSect-11.4 P-1TYSect-11.4 P-2TYSect-11.4 P-3TYSect-11.4 P-4TYSect-11.4 P-5TYSect-11.4 P-1ESSect-11.4 P-2ESSect-11.4 P-3ESSect-11.4 P-4ESSect-11.4 P-5ESSect-11.4 P-6ESSect-11.4 P-7ESSect-11.4 P-8ESSect-11.4 P-9ESSect-11.4 P-10ESSect-11.4 P-11ESSect-11.4 P-12ESSect-11.4 P-13ESSect-11.4 P-14ESSect-11.4 P-15ESSect-11.4 P-16ESSect-11.4 P-17ESSect-11.4 P-18ESSect-11.4 P-19ESSect-11.4 P-20ESSect-11.4 P-21ESSect-11.4 P-22ESSect-11.4 P-23ESSect-11.4 P-24ESSect-11.4 P-25ESSect-11.4 P-26ESSect-11.4 P-27ESSect-11.4 P-28ESSect-11.4 P-29ESSect-11.4 P-30ESSect-11.4 P-31ESSect-11.4 P-32ESSect-11.4 P-33ESSect-11.4 P-34ESSect-11.4 P-35ESSect-11.4 P-36ESSect-11.4 P-37ESSect-11.4 P-38ESSect-11.4 P-39ESSect-11.4 P-40ESSect-11.4 P-41ESSect-11.4 P-42ESSect-11.4 P-43ESSect-11.4 P-44ESSect-11.4 P-45ESSect-11.4 P-46ESSect-11.4 P-47ESSect-11.4 P-48ESSect-11.4 P-49ESSect-11.4 P-50ESSect-11.4 P-51ESSect-11.5 P-1TYSect-11.5 P-2TYSect-11.5 P-3TYSect-11.5 P-4TYSect-11.5 P-5TYSect-11.5 P-1ESSect-11.5 P-2ESSect-11.5 P-3ESSect-11.5 P-4ESSect-11.5 P-5ESSect-11.5 P-6ESSect-11.5 P-7ESSect-11.5 P-8ESSect-11.5 P-9ESSect-11.5 P-10ESSect-11.5 P-11ESSect-11.5 P-12ESSect-11.5 P-13ESSect-11.5 P-14ESSect-11.5 P-15ESSect-11.5 P-16ESSect-11.5 P-17ESSect-11.5 P-18ESSect-11.5 P-19ESSect-11.5 P-20ESSect-11.5 P-21ESSect-11.5 P-22ESSect-11.5 P-23ESSect-11.5 P-24ESSect-11.5 P-25ESSect-11.5 P-26ES