# Calculate the union of three sets based only on the values in each set and their pairwise intersections

I need to calculate the proportion of people that are exposed to an advertisement on either tv, radio, or online, based on a subset of proportions. I have the following data:

• the proportion of people exposed to a tv ad
• the proportion of people exposed to an online ad
• the proportion of people exposed to a tv ad AND an online ad

In other words, I'm trying to find the proportion of people exposed to any type of ad, based only on the proportion of people exposed to each type of ad, and the proportion of people exposed to each pairwise combination of ad types.

After a bit of googling this seems like a job for set theory. I found this equation:

$$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|.$$

Based on this equation, in order to get $|A \cup B \cup C|$ (the proportion of people seeing any of the three ad types) it seems like you need to know $|A \cap B \cap C|$ (proportion of people seeing to all three types of ad) in addition to $|A|$, $|B|$, and $|C|$ (proportion of people seeing each ad) and $|A \cap B|$, $|A \cap C|$ and $|B \cap C|$ (proportion of people seeing all pairwise combinations of ads).

But this doesn't make sense to me - if I draw a Venn diagram of two circles based on the values of $|A|$, $|B|$, and $|A \cup B|$, then it seems that there's only one way to draw a third circle that satisfies the values of $|C|$, $|A \cap B|$ and $|B \cap C|$. In other words, the values of $|A \cap B \cap C|$ and $|A \cup B \cup C|$ should depend entirely on the values of $|A|$, $|B|$, $|C|$, $|A \cap B|$, $|A \cap C|$ and $|B \cap C|$, and I should be able to calculate $|A \cup B \cap C|$ using only the data I have available.

My question: is my logic correct here? And if so, what equation should I use to calculate $|A \cup B \cup C|$ using the data I have available? Also, is there a more general equation or algorithm I can use to calculate the union of $>3$ sets, given only the proportions for each set separately and the proportions for all pairwise intersections?

• Instead of u and n, try to use MathJax. In your case you need only the dollar signs and \cup, \cap. See more here – user99914 Feb 2 '18 at 2:15
• changes made, thank you – jay Feb 2 '18 at 3:05

Suppose you know that $$|A|=|B|=|C|=2\ \text{ and }\ |A\cap B|=|A\cap C|=|B\cap C|=1;$$ from that, how big do you think $|A\cup B\cup C|$ is?
$$\text{Example 1.}\ \ A=\{1,2\},\ B=\{1,3\},\ C=\{2,3\}$$ $$\text{Example 2.}\ \ A=\{1,4\},\ B=\{2,4\},\ C=\{3,4\}$$ In Example 1, $|A\cap B\cap C|=0;$ in Example 2, $|A\cap B\cap C|=1.$
• Thanks for the answer. So you're saying that you do need | A $\cap$ B $\cap$ C | in addition to the data to calculate | A $\cup$ B $\cup$ C |. If that is the case, then what about my logic about Venn diagrams - i.e. if you draw circles whose overlap is given by the | A $\cap$ B |, | A $\cap$ C |, and | B $\cap$ C | proportions, then the ares given by | A $\cap$ B $\cap$ C | and | A $\cup$ B $\cup$ C | are constrained to take on a single value each? I could be wrong about this but when I draw it out it does seem to be true. – jay Feb 2 '18 at 2:56
• Start with the Venn diagram for $A$ and $B.$ You know how many items in $A,$ in $B,$ and in $A\cap B,$ so you know how many are in $A\setminus B$ and in $B\setminus A.$ So far so good. Now add $C$ to the picture. Now you have four quantities to figure out: how many in $C\cap A\cap B,$ how many in $C\cap(A\setminus B),$ how many in $C\cap(B\setminus A),$ and how many in $C\setminus(A\cup B).$ Do you think you can get those four variables in terms of the three variables $|C|,\ |A\cap C|,\ |B\cap C|$? – bof Feb 2 '18 at 3:06
• But for $3$ sets you only need circles. – bof Feb 2 '18 at 3:34