You are given a rectangular piece of cloth with dimensions X by Y, where X and Y are positive integers, and a list of n products that can be made using the cloth. For each product i in [1,n] you know that a rectangle of cloth of dimensions ai by bi is needed and that the final selling price of the product is ci. Assume that ai, bi, and ci are all positive integers. You have a machine that can cut any rectangular piece of cloth into two pieces either horizontally or vertically. Design an algorithm that finds the best strategy for cutting an X by Y piece of cloth so that the products made from the resulting pieces give the maximum sum of selling prices. You are free to make as many copies of a given product as you wish, or none if desired. How can i prove that the recursion is exponential and that dynamic programming is polynomial

Answers

Answer 1

The proof that recursion is exponential and that dynamic programming is polynomial is given by the formula;

P(x,y) = max{

P(x,y)

max (1 <= h <= X) { P[h, Y] + P(X - h, Y) }

max (1 <= v <= Y) { P[X, v] + P[X, Y - v] }

}

To prove that the recursion is exponential and that dynamic programming is polynomial. we will do so as follows;

Let us first have the assumption that the cloth is in such a manner that  either way, a product can be oriented. This implies that that after a cut, we will now have two pieces of cloth.

Now, we will make a list of the side lengths of the products that can fit in the piece after which we will consider a vertical cut for each of the side length as well as a horizontal cut for each of the side length, then we apply the same algorithm to each of the two resulting pieces.  

Thus, after the point above, it is likely true that in some instances, there may be a place to cut that is not at a product side length. However, It might be better for us to make a list of lengths composed of one or more pieces side by side as long as the sum is less than the length of the side being considered.

 

Lastly, we would note that this recursive approach is not limited to just two -dimensional problems as It could also be applied to a single or more than two dimensions. A useful proof would be to prove it for one dimension, then assuming it is true for n dimensions, prove it is true for n + 1 dimensions.

Thus;

P(x,y) = max{

P(x,y)

max (1 <= h <= X) { P[h, Y] + P(X - h, Y) }

max (1 <= v <= Y) { P[X, v] + P[X, Y - v] }

}

Read more at; https://brainly.com/question/11665190


Related Questions

What happens when you put diesel in a gas engine.

Answers

Explanation:Since diesel fuel is thicker and denser than gasoline, the fuel pump will struggle to move the diesel/gasoline mixture through the system. Instead, it will clog up the fuel filter. And whatever amount of diesel that then makes its way to the engine will clog the fuel injectors, making them inoperable.

when heat is added or subtracted from an object its temperature _____________ or _____________


SUBJECT : SCIENCE​

Answers

The answer is:
Rises
Or
Lowers.

NO SCAMS

The Air Force is F 22 raptor fighter jets mass is 21,000 KG the F 22 is flying at a height of 26,000 miles what is its gravitational potential energyThe Air Force is F 22 raptor fighter jets mass is 21,000 KG the F 22 is flying at a height of 26,000 miles what is its gravitational potential energyThe Air Force is F 22 raptor fighter jets mass is 21,000 KG the F 22 is flying at a height of 26,000 miles what is its gravitational potential energyThe Air Force is F 22 raptor fighter jets mass is 21,000 KG the F 22 is flying at a height of 26,000 miles what is its gravitational potential energy

Answers

Answer:

2758.09

Explanation:

Other Questions
In which quadrant does the point (-4, -5) lie? An automatic doughnut machine can produce 1500 doughnuts in 9 hours.How long would it take the machine to make 300 doughnuts? Help. What is 90% decreased by 10% :/ Is it 81? How do I do this? Help me please if one says that the clearance value of glucose is zero, what does this mean? Write an ordered pair for the point in Quadrant IV that is 4 units away from point s (-1.5, -2.5) on the coordinate plane.PLS help!and explainbrainliest When bacon is cooked, a solid fatty residue remains in the pan after cooling. What can be said about the fat in bacon based on this observation Twenty-nine lots of p= 2. What is the exchange rate? Show your work. 1 US dollar = ___________ eurohelp pls :( What are some ways the people of East Asia depend on rivers? NEED ASAP PLEASE SHOW WORK! Follow the directions and solve this sequence for the first 10 terms:-3,-12,-48,-192 A. CR: 410th term: -262,144 B. CR:-410th term: 786,432 C. CR:410th term: - 786,4323 Fix the adjective error (if one exists).Arturo Castro has a more fast mile time than I do. 1.which is not true about addition of polynomials?a. combines similar termsb. copy the variable/sc. add the exponent of the variabled. simplify the constant Give one example of an urban area and one example of a rural area. Please I need help with this and I will give brainlist if is right answer what I need help with is with my essay thesis and Directional statement please say if right or wrong or other is anything I can improve it and the story is a sentry So my thesis is (Sentry is a good short story)And my Directional statement is (I think that sentry is interesting because it has an interesting plot and interesting irony). kinyua spent [tex] \frac{1}{4} [/tex]of his net January salary on school fees What would the Committees of Correspondence discuss in town meetings? How British laws were affecting them How to repair British soldiers' uniforms Where to buy fresh bread and eggs Where to find seeds for the farmers Adult tickets to the fall play cost $8 and student tickets cost $4 . The drama class sold 30 more adult tickets than student tickets to the fall play. If the class collected $840 from ticket sales, how many adult tickets were sold?The drama class sold blank adult tickets. Last night when I came to the party , everyone There PLS HELP ASAP !! (i'll mark as brainliest if u answer)