Q1) 0/1 knapsack: This is a variation of the knapsack problem where each item can be either picked entirely or not picked at all. More precisely, we have a set of n items with weights w_1,\ldots,w_n and profits/values b_1,\ldots,b_n. For simplicity assume that all profits are equal to the weights, i.e. b_i=w_i for all i (e.g. each item is a peice of gold). We want to pick a subset of items to put into a knapsack with capacity W maximizing the value. This is equivalent to picking a subset of items whose total weight comes as close as possible to W. 1-a) Show by an example, why the obvious greedy algorithm does not for this problem. Sol: suppose we sort the items in decreasing (or precisely non-increasing) order of weight. We consider the items in this order and place it in the knapsack if it fits. Here is a counter-example: w_1=501, w_2=500, w_3=500, and W=1000. This way the algorithm will only pick item 1 while the optimal solution is to pick items 2 and 3. So the solution can be as bad as (almost) half the optimal. If we sort the items in the non-decreasing then the situation can be worse: assume w_1=1 w_2=1000 and W=1000. Then the algorithm will pick only item 1 while the optimal solution picks w_2. 1-b) Let M_1 be the value of the solution by the first greedy and M_o be the value of the optimal. Prove that at least M_1\geq M_o/2 (that is the first greedy is at least half the optimal). Sol: We prove that if M_1\not= M_o then M_1>M_o/2. This clearly implies that always M_1>= M_o/2. So, by way of contradiction, suppose that M_1