Jaccard Distance

后端 未结 2 1905
鱼传尺愫
鱼传尺愫 2021-01-01 07:52

I have this problem in calculating Jaccard Distance for Sets (Bit-Vectors):

p1 = 10111;

p2 = 10011.

Size of intersection = 3; (How could we find it

2条回答
  •  被撕碎了的回忆
    2021-01-01 08:04

    Size of intersection = 3; (How could we find it out?)

    Amount of set bits of p1&p2 = 10011

    Size of union = 4, (How could we find it out?)

    Amount of set bits of p1|p2 = 10111

    Vector here means binary array where i-th bit means does i-th element present in this set.

提交回复
热议问题