Late Homeworks will not be accepted after Monday, March 17th, 11am
1. Solving Recurrences (25 points)
Solve the following Recurrences. You may use the Masters Recurrence, but be sure to state which case you use and why, and show how you get your answer
2. Dynamic Programming (35 points)
You are interested in analyzing trends in stock prices. In particular, you want to see if two stocks have similar behaviors -- if when one stock price goes up, the other stock price goes up as well; and when one goes down, the other goes down as well. For example, we might see some similar trends in prices for airlines and trucking industries, as they both respond to gas prices. One problem is, their responses might not be at the exact same time (eg., though both respond to an increase in gas prices, airlines might respond in 2 weeks, while trucking industries will respond in 1 week).
More formally, we'll let a set of stock prices be given by list of integers, with one price per day. For two sets of stock prices X = x1x2...xm and Y = y1y2...yn, we define a matching between the two stock prices to be a set of pairs (xi, yj), where
X = 10,--,15,20,--,30,--,24,15, 1, 7,19 Y = 10,12,16,20,25,30,35,--,12, 2,--,18 Dist = 0,10, 1, 0,10, 0,10,10, 3, 1,10, 1has a distance of 56, while this matching:
X = 10,--,15,20,--,30,24,15, 1, 7,19 Y = 10,12,16,20,25,30,35,12, 2,--,18 Dist = 0,10, 1, 0,10, 0,11, 3, 1,10, 1has a distance of 47.
We want to find the matching with the smallest distance. It can be found with a dynamic programming approach. Give the recurrence to solve this problem.
3. NP (40 points)
The MaxCut problem is the following: given an undirected graph G=(V,E) and an integer k, is there a partition of the vertices into two (nonempty, nonoverlapping) subsets V1 and V2 so that k or more edges have one end in V1 and the other end in V2?