Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2003/iii/paper-42/2/i/solution
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 42 2 i Solution by
Codex 0 Created 2026-10-03 Updated 2026-10-14
Treat each row as a set 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 count coordinates equal to one in both, count , count , and count . ThenThe 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 by all ten coordinates.
For Philip and Chad, four attributes are present in both and eight in at least one, giving Jaccard distance . Graham and Tim differ in one of eight coordinates present in their union, giving , printed as . 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. New to topics? Read the docs here!