Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that you are selling steel rods, and you know rods of different lengths can be sold for different price, as listed in the table

image text in transcribed
Suppose that you are selling steel rods, and you know rods of different lengths can be sold for different price, as listed in the table below. To maximize profit, you to consider cutting a long rod Into multiple short pieces. (Cutting is free and all lengths are integral numbers.) For example, for a rod that is 6-feet long, you would want to cut it into two 3-feet long pieces, resulting in a total price of 14 dollars. (If you do not cut, the price is $13; cutting it into 4 times 1-fooc long pieces, the total price would be $6; 3 x 2 foot would give you $12:1 times 2-foot and 1 times 4-feet would be $13, etc.) Design a dynamic programing algorithm to find an optimal cut for a rod of length n, and use your algorithm to find the optimal price for rods with lengths equal to 13, 14, and 15. For full credit, show the recurrence, pseudocode, the dynamic programming table, the optimal value and a cut that can result in the optimal value

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_2

Step: 3

blur-text-image_3

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

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions