A∪B (the union, a cup) holds everything that is in A, in B, or in both. A∩B (the intersection, a cap) holds only what is in both. The large forms work like a sum sign: ⋃i=1nAi joins n sets.
In ML papers they show up in dataset splits (train and test should have Dtrain∩Dtest=∅), in metrics such as intersection over union, ∣A∪B∣∣A∩B∣, for boxes and masks, and in probability, where P(A∩B) is "A and B" and P(A∪B) is "A or B".
How to type it
LaTeX
Shows
\cup
∪
\cap
∩
\bigcup_{i=1}^{n} A_ilarge, with limits
⋃i=1nAi
\bigcap_{i=1}^{n} A_i
⋂i=1nAi
A worked example
{1,2,3}∪{3,4}={1,2,3,4},{1,2,3}∩{3,4}={3}
Intersection over union here is 1/4.
Common confusions
∪ and ∩ look like the logic signs ∨ and ∧ (Logical and, or, not) and mean the same thing for sets: "or" and "and".
∪ is not the letter U, and ∩ is not an upside-down U as a variable.