exercise 9.3.2 from mmds book
Replacing the non-zero values is meant to simplify the matrix, i.e. we only care whether the value is zero or not.

Then you're supposed to calculate the Jaccard distance between pairs of columns. For instance between the first two columns you have $|a\cap b|=1$, $|a\cup b|=2$ so the distance is 1/2.

After that you're supposed to apply hierarchical clustering using the distance. This means progressively grouping elements (here columns) which are close to each other according to the distance.