Definition · applies to sets · also called $A \setminus B$, relative complement

High school

Consider1 two sets $A$ and $B$. The set difference $A \setdiff B$ is the set of elements of $A$ that are not in $B$.

Examples

Examples

Worked examples

Notes

Most texts write the set difference as $A \setminus B$, and some write it as $A - B$. Readers can choose either one in the notation settings.

Distinctions involving this term

  • Types of Difference: Many quantities compare two things by “how far apart” they are. A difference is the result of subtraction and can be negative. No distance is negative. An error compares an approximation with the truth, a change compares the end with the start, and a set difference removes elements.

All definitions · All distinctions · All examples · Notation