CS 6901 Take home Exam

CS 6901 Take home Exam
Post date: 12:00 noon, November 13, 2015
Due date: 5:00 pm, November 16, 2015.
1 (30) Sequences comparisons.
(a) (10) Fill the Similarity array a[i,j] for sequences: s= GATATG, t= AAT in global match,
using algorithm Similarity and algorithm Align. Where the score system is
p(a,b)=1 if a=b, p(a,b)=-1 if a not= b, g=-2 if one of a and b match a space.
(b) (10) Suppose that s is an unknown sequence and t is a known sequence, hence only
s may contain errors (a missing or replaced character). Modify the recursion of the
dynamic programming method and/or modify the initialization to deal with this case.
(write a new recursion, and fill the 6 by 3 array a[i,j] with initalization).
(c) *(10) Suppose that in the sequence match, only a block of consecutive space is prefer.
That is there are three types of blocks:
1. Two aligned characters between s and t
2. A maximal series of consecutive characters in t alighned with spaces in s
3. A maximal series of consecutive characters in s alighned with spaces in t
For example,
s = |AAC| - - Prefer:
not prefer:
|A|ATTCCGAC|TAC|
t = |ACT |ACC|T| - - - - - - - - |CGC|
s= |A|A|C| - |A|ATT|CCG|A|CT|A|C|
t= |A| - |C|T|A|- - - |CCT| - |CG|- |C|
5 blocks
11 blocks
Write a recursion to adapt this block requirenment and decide a score system as well as
initialization of the s-t array a[i,j].
1
2. (30) Linear Programming.
(a) (10) (i) Let a general linear program L have n variables and m constraints,
and L is coverted into a standard form. What is the upper bound of the number of
variables and constraints in the resulting linear program, respectively?
(ii) Given an example of a linear program, say L, such that the feasible region is
unbounded however the optimal objective value is finite.
(b) (10) Prove the following problem.
Let P be the following 1-variable linear program:
Maximize cx
subject to
ax ≤ b
x ≥ 0, where constants a, b, c ∈ R
Let D be the dual of P. Expliain what value of a, b, c will be in each of the following cases.
(i) Both P and D have optimal solutions with finite objective values.
(ii) P has feasible solution but D has infeasible solution.
(ii) D has feasible solution but P has infeasible solution.
(iv) Neither P nor D has feasible solution.
(c) (10) Solve the following linear program using SIMPLEX algorithm.
Minimize x1 − x2
Subject to
2x1 + 7x2 ≥ 100
15x1 + 8x2 ≥ 400
x1, x2 ≥ 0
2
3. (20) FFT and polynomial multiplications.
(a) (10) Given a Divide-and-conquer mutiplication algorithm for two polynomials of degree
bound n in O(nlg3) time. Note that you can divide the coefficients of input polynomials into
high half and low half (or even/odd index).
(b) (10). Given two polynomials of degree bound of 5
3
4
A(x) = 8 + 4x + 37x2+ 5x + 6x
B(x) = 2 1+ 7x + 5x2 - 4x3 - 5x4,
using FFT to find the produt C(x) in O(n log n) time.
Write down each of the three steps in detail for the calculation.
4. *(10) Proof technique.
A regular 7-gon is a convex polygon with 7 equal-length edges and the 7 vertices (the endpoints of
these edges) so that the vertices lie on the boundary of a circle C with center o.
A bar is a line segment connecting center o to a vertex. a bridge is a line segment connecting every
two vertices. Let the vertices be v1, v2, v3, v4, v5, v6, and v7, and the 7 bars be r1 (=ov1),S2 (=ov2), S3
(=ov3), S4 (=ov4), , S5 (=ov5), S6(=ov6), S7 (=ov7), and the 7 bridges be b1 (=v1v3),
b2 (=v2v4), b3 (=v3v5), b4 (=v4v6), b5 (=v5v7), b6(=v6v1), b7 (=v7v2). Clearly, any bar is shorter than
any bridge. .PSFPWFS, the length of every bar equals S, and the length of every bridge equals C.
(a) Let o' be a point inside this 7-gon such that the length of every bar S'k (=o'vk) for k=1..7 must
be shorter than C. Prove that the sum of the lengths of S'k for k=1..7 is shorter than 7S.
(b) Is the sum of the lengths of S'k for k=1..7 still shorter than 7S ? if the vertices of the7-gon DBO
move along the boundary of the circle C BOENBJOUBJOJOH the length of every bar S'k (=o'vk) for
k=1..7 must be shorter than UIFCSJEHFDSPTTFECZShL
3