CSCI570 – (Solution)

$ 20.99
Category:

Description

Graded Problems

For the grade problems, you must provide the solution in the form of pseudocode and also give an analysis on the running time complexity.

Problem 1

[10 points] Suppose you have a rod of length N, and you want to cut up the rod and sell the pieces in a way that maximizes the total amount of money you get. A piece of length i is worth pi dollars. Devise a Dynamic
Programming algorithm to determine the maximum amount of money you can
get by cutting the rod strategically and selling the cut pieces.

Problem 2

R = (67, 65, 72, 75, 73, 70, 70, 68)

the minimum number of band members to pull out to make a formation will be 2, resulting in the following formation:

(67, 72, 75, 73, 70, 68)

Give an algorithm to find the minimum number of band members to pull
out of the line.
Note: you do not need to find the actual formation. You only need to find the minimum number of band members to pull out of the line, but you need to find this minimum number in O(n2) time.

For this question, you must write your algorithm using pseudo-code.

Problem 3

[10 points] From the lecture, you know how to use dynamic programming to solve the 0-1 knapsack problem where each item is unique and only one of each kind is available. Now let us consider knapsack problem where you have infinitely many items of each kind. Namely, there are n different types of items. All the items of

the same type i have equal size wi and value vi. You are offered with infinitely many items of each type. Design a dynamic programming algorithm to
compute the optimal value you can get from a knapsack with capacity W .

Practice Problems

Problem 4

Here is an example. If you have the nums arrays equals [3, 1, 5, 8]. The optimal solution would be 167, where you burst balloons in the order of 1, 5 3 and 8. The left balloons after each step is:

[3, 1, 5, 8] → [3, 5, 8] → [3, 8] → [8] → []

And the coins you get equals:

167=3″1″5+3″5″8+1″3″8+1″8″1.

Problem 5

Solve Kleinberg and Tardos, Chapter 6, Exercise 5.

Problem 6

Solve Kleinberg and Tardos, Chapter 6, Exercise 6.

Reviews

There are no reviews yet.

Be the first to review “CSCI570 – (Solution)”

Your email address will not be published. Required fields are marked *