代写 DS 320: Homework 2 Programming Assignment

DS 320: Homework 2 Programming Assignment
Due: Monday, October 7, 2019, 11:59pm (EST)
Name: _______________________________________
Question
Points
Score
1
10
2
30
3
10
Total
50
1

1. (10 points) Implement the following function for determining the Jaccard similarity between two strings:
Let s1 = “Apple Corporation, CA” and s2 = “Apple Corp, CA” Print the output of:
jaccard_sim(s1, s2, k) for k = 1,2,3, and 4
2. (30 points) Implement the following function for computing the edit distance between two strings:
Let s1 = “Apple” and s2 = “Apel”. Print edit_distance(s1, s2). Validate your output by manually applying the recursive dynamic programming equations.
3. (10 points) Implement the following function for computing the similarity between two strings based on their edit distance score:
Let s1 = “Apple Corporation, CA” and s2 = “Apple Corp, CA” Print the output of ed_similarity(s1, s2).
2