# Size of a union of two sets

We were ask to prove that $|A \cup B| = |A| + |B| - |A \cap B|‫‪$. It was easy to prove it using a Venn diagram, but I think we might be expected to do if more formally. Is there a formal way?

-
What does $|A|$ mean? Is $|\cdot|$ a measure? Or maybe the sets are finite? – Jeff Nov 14 '11 at 16:44

2
just observe that if you do $|A|+|B|$ you count twice the elements in $A\cap B$. – Valerio Capraro Nov 14 '11 at 16:48
Suppose that you want to give a dollar to everyone in $A\cup B$. If you give a dollar to everyone in $A$, and then give a dollar to everyone in $B, \dots$. – André Nicolas Nov 14 '11 at 17:21
I am fairly certain that this question appeared here perhaps infinitely many times before. I cannot find it though... – Asaf Karagila Nov 14 '11 at 18:22

## 1 Answer

$A\cup B = (A\setminus B) \cup (B\setminus A) \cup (A\cap B)$. These three sets are disjoint, so $$|A\cup B| = |A\setminus B| + |B\setminus A| + |(A\cap B)|$$ But $A\setminus B = A\setminus(A\cap B)$, so $|A\setminus B|=|A|-|A\cap B|$. A similar equality holds for $|B \setminus A|$. Substitution of these into the displayed equation above yields your result.

Of course, one might need to formally show that $|A\setminus (A\cap B)| = |A|-|A\cap B|$. I can't decide if this is any less obvious than the original proposition...

-

2
I have seen $A \setminus B$, $A \smallsetminus B$ and $A - B$ used to denote set difference, but not $A / B$. Do you normally use that notation? =) – Srivatsan Nov 14 '11 at 16:59

1
Is using a forward slash for set difference standard notation? – Henning Makholm Nov 14 '11 at 17:00

3
bleech... I'm left/right backslash challenged...I got points taken off for doing that on a topology test once. – David Mitra Nov 14 '11 at 17:00
@David Mitra: The forward slashes were bothersome, so I was changing things to setminus, and in the middle they changed to backslash. Not thinking, I continued. Can turn them to backslash if you wish. – André Nicolas Nov 14 '11 at 17:40
Thanks. \setminus is better of course. I'm not sure if \backslash is a mathop... – David Mitra Nov 14 '11 at 17:44
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 17, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9452771544456482, "perplexity_flag": "middle"}