Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(f) Finally, why couldn't we just do binary search here? When we solved this problem on a unimodal array, we did a modified binary search

image text in transcribed
image text in transcribed
image text in transcribed
(f) Finally, why couldn't we just do binary search here? When we solved this problem on a unimodal array, we did a modified binary search where we determine the slope at the midpoint by comparing its value with one of it's neighbors', to get the slope. Here there's no well defined "neighbor" of a point x, but, suppose we just picked some small 8 (8 0.01, say), and treated - and x + 8 as being the neighbors" of x, and run the modified binary search like in class? Give a problem instance, L.e., an underlying f function (and with, say, = 10-5) on which this approach would fail to find a p within e of p. 3 Binary++ Search This is the question where we do something similar to binary search, except, rather than dividing the remaining range in half, we divide it into thirds. Here's the situation: there's a function : 10,11 + R that is unimodal: it is strictly increasing for 3 10Pl, it achieves its unique max at , and then it is strictly decreasing over [p. 1]. But we don't know what pis. That's what we're trying to (approximately) find in this problem. Also, we're only given oracle access to f), i.e., we can compute/obtain the value of f(x). for any particular value we specify (imagine we're stiven API function to call), in constant time for each s. But we don't have an analytic definition of f) or anything, and we can't sort of just look at it and see where the peak is.) (a) Consider performing the following actions. First, evaluate f(x) for 1 0 ,=1, = and Second, take the four values you've received and compare them all with one another, finding which of the four is biggest, which is second biggest, and so on. Now, describe a decision procedure you can use at this point to eliminate some portion of the (0, 1) interval (b) How large a fraction of the 0,1interval can you guarantee you'll eliminate? That is, for what percentage of the interval can you guarantee that, regardless of how the comparisons and decision procedure turn out, you'll eliminate at least this percentage? (e) Given this, briefly informally describe a logarithmic-time algorithm for finding an value p' that is within e of the true peak's r value p, i.e., P-PSE (a) Wait, there's no n in this problem. If the algorithm's running time is logarithmic, what is it the log of? (e) Also, what's the base of the logarithm in its running time? (f) Finally, why couldn't we just do binary search here? When we solved this problem on a unimodal array, we did a modified binary search where we determine the slope at the midpoint by comparing its value with one of it's neighbors', to get the slope. Here there's no well defined "neighbor" of a point x, but, suppose we just picked some small 8 (8 0.01, say), and treated - and x + 8 as being the neighbors" of x, and run the modified binary search like in class? Give a problem instance, L.e., an underlying f function (and with, say, = 10-5) on which this approach would fail to find a p within e of p. 3 Binary++ Search This is the question where we do something similar to binary search, except, rather than dividing the remaining range in half, we divide it into thirds. Here's the situation: there's a function : 10,11 + R that is unimodal: it is strictly increasing for 3 10Pl, it achieves its unique max at , and then it is strictly decreasing over [p. 1]. But we don't know what pis. That's what we're trying to (approximately) find in this problem. Also, we're only given oracle access to f), i.e., we can compute/obtain the value of f(x). for any particular value we specify (imagine we're stiven API function to call), in constant time for each s. But we don't have an analytic definition of f) or anything, and we can't sort of just look at it and see where the peak is.) (a) Consider performing the following actions. First, evaluate f(x) for 1 0 ,=1, = and Second, take the four values you've received and compare them all with one another, finding which of the four is biggest, which is second biggest, and so on. Now, describe a decision procedure you can use at this point to eliminate some portion of the (0, 1) interval (b) How large a fraction of the 0,1interval can you guarantee you'll eliminate? That is, for what percentage of the interval can you guarantee that, regardless of how the comparisons and decision procedure turn out, you'll eliminate at least this percentage? (e) Given this, briefly informally describe a logarithmic-time algorithm for finding an value p' that is within e of the true peak's r value p, i.e., P-PSE (a) Wait, there's no n in this problem. If the algorithm's running time is logarithmic, what is it the log of? (e) Also, what's the base of the logarithm in its running time

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

5. Explain how to install a performance management program.

Answered: 1 week ago