= Solution
Treat each row as a set $A_i$ of attributes with response one. The binary option computes the <Jaccard distance>, rather than counting matches at joint absences. For a pair of rows, let $a$ count coordinates equal to one in both, $b$ count $(1,0)$, $c$ count $(0,1)$, and $d$ count $(0,0)$. Then
$$
\boxed{d_{ij}=1-\frac{a}{a+b+c}=\frac{b+c}{a+b+c}.}
$$
The denominator counts coordinates present in at least one row; joint absences do not contribute. If both rows have no presences, use distance zero. This differs from <normalized Hamming distance>, which would divide $b+c$ by all ten coordinates.
For Philip and Chad, four attributes are present in both and eight in at least one, giving <Jaccard distance> $4/8=0.50$. Graham and Tim differ in one of eight coordinates present in their union, giving $1/8=0.125$, printed as $0.12$. Fred and Gbenga have identical profiles, hence distance zero despite being different students. The resulting <dissimilarity matrix> is symmetric with zero diagonal; `dist2full` restores the other half and the diagonal from the stored pairwise entries. The display rounds entries for readability; the <agglomerative hierarchical clustering> uses the original unrounded distances.
Back to article page