Lecture 6 Dynamic Programming
Example 4 Viterbi’s Algorithm Consider a simplified version of a voice recognition problem Goal: Given n segments of sounds, output the phonemes (e.g. /ˈfoʊniːm/) each sound might represent one of k phonemes. Input: For each sound segment, a list of scores for the k phonemes. For every pair of phonemes, a score for how likely one comes after the other Goal: Find a sequence of phonemes that has the highest score.
Example n = 3, k = 2 Input: Optimal solution: 1 2 1 Score = (5 + 3 + 4) + (5 + 4) = 21 Phoneme\Sound 1 2 3 5 4 Phoneme\Phoneme 1 2 5 4
Example 5:Max Independent Set on Trees Input: a tree Independent Set: Set of nodes that are not connected by any edges Goal: Find an independent set of maximum size.
Max Independent Set on Trees Input: a tree Independent Set: Set of nodes that are not connected by any edges Goal: Find an independent set of maximum size.