基于集合论利用单集合与两两交集计算三集合并集及广告受众占比
Hey there! Let's tackle this set theory problem and its ad industry application clearly, step by step.
The core rule here is the principle of inclusion-exclusion for three sets. This formula lets us compute the total unique elements across all three sets when we have:
- The size of each individual set (denoted
|A|,|B|,|C|) - The size of every pairwise intersection (denoted
|A∩B|,|A∩C|,|B∩C|) - Important note: Strictly speaking, we also need the size of the three-way intersection (
|A∩B∩C|) to get the exact union value. If you don’t have that data, you can either assume it’s 0 (a simplification that may undercount slightly) or note the union will fall within a range.
The full inclusion-exclusion formula for three sets is:
|A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|
- The first part adds up all individual set sizes, but this counts overlapping elements multiple times
- We subtract pairwise intersections to fix the double-counting of those overlaps
- We add back the three-way intersection because it was subtracted too many times in the previous step
If you only have individual and pairwise data (no three-way intersection), you can:
- Assume
|A∩B∩C| = 0to get a lower bound of the union size - Or calculate the possible range (the union can’t be smaller than the largest individual set, and can’t exceed the sum of individual sets minus the smallest pairwise overlaps)
Let’s translate the set theory to your ad scenario directly:
- Let
T= percentage of people who saw TV ads - Let
R= percentage who saw Radio ads - Let
O= percentage who saw Online ads - Let
T∩R= percentage who saw both TV and Radio - Let
T∩O= percentage who saw both TV and Online - Let
R∩O= percentage who saw both Radio and Online - Let
T∩R∩O= percentage who saw all three ads (if you have this data)
Your goal is to find the percentage of people who saw at least one of the three ads—this is exactly |T ∪ R ∪ O|.
Example Calculation
Suppose you have these real-world metrics:
T = 35%(0.35)R = 25%(0.25)O = 40%(0.40)T∩R = 10%(0.10)T∩O = 15%(0.15)R∩O = 8%(0.08)T∩R∩O = 5%(0.05)
Plugging into the formula:
|T ∪ R ∪ O| = 0.35 + 0.25 + 0.40 - 0.10 - 0.15 - 0.08 + 0.05 = 1.00 - 0.33 + 0.05 = 0.72 → 72%
If you don’t have three-way intersection data, you can approximate by assuming it’s 0:
|T ∪ R ∪ O| ≈ 0.35 + 0.25 + 0.40 - 0.10 - 0.15 - 0.08 = 1.00 - 0.33 = 0.67 → 67%
Just keep in mind this will be an undercount, since some people did see all three ads and were subtracted too many times in this simplified calculation.
内容的提问来源于stack exchange,提问作者jay

