



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Theory of Computation; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2001;
Typology: Assignments
1 / 5
This page cannot be seen from the preview
Don't miss anything!




The following is what hw8 would have been, if we had enough time to check it (we don’t). This homework is an exercise - solve it if you want, don’t solve it if you don’t feel like it. Whatever you do don’t submit it. However, there is a non-zero probability that a question from this homework would appear in the final exam. Ignore this exercise at your own risk. No solutions for this exercise would be posted.
(a) [5 Points] maximize 6x 1 + 8x 2 + 5x 3 + 9x 4 subject to 2 x 1 + x 2 + x 3 + 3x 4 ≤ 5 x 1 + 3x 2 + x 3 + 2x 4 ≤ 3 x 1 , x 2 , x 3 , x 4 ≥ 0. (b) [5 Points] maximize 2x 1 + x 2 subject to 2 x 1 + x 2 ≤ 4 2 x 1 + 3x 2 ≤ 3 4 x 1 + x 2 ≤ 5 x 1 + 5x 2 ≤ 1 x 1 , x 2 ≥ 0. (c) [5 Points] maximize 6x 1 + 8x 2 + 5x 3 + 9x 4 subject to x 1 + x 2 + x 3 + x 4 = 1 x 1 , x 2 , x 3 , x 4 ≥ 0. (d) [5 Points] minimize x 12 + 8x 13 + 9x 14 + 2x 23 + 7x 24 + 3x 34 subject to x 12 + x 13 + x 14 ≥ 1 −x 12 + x 23 + x 24 = 0 −x 13 − x 23 + x 34 = 0 x 14 + x 24 + x 34 ≤ 1 x 12 , x 13 ,... , x 34 ≥ 0.
semi-finished products: bands and coils. The mill’s two products come off the rolling line at different rates:
Bands 200 tons/hr Coils 140 tons/hr.
They also produce different profits:
Bands $ 25/ton Coils $ 30/ton.
Based on current booked orders, the following upper bounds are placed on the amount of each product to produce:
Bands 6000 tons Coils 4000 tons.
Given that there are 40 hours of production time available this week, the problem is to decide how many tons of bands and how many tons of coils should be produced to yield the greatest profit. Formulate this problem as a linear programming problem. Can you solve this problem by inspection?
(a) Those traveling from Ithaca to Newark (god only knows why). (b) Those traveling from Newark to Boston (a very good idea). (c) Those traveling from Ithaca to Boston (it depends on who you know).
The aircraft is a small commuter plane that seats 30 passengers. The airline offers three fare classes:
(a) Y class: full coach. (b) B class: nonrefundable. (c) M class: nonrefundable, 3-week advanced purchase.
Ticket prices, which are largely determined by external influences (i.e., competitors), have been set and advertised as follows:
Ithaca-Newark Newark-Boston Ithaca-Boston Y 300 160 360 B 220 130 280 M 100 80 140
(c) [2 Points] Given a directed graph G = (V, E)), in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0. Write a linear program to compute the maximum flow f : V × V → IR. (d) [3 Points] (Based on CLRS 29.2-7) In the minimum-cost multicommodity-flow problem, we are given a directed graph G = (V, E), in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0 and a cost α(u, v). As in the multicommodity-flow problem (Chapter 29.2, CLRS), we are given k different commodities, K 1 , K 2 ,... , Kk, where commodity i is specified by the triple Ki = (si, ti, di). Here si is the source of commodity i, ti is the sink of commodity i, and di is the demand, which is the desired flow value for commodity i from si to ti. We define a flow for commodity i, denoted by fi, (so that fi(u, v) is the flow of commodity i from vertex u to vertex v) to be a real-valued function that satisfies the flow-conservation, skew-symmetry, and capacity constraints. We now define f (u, v) , the aggregate flow, to be sum of the various commodity flows, so that f (u, v) =
∑k i=1 fi(u, v). The aggregate flow on edge (u, v) must be no more than the capacity of edge (u, v). The cost of a flow is
u,v∈V f^ (u, v), and the goal is to find the feasible flow of minimum cost. Express this problem as a linear program.
Problem: Integer Linear Programming Instance: A linear program in standard form, in which A and B contain only integers. Question: Is there a solution for the linear program, in which the x must take integer values?
C = {x + y : x ∈ A and y ∈ B}.
Note that the integers in C are in the range from 0 to 20n. We want to find the elements of C and the number of times each element of C is realized as a sum of elements in A and B. Show that the problem can be solved in O(n lg n) time. (Hint: Represent A and B as polynomials of degree at most 10n.)
(a) [5 Points] Show how to multiply two linear polynomials ax + b and cx + d using only three multiplications. (Hint: One of the multiplications is (a + b) · (c + d).)
(b) [5 Points] Give two divide-and-conquer algorithms for multiplying two polynomials of degree-bound n that run in time Θ(nlg 3). The first algorithm should divide the input polynomial coefficients into a high half and a low half, and the second algorithm should divide them according to whether their index is odd or even. (c) [5 Points] Show that two n-bit integers can be multiplied in O(nlg 3) steps, where each step operates on at most a constant number of 1-bit values.