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 timecomplexity 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 timecomplexity 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...

Use the OnetoOne Property to solve the equation for x. 1. 3x+1 = 27 2. 2x2 = 64 3. (1/2)x = 32 4. 5x2 = 1/125

Determine the hybridization state of each carbon atom in the following compounds: a. b. , C=c=c=C  `H.

Robert Carr is the founder of Heartland Payment Systems, Inc. Carr was heavily involved in negotiations with Global Payments, Inc., concerning the acquisition of Heartland by Global. During this...

The PrinceRobbins partnership has the following capital account balances on January 1, 2015: Prince, Capital . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $70,000 Robbins, Capital . . ....

3. If the policy proposed in question 2 is adopted, analyze the potential effects of this policy on the demand for workers under the age of 65. That is, if employers who want their employees to be...

A drunk starts out from a lamppost in the middle of a street, taking steps of equal length either to the right or to the left with equal probability. What is the probability that the man will again...

Finer Diner has hired you as a consultant to determine how to increase dessert sales. Data from Finer Diner, Kims Kitchen, and Petes Place was used to find out if there is a difference in the number...

Discuss about maintaining and reviewing financial delegations and accountabilities and how it can help to ensure consistency and compliance with internal control procedures?

a) For advertising this product, recommend how you would calculate the budget for advertising the product in the first year. Justify your answer. b) Your advertising budget for the first year is $1...

What is the amount you can withdraw at the end of 20 years if you make $1,500 monthly deposit at a nominal annual rate of 6% compounded monthly? What is the amount of 5 equal annual deposits that can...

A 4.4mwide swimming pool is filled to the top. The bottom of the pool becomes completely shaded in the afternoon when the sun is 23 above the horizon. Part A How deep is the pool? Express your...

Suppose you want to accumulate $10,000 for a down payment for a house. You will deposit $400 at the beginning of every month in an account that credits interest monthly at the rate of 0.6% per month....

1) What innovations have allowed most firms who accept cash and checks at retail locations to eliminate most field bank accounts? a. ACH debit files and sameday ACH b. ACH debits and concentration...

Find an equation of the given line. Slope is 2; xintercept is 2

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 63 as a guide, compare and contrast cloudbased and inhouse hosting. In your opinion, explain the three most important...

An engineering organisational system is composed of major groups such as management, research and development, preliminary design, experiments, product design and drafting, fabrication and...

The studentteacher learning activity is inherently a feedback exercise intended to reduce the system error to a minimum. The desired output is the knowledge being studied, and the student is the...

Give two examples of feedback control systems in which a human acts as a controller.
Study smarter with the SolutionInn App