You, Alice and Bob are working on recursive search algorithms and have been studying a variant of binary search called trinary search. Alice has created the following pseudocode for this algorithm: TSearch (A [a...b], t) If a b return -1 Let p1 a Floor ((b-a)/3) If A[p1] t return pl If A[p1]> t return TSearch (A [a...p1-1],t) Let p2= a + Ceiling (2(b-a)/3) If A[p2] t return p2 If A[p2]> t return TSearch (A [p1+1...p2-1],t) Return TSearch (A[p2+1...b],t) EndTSearch a) State a recurrence relation that expresses the number of operations carried out by this recursive algorithm when called on an input array of size n. b) Bob has heard that trinary search is no more efficient than binary search when considering asymptotic growth. Help prove him correct by using induction to show that your recurrence relation is in (log₂ n) as well. i. Split the tight bound into and upper (big-O) and lower (big-1). ii. For each bound select a function from (log₂ n) to use in your proof, like alog₂ n or alog₂ n-b. Remember there are typically multiple ways to prove the theorem using different choices of functions. iii. Use induction to prove your bound. Include all parts of the proof including base case, inductive hypothesis and inductive case. Be as precise as possible with your language and your math. Remember it's possible to get stuck at this point if you have selected the wrong function in the last step.
You, Alice and Bob are working on recursive search algorithms and have been studying a variant of binary search called trinary search. Alice has created the following pseudocode for this algorithm: TSearch (A [a...b], t) If a b return -1 Let p1 a Floor ((b-a)/3) If A[p1] t return pl If A[p1]> t return TSearch (A [a...p1-1],t) Let p2= a + Ceiling (2(b-a)/3) If A[p2] t return p2 If A[p2]> t return TSearch (A [p1+1...p2-1],t) Return TSearch (A[p2+1...b],t) EndTSearch a) State a recurrence relation that expresses the number of operations carried out by this recursive algorithm when called on an input array of size n. b) Bob has heard that trinary search is no more efficient than binary search when considering asymptotic growth. Help prove him correct by using induction to show that your recurrence relation is in (log₂ n) as well. i. Split the tight bound into and upper (big-O) and lower (big-1). ii. For each bound select a function from (log₂ n) to use in your proof, like alog₂ n or alog₂ n-b. Remember there are typically multiple ways to prove the theorem using different choices of functions. iii. Use induction to prove your bound. Include all parts of the proof including base case, inductive hypothesis and inductive case. Be as precise as possible with your language and your math. Remember it's possible to get stuck at this point if you have selected the wrong function in the last step.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Follow the instruction, split the tight bound, select a function and use induction to prove
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 now
This is a popular solution!
Step by step
Solved in 4 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.Recommended textbooks for you
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
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