From: Neil Smith Date: Wed, 12 Mar 2014 12:37:20 +0000 (+0000) Subject: Fixed conflicting equation typesetting X-Git-Url: https://git.njae.me.uk/?p=cipher-training.git;a=commitdiff_plain;h=5b51a469cc152b1035a5cf69f2c38d51f9d16eb8 Fixed conflicting equation typesetting --- 5b51a469cc152b1035a5cf69f2c38d51f9d16eb8 diff --cc slides/caesar-break.html index c6d4023,6df8365..a47e236 --- a/slides/caesar-break.html +++ b/slides/caesar-break.html @@@ -131,26 -123,19 +149,26 @@@ Counting letters in _War and Peace_ giv Several different distance measures (__metrics__, also called __norms__): -* L2 norm (Euclidean distance): `\(\|\mathbf{x} - \mathbf{y}\| = \sqrt{\sum_i (\mathbf{x}_i - \mathbf{y}_i)^2} \)` +* L2 norm (Euclidean distance): - `\(|\mathbf{a} - \mathbf{b}| = \sqrt{\sum_i (\mathbf{a}_i - \mathbf{b}_i)^2} \)` ++`\(\|\mathbf{a} - \mathbf{b}\| = \sqrt{\sum_i (\mathbf{a}_i - \mathbf{b}_i)^2} \)` -* L1 norm (Manhattan distance, taxicab distance): `\(\|\mathbf{x} - \mathbf{y}\| = \sum_i |\mathbf{x}_i - \mathbf{y}_i| \)` +* L1 norm (Manhattan distance, taxicab distance): - `\(|\mathbf{a} - \mathbf{b}| = \sum_i |\mathbf{a}_i - \mathbf{b}_i| \)` ++`\(\|\mathbf{a} - \mathbf{b}\| = \sum_i |\mathbf{a}_i - \mathbf{b}_i| \)` -* L3 norm: `\(\|\mathbf{x} - \mathbf{y}\| = \sqrt[3]{\sum_i |\mathbf{x}_i - \mathbf{y}_i|^3} \)` +* L3 norm: - `\(|\mathbf{a} - \mathbf{b}| = \sqrt[3]{\sum_i |\mathbf{a}_i - \mathbf{b}_i|^3} \)` ++`\(\|\mathbf{a} - \mathbf{b}\| = \sqrt[3]{\sum_i |\mathbf{a}_i - \mathbf{b}_i|^3} \)` The higher the power used, the more weight is given to the largest differences in components. (Extends out to: -* L0 norm (Hamming distance): `\(\|\mathbf{x} - \mathbf{y}\| = \sum_i \left\{\begin{matrix} 1 &\mbox{if}\ \mathbf{x}_i \neq \mathbf{y}_i , \\ 0 &\mbox{if}\ \mathbf{x}_i = \mathbf{y}_i \end{matrix} \right| \)` +* L0 norm (Hamming distance): - `$$|\mathbf{a} - \mathbf{b}| = \sum_i \left\{ ++`$$\|\mathbf{a} - \mathbf{b}\| = \sum_i \left\{ +\begin{matrix} 1 &\mbox{if}\ \mathbf{a}_i \neq \mathbf{b}_i , \\ + 0 &\mbox{if}\ \mathbf{a}_i = \mathbf{b}_i \end{matrix} \right. $$` -* L norm: `\(\|\mathbf{x} - \mathbf{y}\| = \max_i{(\mathbf{x}_i - \mathbf{y}_i)} \)` +* L norm: - `\(|\mathbf{a} - \mathbf{b}| = \max_i{(\mathbf{a}_i - \mathbf{b}_i)} \)` ++`\(\|\mathbf{a} - \mathbf{b}\| = \max_i{(\mathbf{a}_i - \mathbf{b}_i)} \)` neither of which will be that useful.) ---