equal
deleted
inserted
replaced
154 |
154 |
155 \[ |
155 \[ |
156 \texttt{overlap}(d_1, d_2) = \frac{d_1 \cdot d_2}{max(d_1^2, d_2^2)} |
156 \texttt{overlap}(d_1, d_2) = \frac{d_1 \cdot d_2}{max(d_1^2, d_2^2)} |
157 \] |
157 \] |
158 |
158 |
|
159 where $d_1^2$ means $d_1 \cdot d_1$ and so on. |
159 You can expect this function to return a \texttt{Double} between 0 and 1. The |
160 You can expect this function to return a \texttt{Double} between 0 and 1. The |
160 overlap between the lists in (2) is $0.5384615384615384$. |
161 overlap between the lists in (2) is $0.5384615384615384$. |
161 |
162 |
162 Second, implement a function that calculates the similarity of |
163 Second, implement a function that calculates the similarity of |
163 two strings, by first extracting the substrings using the clean |
164 two strings, by first extracting the substrings using the clean |