Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Dynamic programming

1.[3p]

What does "overlapping subproblems" mean?

Correct
The answer is: The recursion visits a small set of distinct subproblems an enormous number of times
The answer is: The recursion visits a small set of distinct subproblems an enormous number of times
The answer is: The recursion visits a small set of distinct subproblems an enormous number of times

2.[2p]

Mergesort would be faster if its subproblems were memoised.

The answer is: False
Correct

3.[3p]

Pieces of length 1 to 8 sell for 2, 5, 7, 8, 10, 17, 17 and 20. What is the best revenue from a rod of length 8?

CorrectNot quite: 22

4.[2p]

With those same prices, what is the best revenue from a rod of length 5?

CorrectNot quite: 12

5.[3p]

A bag holds 8 kg and the items are (3 kg, 4), (4 kg, 5), (2 kg, 3) and (5 kg, 6). What is the best value?

CorrectNot quite: 10

6.[2p]

How many cells does the knapsack table have for 40 items and a capacity of 500, counting the zero row and column?

CorrectNot quite: 20541

7.[3p]

What is the edit distance between "kitten" and "sitting"?

CorrectNot quite: 3

8.[3p]

Which of these are true of dynamic programming?

Select all that apply

Correct
Correct
Correct
The answer is: It needs both overlapping subproblems and optimal substructure, The running time is the number of table cells times the work per cell, Memoisation computes only the subproblems actually reached

9.[3p]

Why is the Θ(nW) knapsack algorithm called pseudo-polynomial?

Correct
The answer is: $W$ is written in $\log_2 W$ bits, so the table is exponential in the length of the input
The answer is: $W$ is written in $\log_2 W$ bits, so the table is exponential in the length of the input
The answer is: $W$ is written in $\log_2 W$ bits, so the table is exponential in the length of the input