Suppose you have a log of length L, marked to be cut in n different locations...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose you have a log of length L, marked to be cut in n different locations labeled 1, 2, ..., n. The woodcutter will cut a given log of wood, at any place you choose, for a price equal to the length of the given log. For simplicity, let indices 0 and n + 1 denote the left and right endpoints of the original log of length L. Let d, denote the distance of mark i from the left end of the log and assume that 0=d, <d₁ <d₂ <...<d₁ <dn+1 =L. Determining the sequence of cuts to the log that will cut the log at all the n marked places and minimize your total payment. Choose the following strategies: A. Greedy algorithm picking the point closest to the center of log (3 points). This strategy is not optimum. B. Dynamic programming (7 points). The algorithm time-complexity is O(n²). Use C, C++, Java, or Python to implement Part A and B (ask the instructor if you have another programming language in mind). Suppose you have a log of length L, marked to be cut in n different locations labeled 1, 2, ..., n. The woodcutter will cut a given log of wood, at any place you choose, for a price equal to the length of the given log. For simplicity, let indices 0 and n + 1 denote the left and right endpoints of the original log of length L. Let d, denote the distance of mark i from the left end of the log and assume that 0=d, <d₁ <d₂ <...<d₁ <dn+1 =L. Determining the sequence of cuts to the log that will cut the log at all the n marked places and minimize your total payment. Choose the following strategies: A. Greedy algorithm picking the point closest to the center of log (3 points). This strategy is not optimum. B. Dynamic programming (7 points). The algorithm time-complexity is O(n²). Use C, C++, Java, or Python to implement Part A and B (ask the instructor if you have another programming language in mind).
Expert Answer:
Answer rating: 100% (QA)
The task described in the question is a classic optimization problem known as the rod cutting proble... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
A Thermometer. Suppose you have a tube of length L containing a gas whose temperature you want to take, but you cannot get inside the tube. One end is closed, and the other end is open but a small...
-
Refer to Example 9. After how many seconds will the rocket be (a) 240 ft above the ground? (b) 112 ft above the ground? Data from in Example 9 EXAMPLE 9 Using a Quadratic Function in an Application...
-
Suppose the government eliminates the income tax and replaces it with a consumption tax. With a consumption tax, individuals pay a tax on only the part of their income they spend rather than save....
-
1. Critically evaluate the job analysis that Marina conducted for the position of assistant store manager. Has she used appropriate methods? What are the strengths and weaknesses of her efforts? 2....
-
Rework the decision problem in Example 7, supposing that only 3 of the 20 hard drives required repairs within the first year. Data From Example 7 EXAMPLE 7 Comparing four detergents using an F test...
-
CLV calculation example Using the Tier One customer data in the scenario, the CLV for a Tier One customer is calculated as follows: Where Tier One has GP = $4,500 | RR = 0.85 | DR = 0.10| AC = $2,500...
-
Using a discount rate of 4.5% compounded annually, a pension fund estimates that the present value of its assets and liabilities are $14 million and $13 million, respectively. The duration of the...
-
A number of cities are arranged on a graph that has been divided up like an ordinary Cartesian plane. Each city is located at an integral (x, y) coordinate intersection. City names and locations are...
-
As you know, our world is heavily dependent on fossil fuels for meeting our energy needs. In Chapter 6 of Contemporary Environmental Issues, you have read that there is concern about the possibility...
-
Adam Cook formed Great Cookies, LLC as a single-member LLC in 2019. The company uses the calendar year as deadline for Adam to File Form 2553 to make this election? December 31, 2022. March 15, 2023....
-
a) The table below contains the results of BW scores conducted on a sample of 100 respondents, about the attributes that drive the choice of consumers towards fruit juice. The BW experiment was...
-
29 Assume the following information: 00:11:55 eBook Selling price Variable expense per unit Fixed expenses Unit sales The degree of operating leverage is closest to: Multiple Choice 1.52. 0.47....
-
MyDMI - Exam X S Digital Marketing - MRKT 621 - X + https://my.digitalmarketinginstitute.com/courses/exam-final-take/cdma-30/dmi-essentials-exam-1/diag-878-91b6cb5ec4ca YouTube G Gmail Maps Type here...
-
10. Which of the following statements is true? a. Abigail is not eligible to claim Andrea for the EIC because her filing status is married filing separate. b. Abigail is not eligible to claim the EIC...
-
A food manufacturing company, Goodies Ltd, develops, manufactures, and sells health food bars. Goodies are now considering entering the home health equipment market and wish to develop a new brand...
-
Determine which of the following limits exist. Compute the limits that exist. lim x-0 1- + 3x X
-
Suppose your team owns and manages one of these ISVs. You learn that more and more of your clients are choosing SaaS cloud services like Google for email, rather than setting up local email servers....
-
Computers that are automatically updated by the IS Department with software upgrades and patches, etc., cannot be allowed to go into sleep mode because if they are sleeping they will not be able to...
-
Define cloud and explain the three key terms in our definition. Using Figure 6-3 as a guide, compare and contrast cloud-based and in-house hosting. In your opinion, explain the three most important...
-
An old-fashioned tire swing exerts a force on the branch and a torque about the point where the branch meets the trunk. If you hang the swing closer to the trunk, this will --the force and-- the...
-
Which of these objects is in static equilibrium? A. B. C. D.
-
A beam with a pivot on its le ft end is suspended from a rope. Tn which direction is the force of the pivot on the beam? A. B. C. D. E.
Study smarter with the SolutionInn App