5,013 views

Define $R_n$ to be the maximum amount earned by cutting a rod of length $n$ meters into one or more pieces of integer length and selling them. For $i>0$, let $p[i]$ denote the selling price of a rod whose length is $i$ meters. Consider the array of prices:

$$\text{p}=1,\text{p}=5,\text{p}=8,\text{p}=9,\text{p}=10,\text{p}=17,\text{p}=18$$Which of the following statements is/are correct about $R_7$?

1. $R_7=18$
2. $R_7=19$
3. $R_7$ is achieved by three different solutions
4. $R_7$ cannot be achieved by a solution consisting of three pieces

It is a DP problem of cutting a rod.
any logic behind selling 2 meters rod two times ???

A & C should be correct

• $1^{st}$ Solution $: p;p;p = 5+8+5 = 18$
• $2^{nd}$ Solution $: p = 18$
• $3^{rd}$ Solution $: p; p = 17+1 = 18$

cutting a rod into 1 piece ? doesn’t sound ambiguous
In question it says that Rn is achieved by selling the peices how P can be sell two times in solution to obtain R7 as 18

Cutting a Rod into 1 piece = keeping the rod as a whole single piece. Hence it’s valid.

@unnayansharma p just says the price of a piece of length 2. Imagine the rod is cut into 3 pieces of lengths : (2 units, 3 units, 2 units)

1st : directly from p= 18

2nd  : p + p= 18

3rd : p + p + p= 5+8+5= 18

and these are the only 3 ways you can try other combinations but these only are gives maximum .