1. A long rod of length m needs to be cut into pieces. You already have...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. A long rod of length m needs to be cut into pieces. You already have a list of the n points (distances from the start of the rod, all positive and distinct) where the cuts need to occur, {C₁, ..., Cn}, and the rod has been marked accordingly. The physical process of cutting the rod allows for the specified cuts to be made in any order, and as cuts are made you get a set of shorter rods (which may then be cut, if needed). The cost of cutting a rod of length i is i2, irrespective of where the cut occurs, and we want to minimize the total cost of making the cuts. For example, for m = 10, n = 2, with C₁ = 4 and c₂ = 8: making cut 2 and then cut 1 will cost 10² +8² making cut 1 and then cut 2 will cost 10² +6² 136 164 so the second order is cheaper. = = Design and write, in pseudocode, a dynamic programming algorithm that will, given m, n, and the desired cut locations {c₁,..., Cn} in ascending order, find an order in which to make the cuts that will minimize the cost. 1. A long rod of length m needs to be cut into pieces. You already have a list of the n points (distances from the start of the rod, all positive and distinct) where the cuts need to occur, {C₁, ..., Cn}, and the rod has been marked accordingly. The physical process of cutting the rod allows for the specified cuts to be made in any order, and as cuts are made you get a set of shorter rods (which may then be cut, if needed). The cost of cutting a rod of length i is i2, irrespective of where the cut occurs, and we want to minimize the total cost of making the cuts. For example, for m = 10, n = 2, with C₁ = 4 and c₂ = 8: making cut 2 and then cut 1 will cost 10² +8² making cut 1 and then cut 2 will cost 10² +6² 136 164 so the second order is cheaper. = = Design and write, in pseudocode, a dynamic programming algorithm that will, given m, n, and the desired cut locations {c₁,..., Cn} in ascending order, find an order in which to make the cuts that will minimize the cost.
Expert Answer:
Answer rating: 100% (QA)
Here mlength of rod nno of points c1 upto cn cost oof poin... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
The linear density of a rod of length m is given by p(x) = 1/x, in grams per centimeter, where is measured in centimeters from one end of the rod. Find the mass of the rod.
-
A long rod of 60-mm diameter and thermo physical properties P = 8000 kg/m 3 , c = 500 J/kg K, and k = 50 W/m K is initially at a uniform temperature and is heated in a forced convection furnace...
-
A long rod of 20-mm diameter and a thermal conductivity of 1.5 W/m K has a uniform internal volumetric thermal energy generation of 10 6 W/m3. The rod is covered with an electrically insulating...
-
Assume that a security is selling at INR 217 and American call and American put options are available on the stock with 3 months maturity and an exercise price of INR 210. The call is selling at INR...
-
Air enters the compressor of a regenerative gas-turbine engine at 310 K and 100 kPa, where it is compressed to 900 kPa and 650 K. The regenerator has an effectiveness of 80 percent, and the air...
-
Nike: estimate beta using regression method 3 years of monthly data; S&P 500 (SPY) -Y-axis = your stock return and X-axis = SPY return -Compare estimate of beta with Yahoo -Estimate average beta...
-
The Whitney Bluebirds football team sells a 15 -game season ticket for \(\$ 180\). Assume that the team sells 2,000 season tickets on August 10. The tickets are all used for admission. a. Prepare a...
-
In January 2014, Domingo, Inc., acquired 20 percent of the outstanding common stock of Martes, Inc., for $700,000. This investment gave Domingo the ability to exercise significant influence over...
-
Case A . Kapono Farms exchanged an old tractor for a newer model. The old tractor had a book value of $ 1 8 , 0 0 0 ( original cost of $ 4 0 , 0 0 0 less accumulated depreciation of $ 2 2 , 0 0 0 )...
-
Use the data in MURDER.RAW for this exercise. The variable mrdrte is the murder rate, that is, the number of murders per 100,000 people. The variable exec is the total number of prisoners executed...
-
Consider a monopoly that faces a market demand curve given as P = 100 - Q. The marginal cost of production for this monopolist is MC = 10 and the monopolist has fixed costs equal to zero. The...
-
Discuss how differences in discount rates or in ability across workers lead to differences in earnings and schooling. Under what conditions can the rate of return to school be estimated?
-
Why does the percentage gain in earnings observed when a worker gets one more year of schooling measure the marginal rate of return to education?
-
What do liabilities and equity have in common? What is the key difference between them?
-
If the very same asset is depreciated by firm A in four years and by firm B in five years, either firm A or B are not following accounting best practices. Do you agree? Why, or why not?
-
Derive the stopping rule for investments in education.
-
Bill Dukes has $ 1 0 0 , 0 0 0 invested in a 2 - stock portfolio. $ 6 2 , 5 0 0 is invested in Stock X and the remainder is invested in Stock Y . X s expected return is 1 0 . 0 % and Y s expected...
-
Marc Company assembles products from a group of interconnecting parts. The company produces some of the parts and buys some from outside vendors. The vendor for Part X has just increased its price by...
-
In problem, graph each function. Based on the graph, state the domain and the range and find any intercepts. if x < 0 le* if x 2 0 f(x) =
-
For any triangle, derive the formula a = b cos C + c cos B Use the fact that sin A = sin(180 - B - C).
-
Solve the system of equations. 3x y? = 1 7x2 2y 5 = 0 3.
-
Summers Manufacturing Corporation produces chemical products using a continual process. Summers uses the weighted average method for process costing. All manufacturing is accomplished in one...
-
Parker Laboratories, Inc., produces one of its products in two successive departments. All materi- als are added at the beginning of the process in Department 1. No materials are used in Department...
-
Kipling Manufacturing, Inc., operates a plant that produces its own regionally marketed Super Salad Dressing. The dressing is produced in two processes, blending and bottling. In the Blending...
Study smarter with the SolutionInn App