1,F (0) = 0,F(1) = c1.Solve the instance 7, 2, 5, 12, 5 of the coin-row problem using the recurrence given above.use the recurrence relation. Write your results to the table...


(Dynamic Programming, Coin-row problem)<br>There is a row of n coins whose values are some positive integers c,. c2,. Cn, not necessarily distinct. The<br>goal is to pick up the maximum amount of money subject to the constraint that no two coins adjacent in the<br>initial row can be picked up. The recurrence of the coin-row problem is given below.<br>F(n) = max{c, + F (n – 2), F(n – 1)} for n > 1,<br>F (0) = 0,<br>F(1) = c1.<br>Solve the instance 7, 2, 5, 12, 5 of the coin-row problem using the recurrence given above.<br>use the recurrence relation. Write your results to the table below.<br>Index<br>1<br>2<br>3<br>4<br>C<br>7<br>2<br>5<br>12<br>5<br>F<br>i = 1<br>F[1]<br>i = 2<br>F[2]<br>i = 3<br>F[3] =<br>i = 4<br>F[4] =<br>i = 5<br>F[5] =<br>Trace back from the table above to find the optimal solution set.<br>use the table you found above.<br>Write a pseudocode to find the optimal solution set.<br>Algorithm OptCoinSubset(C[1..n], F[0..n])<br>//Finds the optimal subset by tracing back from the solution table.<br>//Input: Arrays C[1 ..n] and F[0..n]of coin values and optimal solution table of n coins,<br>//Output:S is the set of items whose sum is the optimal value.<br>

Extracted text: (Dynamic Programming, Coin-row problem) There is a row of n coins whose values are some positive integers c,. c2,. Cn, not necessarily distinct. The goal is to pick up the maximum amount of money subject to the constraint that no two coins adjacent in the initial row can be picked up. The recurrence of the coin-row problem is given below. F(n) = max{c, + F (n – 2), F(n – 1)} for n > 1, F (0) = 0, F(1) = c1. Solve the instance 7, 2, 5, 12, 5 of the coin-row problem using the recurrence given above. use the recurrence relation. Write your results to the table below. Index 1 2 3 4 C 7 2 5 12 5 F i = 1 F[1] i = 2 F[2] i = 3 F[3] = i = 4 F[4] = i = 5 F[5] = Trace back from the table above to find the optimal solution set. use the table you found above. Write a pseudocode to find the optimal solution set. Algorithm OptCoinSubset(C[1..n], F[0..n]) //Finds the optimal subset by tracing back from the solution table. //Input: Arrays C[1 ..n] and F[0..n]of coin values and optimal solution table of n coins, //Output:S is the set of items whose sum is the optimal value.
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here