Lecture Notes on 29 Apr 2022 * Longest Increasing Subsequence: Given a sequence of numbers find the length of the longest increasing subsequence. The subsequence contains elements that are not necessarily contiguous. Here is a sequence of numbers: 3, 1, 4, 5, 9, 2, 6, 8 What is the length of the longest increasing subsequence? The length of the longest increasing subsequence is 5. There are two increasing subsequences of length 5. 3, 4, 5, 6, 8 1, 4, 5, 6, 8 * Here are the worksheets for the Longest Increasing Subsequence: https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Longest_Increasing_Subsequence.pdf https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Longest_Increasing_Subsequence.docx * Coin Change problem: You have a large number of coins of the following denominations [1, 7, 13, 23]. What is the minimum number of coins that you can use to hand out change for 37? Number of coins: C[37] = min {(C[37 - 1], C[37 - 7], C[37 -13], C[37 -23]} + 1 = min {C[36], C[30], C[24], C[14]} + 1 * Here are the worksheets for the Coin Change Problem: https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Coin_Change_Problem.pdf https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Coin_Change_Problem.docx * Maximum Weighted Independent Set: You have a set of bottle with different volumes filled with your favorite beverage. You may drink as much as you want with the constraint that you cannot drink from two adjacent bottles. How can you maximize your intake? The volumes are {6, 2, 9, 5, 1, 4, 7, 8, 3} Let us say you have n bottles. Then you chose the last bottle or you do not chose the last bottle. If you do not chose the last bottle then you want to find the best solution from among the first n - 1 bottles. If V[i] is the volume of the ith bottle and S[i] is the largest sum so far, then the solution is of the form: S[i] = max {(V[i] + S[i - 2]), S[i - 1]} * Here are the worksheets for the Maximum Weighted Independent Set: https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Maximum_Weighted_Independent_Set.pdf https://www.cs.utexas.edu/users/mitra/csSpring2022/cs313/notes/Maximum_Weighted_Independent_Set.docx