33 . [B] 2
c[3,4] = max[ c[2,4] , c[3,3] ] ; xi not equals to yj
now from table we can see that c[2,4] = 2 , c[3,3] = 1
Therefore ,
c[3,4] = max[ 2 , 1 ] = 2
Therefore value of c[3,4] is 2. Hence B is correct option.
34. [C] 3
AATGTT and AGCT
See C is not present in AATGTT . Now AGT is present . So it means AGT is longest common subsequence of AATGTT and AGCT.
Therefore length of AGT is 3.
35. [E] AGT
As it is clear from above explanation AGT is longest common subsequence.
Questions 33 to 35 refer to the following Longest Common Subsequence problem. Given two sequences X-XI,...
The following table is partially filled. 0 1 4 0 Xi 4 D a) Explain why c[1,1] to c[1,5] and c[2,1] to c[5,1] are all 1s? b) Compute c[2,2], and which cell do you refer to when computing it? c) Compute c 2,31 and c[3,2], which cell do you refer to directly this time? d) Fill up the rest of the cells. Assume that you take c[i,j - 1] when there is a draw in line 11. (i.e., take the...
Question 2 (2.5 points) Longest common subsequence Consider the procedure to determine the length of the longest common subsequence, LCS- LENGTH(X, Y). It solves the LCS problem in a bottom-up manner, by filling out a 2-D tabular LCS-LENGTH(X, Y) m = X.length 2. n-Y.length 3. let cO.m, 0n] be a new array 4, for i = 0 to m for/ = 0 to n else if ATY ci,ci ,j-1 +1 10 else 12. return clm, n] For example, X (B,...
Need help with all 3 parts. Thanks Question 1 (Longest Common Subsequence) In the longest common sub- sequence algorithm we discussed in class, we formulated the recursive formula based on prefixes of the two inputs, i.e., X[1...) and Y [1..,]. 1. Rewrite the recursive formula using suffixes instead of prefixes, i.e., X[...m] and Y[j..n]. 2. Develop a bottom-up dynamic programming algorithm based on the recur- sive formula in (a). Describe the algorithm and write a pseudo code. 3. Use the...
this python code below is to find the longest common subsequence from two input string !!! however it give me the wrong answer, can any one fix it thanks def lcs(s1, s2): matrix = [["" for x in range(len(s2))] for x in range(len(s1))] for i in range(len(s1)): for j in range(len(s2)): if s1[i] == s2[j]: if i == 0 or j == 0: matrix[i][j] = s1[i] else: matrix[i][j] = matrix[i-1][j-1] + s1[i] else: matrix[i][j] = max(matrix[i-1][j], matrix[i][j-1], key=len) cs =...
Develop an application that, given two sequences of words, will determine if the first is a subsequence of the second. The subsequence is defined as follow: Given X = <x1,x2,…,xn> a sequence of length n greater or equal to zero and Y = <y1,y2,…,ym> a sequence of length m greater than or equal to zero, X will be consider a subsequence of Y if and only if there exists a strictly increasing sequence of elements K = <k1, k2,…,kn> such...
Given three random variables Xi, X2, and X such that X[Xi X2 X 20 -1 3 1 0.5 1 E [X]-μ | 0 | and var(X)=Σー| 0 0.5 | com pute: 2 c) var(X2-X3 (d) var(X2 + X3) (e) cov(4X2 +X1,3Xi - 2X3)
5. Let X1,X2, . , Xn be a random sample from a distribution with finite variance. Show that (i) COV(Xi-X, X )-0 f ) ρ (Xi-XX,-X)--n-1, 1 # J, 1,,-1, , n. OV&.for any two random variables X and Y) or each 1, and (11 CoV(X,Y) var(x)var(y) (Recall that p vararo 5. Let X1,X2, . , Xn be a random sample from a distribution with finite variance. Show that (i) COV(Xi-X, X )-0 f ) ρ (Xi-XX,-X)--n-1, 1 # J,...
l. X) points Lei Xi, X, X b e random variables . I. adl X, is "uifornly disi rilnicd 。" on [0,1]. The random variables Xi, X2, X3,... are independent. The random variable N is the first integer n 2 1 such that Xn 2 c where 0< c< is a constant. That is, N = min(n : Xn-c). What is EM?
do 11.3 please Example 11.2b Let us reconsider Example 11.2a, where we have 5 to invest among three projects whose return functions are f(x) = 2x . 1+x f(x) = 10( I-e-x). Let xi (j) denote the optimal amount to invest in project 1 when we have maxlfi(l), f2(1), f3(1))-max(5, 1632 6.32, a total of j to invest. Because we see that Xi(1)=0, X2(I) = 0, x3(1)=1. Since max(f(xdl) + I)-f(xdl)) = max(5, I, 8.65-6.32) = 5. we have X1(2)...
3, Let X, X2,X, be independent random variables such that Xi~N(?) a. Find the distribution of Y= a1X1+azX2+ i.(Hint: The MGF of Xi is Mx, (t) et+(1/2)t) + anXn +b where a, 0 for at least one b. Assume = 2 =n= u and of- a= (X-)/(0/n) ? Explain. a. What is the distribution of The Sqve o tubat num c. What is the distribution of [(X-4)/(0/Vm? Explain.