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...
-
The following three accounts appear in the general ledger of Beiber Corp. during 2017. Instructions From the postings in the accounts, indicate how the information is reported on a statement of cash...
-
Researchers Olivia Carrillo-Gamboa and Richard Gunst presented the following data in their article, "Measurement-Error-Model Collinearities." The data represent the compressive strength (in pounds...
-
Im gathering some information about the sales/collection process and how it is supposed to work. Okay?
-
Presented below are the financial statements of Nosker Company. NOSKER COMPANY Income Statement For the Year Ended December 31, 2014 Sales revenue ..............$242,000 Cost of goods sold...
-
Question 10 Consider a market for electricity, where there is one electricity providor. Suppose demand (in megawatt hours) is given by Q = 50 - P and that the marginal private cost of generating...
-
The Production manager of the Good Time Wine Rack Company is retiring and the Managing Director is looking to replace her. You are preparing a work schedule as youare hoping to be offeredthe position...
-
To measure the brightness of a star from earth, the brightness of the star Vega is used as a reference, and is assigned a relative intensity lo = 1. The magnitude m or any given star is defined by m...
-
Brenda's Bakery has two departments, baking and frosting. Brenda's has the following costs and resource usage in each of her departments: Brenda's Baking Overhead Costs and Resource usage by...
-
Henderson Inc. has $150,000 of raw materials in inventory. The finished goods inventory is $220,000 and the Total inventory accounts is $550,000. What is the value of the work in process?
-
Nina Inc. has identified the activities that drive their overhead costs and has assigned costs as follows: Activities, Costs and Drivers Activity Overhead Cost Driver Driver Quantity Changeover...
-
according to the knformation for you found in the medical and health services managers section of the occupational outlook handbook by the us bureau of labor statistics, what is the median salary for...
-
Using our discussions/notes on financial statements/ratios (including the key takeaways handout), identify five or six critical financial traits of companies that are doing extremely well. For...
-
A clause in many insurance policies require the business owner to carry at least 80% (percentage may vary) of the replacement cost or actual cost of the building. This clause is known as what? define...
-
Listed below are common types of current liabilities, contingencies, and commitments: a. Accounts payable b. Bank loans and commercial paper c. Notes payable d. Dividends payable e. Sales and excise...
-
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.
-
For the three-room house shown in Figure 7.35, all rooms are perfect squares and have the same dimensions. An air conditioner produces an equal amount of heat flow \(q_{\mathrm{ho}}\) out of each...
-
Figure 7.18 shows a liquid-level system in which two tanks have cross-sectional areas \(A_{1}\) and \(A_{2}\), respectively. The volume flow rate into tank 1 is \(q_{\mathrm{i}}\). A pump is...
-
Consider the single-tank liquid-level system shown in Figure 7.19, where the volume flow rate into the tank through a pipe is \(q_{\mathrm{i}}\). The liquid leaves the tank through an orifice of area...
Study smarter with the SolutionInn App