In a variety of CS applications, it’s useful to be able to compute the similarity of two sets A and B. (More about one of
these applications, collaborative filtering, below.) There are a number of different ideas of how to measure set similarity,
all based on the intuition that the larger |A ∩ B| is, the more similar the sets A and B are. Here are two basic measures
of set similarity that are sometimes used:
• the cardinality measure: the similarity of A and B is |A ∩ B|.
• the Jaccard coefficient:7
the similarity of A and B is |A∩B|
2.124 Let A := {chocolate, hazelnut, cheese}; B := {chocolate, cheese, cardamom, cherries}; and
C := {chocolate}. Compute the similarities of each pair of these sets using the cardinality measure