Solution (source code)

= Solution

For fixed $p\ge1$, the complement of the <simple matching coefficient> is the fraction of coordinates that disagree:
$$
1-S_1(x,y)=\frac1p\sum_{r=1}^p\mathbf1\{x_r\ne y_r\}.
$$
This is the <normalized Hamming distance>. It is nonnegative, symmetric, and is zero exactly when every coordinate agrees. At each coordinate,
$$
\mathbf1\{x_r\ne z_r\}\le
\mathbf1\{x_r\ne y_r\}+\mathbf1\{y_r\ne z_r\}.
$$
Summing and dividing by $p$ proves the <triangle inequality>. Therefore \b[$d_1$ is a <metric>] on the binary vectors.