In this problem, we will analyze how many iterations it takes to find a square root...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this problem, we will analyze how many iterations it takes to find a square root to a given precision using binary search. (a) (5 points) Suppose we re-implemented the algorithm to go "digit-by- digit"; i.e. use binary search to figure out the first digit, then use binary search to figure out the second digit, and so on. If we want our answer to be correct up to n digits after the decimal point, how many guesses G(n) will we need to make? Justify your answer. (b) (2 points) Now, suppose we implemented our algorithm exactly as in class, where we iteratively guess midpoints of our possible range. If we want our answer to be correct up to one digit after the decimal point, how many guesses G(n) will we need to make? Justify your answer. (c) (2 points) Assume again that we implemented our algorithm as in class, and we want to be accurate to two digits after the decimal point. How many guesses G(n) will we need to make in the worst case? Justify your answer. (d) (1 point) Now, assume that we are implementing our algorithm just as in class and want our answer to be correct up to n digits. Establish and prove an upper bound on the number of guesses it will take to achieve this level of correctness. Try to get as small an upper bound as possible. In this problem, we will analyze how many iterations it takes to find a square root to a given precision using binary search. (a) (5 points) Suppose we re-implemented the algorithm to go "digit-by- digit"; i.e. use binary search to figure out the first digit, then use binary search to figure out the second digit, and so on. If we want our answer to be correct up to n digits after the decimal point, how many guesses G(n) will we need to make? Justify your answer. (b) (2 points) Now, suppose we implemented our algorithm exactly as in class, where we iteratively guess midpoints of our possible range. If we want our answer to be correct up to one digit after the decimal point, how many guesses G(n) will we need to make? Justify your answer. (c) (2 points) Assume again that we implemented our algorithm as in class, and we want to be accurate to two digits after the decimal point. How many guesses G(n) will we need to make in the worst case? Justify your answer. (d) (1 point) Now, assume that we are implementing our algorithm just as in class and want our answer to be correct up to n digits. Establish and prove an upper bound on the number of guesses it will take to achieve this level of correctness. Try to get as small an upper bound as possible.
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these computer network questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
:{"foster", "enthusiasm", "wagon", "ally", "lehigh", "programming", "dog", "cat", "Ally", "smile", "pet" }; a. Suppose you perform insertion sort in order to sort A in ascending order. How many...
-
Skysong, Inc. sells products that carry a two-year warranty. Any defective product is replaced with a new item taken from inventory. Management believes that this is the most cost-effective way to...
-
Create a spreadsheet that takes eight values into eight different cells and then applies a transposition cipher to them. Next: create a row that takes the results and applies a substitution cipher to...
-
We can use the gambling interpretation given in Exercise 28 to find the expected number of tosses required to reach pattern B when we start with pattern A. To be a meaningful problem, we assume that...
-
LiveJournal was a popular social media platform which enabled online communities to post comments and content related to particular themes. Its most popular community was called Oh No They Didnt!...
-
The records of Romano Inc. reflect the following data: Work in process, beginning of month 2,000 units one-half completed at a cost of $1,250 for materials, $675 for labor, and $950 for overhead....
-
A ( n ) _ _ _ _ _ _ _ _ _ _ contains a specific piece of information within a record. Field Entity Row Database
-
39. A Table has a mass m of 10kg and another mass m2 of 5kg hanging free, as shown below. Calculate: a. What value of , would stop the block from sliding? [0.5] b. If the box is sliding and = 0.2,...
-
Graph the first-degree inequalities in two unknowns in Problems 13-48. \(y
-
Interview a classmate to learn as much as you can about her or his composing processes. Begin by elaborating a list of questions that cannot be answered with a simple yes or no, then add some...
-
Fieldworkers sometimes categorize the comments in their fieldnotes as either observational, procedural (notes about steps in the process), or theoretical (hunches or hypotheses about what has been...
-
Theron needs to purchase mechanical pencils at a cost of \(\$ 12\) each and writing tablets at \(\$ 15 /\) dozen. He can spend up to \(\$ 65\), but not more. Write an inequality to describe his...
-
Use the DEPAA heuristic as a tool for analyzing a technical communication project that you have worked on. Think about not just the document itself, but the entire project that led to the creation of...
-
Describe briefly the quark model of hadrons, including the properties of quarks.
-
What key concerns must functional tactics address in marketing? Finance? POM? Personnel?
-
Show that any language in NP can be decided by an algorithm running in time 2 O(n k ) for some constant k.
-
A depth-first forest classifies the edges of a graph into tree, back, forward, and cross edges. A breadth-first tree can also be used to classify the edges reachable from the source of the search...
-
Is the array with values 23, 17, 14, 6, 13, 10, 1, 5, 7, 12 a max-heap?
-
The population of unemployed adults has ages with mean m and standard deviations. Samples of unemployed adults are randomly selected so that there are exactly 100 in each sample. For each sample, the...
-
The percentage of heights less than 144 centimeters
-
In this section, it was noted that the standard deviation of sample means is s/1n. In that expression, what does s represent and what does n represent?
Study smarter with the SolutionInn App