About
FAQs
Contact
Use Now
About
FAQs
Contact
Use Now
Probability Spun
This( site contains an old collection of practice dynamic programming problems and their animated solutions that I put together many years ago while serving as a TA for the undergraduate algorithms course at MIT. I am keeping it around since it seems to have attracted a reasonable following on the web. Eventually, this animated material will be updated and incorporated into an algorithms textbook I am writing. -- Brian Dean To view the solution to one of the problems below, click on its title. To view the solutions, you'll need a machine which can view Macromedia Flash animations and which has audio output. I have also included a short review animation on how to solve the integer knapsack problem (with multiple copies of items allowed) using dynamic programming. Problems: Integer Knapsack Problem (Duplicate Items Forbidden). This is the same problem as the example above, except here it is forbidden to use more than one instance of each type of item. Balanced Partition. You have a set of n integers each in the range 0 ... K. Partition these integers into two subsets such that you minimize |S1 - S2|, where S1 and S2 denote the sums of the elements in each of the two subsets. Edit Distance. Given two text strings A of length n and B of length m, you want to transform A into B with a minimum number of operations of the following types: delete a character from A, insert a character into A, or change some character in A into a new character. The minimal number of such operations required to transform A into B is called the edit distance between A and B. Counting Boolean Parenthesizations. You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, there are 2 ways to parenthesize 'true and false xor true' such that it evaluates to true. Optimal Strategy for a Game. Consider a row of n coins of values v(1) ... v(n), where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row, removes it from the row permanently, and receives the value of the coin. Determine the maximum possible amount of money we can definitely win if we move first. (Add about 20 new lines at the bottom to prevent the scroll issue)
I agree to the
terms of use
Submit