Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Beeblebrox question help required

Candy bars
Beeblebrox has a candy bar with n squares. The candy bar is in the shape of an n × 1 rectangle, with n – 1
grooves between the squares. Beeblebrox wants to break the candy bar into n squares, by breaking a picce
along one of its grooves. Each break takes a piece of k squares and breaks it into two picces, one piece consisting
of a squares and a second piece consisting of the remaining k – a squarcs, for some 0 < a < k. Beeblebrox
uses exactly n – 1 breaks in total.
This is though a game, and Beeblebrox earns points cach time he brcaks a piece, and Beeblebrox wants to carn
as many points as possible. If Beeblebrox breaks a picce of k squares into two pieces of a and k – a squares,
then Beeblebrox earns max{a, k – a} points. (max{x,y} = x if x > y, and otherwise max{x,y} = y.)
1. Suppose that Beeblebrox applies the following strategy T: (1) Repeatedly, n – 1 times, he takes the
remaining candy bar and break off exactly one piece. Let T(n) denote the total number of points that
Beeblebrox earns, if he starts with a candy bar with n squares. Then we can formulate a recurrence
that measures the total number of points Beeblebrox carns: T(n) = (n – 1) + T(n – 1) for n > 1, and
T(1) = 0. Give a closed form for this recurrence, and bricfly justify your answer. (No proof is required.)
expand button
Transcribed Image Text:Candy bars Beeblebrox has a candy bar with n squares. The candy bar is in the shape of an n × 1 rectangle, with n – 1 grooves between the squares. Beeblebrox wants to break the candy bar into n squares, by breaking a picce along one of its grooves. Each break takes a piece of k squares and breaks it into two picces, one piece consisting of a squares and a second piece consisting of the remaining k – a squarcs, for some 0 < a < k. Beeblebrox uses exactly n – 1 breaks in total. This is though a game, and Beeblebrox earns points cach time he brcaks a piece, and Beeblebrox wants to carn as many points as possible. If Beeblebrox breaks a picce of k squares into two pieces of a and k – a squares, then Beeblebrox earns max{a, k – a} points. (max{x,y} = x if x > y, and otherwise max{x,y} = y.) 1. Suppose that Beeblebrox applies the following strategy T: (1) Repeatedly, n – 1 times, he takes the remaining candy bar and break off exactly one piece. Let T(n) denote the total number of points that Beeblebrox earns, if he starts with a candy bar with n squares. Then we can formulate a recurrence that measures the total number of points Beeblebrox carns: T(n) = (n – 1) + T(n – 1) for n > 1, and T(1) = 0. Give a closed form for this recurrence, and bricfly justify your answer. (No proof is required.)
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education