The present invention is a device for and method of measuring similarity between sets using a union block, three function blocks, an adder, a subtractor, and a divider. The first set is fed into the first function block and the first input of the union block. The second set is fed into the second function block and the second input of the union block. The output of the union block is fed into the input of the third function block. The outputs of the first and second function block feed into the adder. The output of the adder and the output of the third function block feed into the subtractor. The output of the subtractor feeds into the input of the divider.