Docsity

Homework Assignment 5: Solutions to Problems in Probability and Dynamic Programming, Exams of Advanced Algorithms

Toggle sidebar
bg1
Homework Assignment 5
This assignment is due by Thursday April 4 (in class). Assignments should be handed in before the
class begins.
Problem 1: Solve exercises 15.2-1 (page 378), 15.3-2 (page 389), 15.3-4 (page 390), and 25.2-6
(page 700) in the textbook.
Problem 2: Complete the details of the algorithm for finding the path of highest probability in
Hidden Markov Models given in class, by providing a pseudo-code for the problem. Then apply
the algorithm to compute the most likely path for the string “bcaac” in the following HMM:
S1 S2
S3
b: 0.1
a: 0.6
c: 0.2
a: 0.8
c: 0.1
b: 0.3
c: 0.6
a:0.3
1
pf2

Partial preview of the text

Download Homework Assignment 5: Solutions to Problems in Probability and Dynamic Programming and more Exams Advanced Algorithms in PDF only on Docsity!

Homework Assignment 5

This assignment is due by Thursday April 4 (in class). Assignments should be handed in before the class begins.

Problem 1: Solve exercises 15.2-1 (page 378), 15.3-2 (page 389), 15.3-4 (page 390), and 25.2- (page 700) in the textbook.

Problem 2: Complete the details of the algorithm for finding the path of highest probability in Hidden Markov Models given in class, by providing a pseudo-code for the problem. Then apply the algorithm to compute the most likely path for the string “bcaac” in the following HMM:

S1 (^) S

S

b: 0.

a: 0.

c: 0.

a: 0.

c: 0.

b: 0.

c: 0.

a:0.

Problem 3: In this problem we develop a dynamic programming algorithm for the following problem. The input is an array A of n distinct integers. The goal is to find the length of the longest increasing subsequence of entries in A (and to identify such a subsequence). The subse- quence is not required to be contiguous in the original sequence. For example, if the entries are 12 , 13 , 4 , 10 , 3 , 8 , 5 , 15 , 7 , 11 , 9 the longest possible subsequences are of length 4 and one sub solution is 3, 5 , 7 , 9. The longest sequence starting with 8 is of length 2.

Develop a dynamic programming algorithm using the following template. Assume that for all k + 1 ≤ j ≤ n you know L(j), the length of the longest subsequence that start with A[j]. Now develop a recursive formula for L(k).

For your writeup: (1) Explain your recursive formulation. (2) Give pseudocode for a bottom up version of such an algorithm and (3) apply it to the example above. (4) What do you need to add to the algorithm in order to find the sequence and not just its length?