{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

AlgFl03Fnl

# AlgFl03Fnl - CSE 5211/4081 PRINT NAME Fall 2003 Final Time...

This preview shows pages 1–2. Sign up to view the full content.

CSE 5211/4081 Fall 2003 Final Time 115 min Points: 50(UG) 60(G) PRINT NAME: Status: Undergraduate / Graduate Std. 1. String Matching: Create an automaton for the following string cgatat , over a four alphabet set {a, t, c, g}. Use the automaton to find the string within T= cgcgcgatata . Draw the automaton and show the steps clearly. Automaton for string P: 0-c-1-g-2-a-3-t-4-a-5-t-6(Accept) Transition(*, c)=1, Transition(*, not c)=0, where * indicates any state Matching on string T using the above automaton: 0-c-1-g-2-c-1-g-2-c-1-g-2-a-3-t-4-a-5-t-6(A, print position-|P|=10-6=4)-a-0 2. Dynamic Programming: An optimization problem needs to find the best way to divide a list of numbers A. The formula for the optimal value between the I-th and the j-th elements is C(I,j) = A[I] when I=j, or C[I,j]=max{C(I,k)/C(k+1,j), for I k <j} when I<j, just like the matrix chain product problem. Run a dynamic programming algorithm over the list A=(2 2 2 2 3 2 2 2) in order to solve the problem. Complete the matrix over the following list and show at least a few sample steps for j=I+2, and j=I+3 toward the computation. C(I,j) j=1 2 3 4 5 I=1 2 1/2 4 1 2 2 4 1/2 2 1 3 8 2 4 4 4 2 5 2 Division is not associative, so, the result differs in which order one divides the chain. The algorithm is almost identical to the matrix chain product DP algorithm.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}