Union \bigcup, intersection \bigcap

The union \bigcup is the repeated application of the set union operation \cup. A set is just a "collection of unique things", so no duplicates. Most programming languages have some kind of set type included. The union of two sets is a new set that contains all entries of both sets. You can think of \cup as a cup that gathers things falling into it.

The intersection \bigcap is the repeated application of the set intersection operation \cap. The intersection of two sets is a new set containing only those elements that are found in both sets. Elements only in one of the sets are not included.

Basic forms: i=0nfi\bigcup\limits_{i=0}^n f_i or i=0nfi\bigcup_{i=0}^n f_i and i=0nfi\bigcap\limits_{i=0}^n f_i or i=0nfi\bigcap_{i=0}^n f_i

Parts: See the section about Sum or Product

Meaning: Apply a union or intersection with each term fif_i, starting at i=0i=0 and ending at i=ni=n. If the upper stop value is lower than the initial value, then the union is the empty set \emptyset, e.g. i=10=\bigcup\limits_{i=1}^0 = \emptyset. The intersection is a bit more tricky and you probably won't encounter this issue when implementing an algorithm. The result of the empty intersection is the set of all possible elements. So, if we call that set AA (for "all", sometimes also Ω\Omega ("Omega")), then we have i=10=A\bigcap\limits_{i=1}^0 = A.

For the union \bigcup this results in:

For the intersection \bigcap this results in: