Define Rn 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] denotes the selling price of a rod whose length is i meters. Consider the array of prices: p[1] = 1, p[2] = 5, p[3] = 8, p[4] = 9, p[5] = 10, p[6] = 17, p[7] = 18 Which of the following statements is/are correct about R7?
Define Rn 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] denotes the selling price of a rod whose length is i meters. Consider the array of prices: p[1] = 1, p[2] = 5, p[3] = 8, p[4] = 9, p[5] = 10, p[6] = 17, p[7] = 18 Which of the following statements is/are correct about R7? Correct Answer R<sub>7</sub> = 18, R<sub>7</sub> is achieved by three different solutions.
Data:
p = 1, p = 5, p = 8,
p = 9, p = 10, p = 17, p = 18
Calculation:
R7= max amount and length can be integer
|
Pieces |
Amount |
|
1, 1, 1, 1, 1, 1, 1 |
7 |
|
1, 1, 1, 1, 1, 2 |
10 |
|
1, 1, 1, 1, 3 |
12 |
|
1, 1, 1, 4 |
12 |
|
1, 1, 5 |
12 |
|
1, 6 |
18 |
|
1, 1, 2, 3 |
15 |
|
1, 3, 3 |
17 |
|
1,2,4 |
15 |
|
2, 2, 3 |
18 |
|
7 |
18 |
maximum cost possible is 18 and there are 3 solutions for R7.