I have two sets $A = \{1 \leq x \leq 5\}$ and $B = \{5 \leq x \leq 8\}$. Now I want to find the Union
and Intersection
of $A$ and $B$.
I tried Union[A, B]
, I got {1 <= x <= 5, 5 <= x <= 8}
and for Intersection[A, B]
, I got {}
. The correct answer for $A \cup B$ is [1, 8]
and $A \cap B$ is {5}
. How do I tell Mathematica to do that?
And if $A = \{1 < x < 5\}$ and $B = \{x > 5\}$. Now I want to find the Union
and Intersection
of $A$ and $B$. How do I tell Mathematica to do that?
Interval
. $\endgroup$