Prove that (A-B) union (B-A) = (A union B) - (A intersect B)
Analyze the prove that (a-b) union (b-a) = (a union b) - (a intersect b).
Examples
Input:"test_input_1"
Output:"output_1"
Input:"test_input_2"
Output:"output_2"
Hints
Recall that the set difference (X - Y) can be expressed using union and intersection as X ∩ Yᶜ, where Yᶜ is the complement of Y. How can this help rewrite the right-hand side of the equation?
Use the distributive property of set operations to expand (a ∪ b) - (a ∩ b) into [(a ∪ b) ∩ aᶜ] ∪ [(a ∪ b) ∩ bᶜ]. Simplify each term separately.
Prove that (a - b) ∪ (b - a) is equivalent to (a ∩ bᶜ) ∪ (b ∩ aᶜ) by definition, then show this matches the simplified form from Hint 2 using the associative and commutative properties of set operations.
Prove that (A-B) union (B-A) = (A union B) - (A intersect B)
Analyze the prove that (a-b) union (b-a) = (a union b) - (a intersect b).