This experiment tries to define and show the concepts of intersection and difference between two word clouds.
Two distinct documents A and B (the first about infovis and datavis, and the other about Human-Computer Interaction) are each used to compute word frequencies. Each word in common between the two documents is then used to create the intersection set, in which each word is assigned the minimum value among its original weights (something reminiscent of a fuzzy intersection operation). The remaining words are used to create the difference sets. For each word in common, the set which had the greatest weight also retains that word with a weight subtracted of the intersection weight mentioned above. In pseudocode:
for each word in common between A and B
let a_w be the weight of the word in A
let b_w be the weight of the word in B
put the word into the intersection set with weight = min(a_w, b_w)
if a_w - min(a_w, b_w) > 0
put the word into the A \ B set with weigh