Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Assignment 3: Linear Programming Design and Analysis of Algorithms Problem 1. You want to find a straight line ax + by = c that approximates the function y = x2 in the domain [1, 10]. Since we have been talking about linear programs, your first thought is to write a linear program to find the line that minimizes the absolute error: max i∈{1,2,...,10} |axi + byi − c| where xi = i and yi = i2 . Do it! (You don’t need to solve the linear program.) Problem 2. For the linear program: max x1 − 2x3 subject to: x1 − x2 ≤ 1 2x2 − x3 ≤ 1 x1 , x2 , x3 ≥ 0 prove that the solution (x1 , x2 , x3 ) = (3/2, 1/2, 0) is optimal by analysing the dual problem. Problem 3. After your glorious days at IISc, by a strange turn of events, you wind up being a dietician. You want to design a minimum-cost diet to meet minimum requirements for calories, protein, and carbohydrate dietary needs. The diet can include n types of food, and for each food i (1 ≤ i ≤ n), you know that it delivers ci units of calories, pi units of protein and hi units of carbohydrate per kilogram. Your latest research reveals that everyone should get at least C units of calories, P units of protein and H units of carbohydrate per day (more can be consumed without any harm). Also, currently, each food i costs pi rupees per kilogram. (a) Formulate a linear program to determine a diet which minimizes the total cost per day while meeting the nutritional requirements. (b) State the dual to the diet problem, specifying the units of measurements for each of the dual variables. (As an optional challenge, give an interpretation to the dual problem, in terms of a druggist who is selling a dietary pill .) Problem 4. Here is a variation of the maximum flow problem. Suppose that for each node u, the outgoing flow is not the same as the incoming flow but is smaller by a factor of (1 − u ) where 0 < u < 1 is a loss coefficient associated with node u. The objective is again to maximize the total flow on the outgoing edges from the start node. How can you solve this problem efficiently? 1