
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
![Consider the following algorithm segment.
For each positive integer n, let bn be the number of iterations of the following while loop.
while (n > 0)
n := n div(3)
end while
Find a recurrence relation for b
Ⓒ
To answer this question, observe that for each integer k ≥ 3, n div(3) = Lk/3]
Thus, when the algorithm segment is run for a particular k and the while loop has iterated one time, the input to the next iteration is [k/3]
It follows that the number of iterations of the loop for k is 1✔✔ more than the number of iterations for [k/3]
In other words, for every integer k ≥ 1
, we have which of the following?
bk = 1 + bkl
o b₁ = 1 + b
k/3
Lk/3]
bk = 1 + b[k/31
bk = 3 + bk/3
b₁ = 3 + blk/31
bk = 3 + b
DIK/31
In addition, the initial values for the sequence b₁,b₂, bz₁
are b₁ = 1
and b₂ = 1
©](https://content.bartleby.com/qna-images/question/f6079d35-87cd-40f3-9f1d-c5b52e1d4d86/cb174e20-952a-4426-8bbe-399ff69b884f/vthjua_thumbnail.jpeg)
Transcribed Image Text:Consider the following algorithm segment.
For each positive integer n, let bn be the number of iterations of the following while loop.
while (n > 0)
n := n div(3)
end while
Find a recurrence relation for b
Ⓒ
To answer this question, observe that for each integer k ≥ 3, n div(3) = Lk/3]
Thus, when the algorithm segment is run for a particular k and the while loop has iterated one time, the input to the next iteration is [k/3]
It follows that the number of iterations of the loop for k is 1✔✔ more than the number of iterations for [k/3]
In other words, for every integer k ≥ 1
, we have which of the following?
bk = 1 + bkl
o b₁ = 1 + b
k/3
Lk/3]
bk = 1 + b[k/31
bk = 3 + bk/3
b₁ = 3 + blk/31
bk = 3 + b
DIK/31
In addition, the initial values for the sequence b₁,b₂, bz₁
are b₁ = 1
and b₂ = 1
©
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Alert dont submit AI generated answer. please explain in details.arrow_forwardNo plagarism please! Correct and detailed answer will be Upvoted else downvoted. Thank you!arrow_forwardFor each of the following algorithm in pseudo-code, indicate the time efficiency using BigTheta (Θ) notation. You need to 1) identify the basic operation, and 2) justify your results by doing summation or listing and solving the recurrence relation of T(n), which is the number of basic operations.It is your decision to make on the method you use to solve the recurrence. Question 1) for i = 3 to n dofor j = 1 to i doa[i][j]= 0; Question 2) Algorithm f(n): if n==1 return 1; return 2*f(n-1)+ n*n*n;arrow_forward
- A problem called S reduces to a problem called T if a T solver can be used as a subroutine to solve S. In pseudocode: Solves(...): ... SolveT(...) ... Assuming that this reduction is correct, answer the following questions regarding what the reduction tells us. If we know that an algorithm exists for solving Problem S, what does that tell us about Problem T? [ Select] If we know that an algorithm cannot exist for solving Problem S, what does that tell us about Problem T? [ Select] If we know that an algorithm exists for solving Problem T, what does that tell us about Problem S? [ Select ] [ Select ] An algorithm cannot exist for solving Problem S,r solving Problem T, what does that tell us about Nothing An algorithm exists for solving Problem Sarrow_forwardBuild a recursion tree for the following recurrence equation and then solve for T(n)arrow_forwardrefer to imagearrow_forward
- 1. Determine the running time of the following algorithm. Write summations to represent loops and solve using bounding. Be sure to show work on both the upper bound and lower bound, justify the split, and check that the bounds differ by only a constant factor. Use asymptotic notation to write the answer. Func1(n) 1 2 3 4 5 6 7 8 9 10 11 S← 0; for i ←n to n² do for j← 1 to i do for k9n to 10n² do for mi to k end end end return (s); end s+s + i- j + k −m;arrow_forwardPlease help me solve Part A of this problemarrow_forward4. Practice with the iteration method. We have already had a recurrence relation ofan algorithm, which is T(n) = 4T(n/2) + n log n. We know T(1) ≤ c.(a) Solve this recurrence relation, i.e., express it as T(n) = O(f(n)), by using the iteration method.Answer:(b) Prove, by using mathematical induction, that the iteration rule you have observed in 4(a) is correct and you have solved the recurrence relation correctly. [Hint: You can write out the general form of T(n) at the iteration step t, and prove that this form is correct for any iteration step t by using mathematical induction.Then by finding out the eventual number of t and substituting it into your generalform of T(n), you get the O(·) notation of T(n).]arrow_forward
- Time comp.arrow_forwardSort the following functions in terms of asymptotic growth from smallest to largest. In particular, the resulting order should be such that f₁ =0(f₂), f₂=0 (f 3), and so on. 1 2 I I I - ✓ 3" ✓ log (23) 14 1 1010 n 11/10 ✓ nln(12n) ✓ 52! ✓ log_²(n) ✓20200.1arrow_forward1. Let S = {1,2...n} be a set activities, where activity i € S has a start time si, a finish time f; and a profit p, asSociated with it. Design an dynamic programming algorithm for computing a set of compatible activities of maximum profit. Argue that the time complexity of you algorithm is O(n log(n)). (You must start with the correct definitions, and then write a recurrence relation.)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education