Search⌘ K
AI Features

DeMorgan’s First Law

Explore DeMorgan's first law that relates the complement of a union of sets to the intersection of their complements. Learn through examples and Python code how this principle works for two or more sets, reinforcing foundational set operation concepts.

DeMorgan’s laws involve the complement of the union of sets or the complement of the intersection of sets.

Complement of the union of sets

Let’s investigate the union of two arbitrary sets, AA and BB. If we want to compute the complement of this union, that is, (AB)\overline{ (A\cup B) }, its intuitive to explore if it can be computed by taking the union of A\overline A and B\overline B, that is, (AB)=?AB\overline{(A\cup B)} \overset{?}= \overline{A} \cup \overline{B}. We can delve into this further with the following example.

Let’s assume that U={0,1,2,3,4,5,6,7,8,9}\mathbb{U}=\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}, A={2,4,6}A=\{2, 4, 6\}, and B={1,3,5,7}B=\{1, 3, 5, 7\}. From this we can derive the following:

A={0,1,3,5,7,8,9}\overline{A} = \{0, 1, 3, 5, 7, 8, 9\}

B={0,2,4,6,8,9}\overline{B} = \{0, 2, 4, 6, 8, 9\}

AB={1,2,3,4,5,6,7}A\cup B = \{1, 2, 3, 4, 5, 6, 7\}

(AB)= ...