Math glossary

De Morgan’s Laws: Set Rules, Truth Tables, and Examples

Use De Morgan’s laws to negate AND and OR, find set complements, and solve probability problems. See Venn diagrams and six worked examples.

TL;DR

De Morgan's laws turn a negated AND into OR, and a negated OR into AND. Negate both parts. In set notation, complement each set and switch intersection with union.

Key Points

  • The complement of a union is the intersection of the complements.
  • The complement of an intersection is the union of the complements.
  • In logic, mathematical OR includes the possibility that both parts are true.
  • Draw complements relative to the same universal set.
  • In probability, “at least one” and “none” describe complementary events.

What are De Morgan's laws for sets and statements?

The two laws tell you how to move a complement inside parentheses. All set complements below are taken relative to the same universal set UU. Use AcA^c for the elements of UU outside AA.

Meaning Set law Logical law
Neither condition holds (A∪B)c=Ac∩Bc(A\cup B)^c=A^c\cap B^c ¬(P∨Q)=(¬P)∧(¬Q)\neg(P\lor Q)=(\neg P)\land(\neg Q)
The conditions do not both hold (A∩B)c=Ac∪Bc(A\cap B)^c=A^c\cup B^c ¬(P∧Q)=(¬P)∨(¬Q)\neg(P\land Q)=(\neg P)\lor(\neg Q)

The notation ∪\cup means union, or membership in either set, including the overlap. The symbol ∩\cap means intersection, or membership in both sets. The symbols ∨\lor, ∧\land, and ¬\neg mean OR, AND, and NOT for statements. The same relationships work because statements about an element’s membership are true or false.

How does a Venn diagram prove the laws?

Use a rectangle for UU and two overlapping circles for AA and BB. The diagram has four regions. A point is outside both circles, in AA alone, in BB alone, or in both.

  • Complement of the union: The union includes both circles. Its complement is the region outside both. It belongs to AcA^c and BcB^c at the same time.
  • Complement of the intersection: The intersection is only the overlap. Its complement includes the other three regions. Every point in these regions is outside at least one circle.
Two Venn diagrams shade the region outside both circles on the left and all but the overlap on the right
“Neither” leaves only the outside region. “Not both” leaves the outside and the two single-set regions.

For an algebraic membership proof, take any x∈Ux\in U. Membership in (A∪B)c(A\cup B)^c means xx belongs to neither AA nor BB. It therefore belongs to both AcA^c and BcB^c. Every step can be reversed. For the other law, membership in (A∩B)c(A\cap B)^c means at least one of x∉Ax\notin A and x∉Bx\notin B holds. This is membership in Ac∪BcA^c\cup B^c. University College London presents the same rule using membership in sets.

How do truth tables verify both laws?

Each row gives one possible pair of truth values. For each law, compare the two columns for its left and right sides. OpenStax’s logic treatment uses this test to establish equivalence.

PP QQ ¬(P∨Q)\neg(P\lor Q) (¬P)∧(¬Q)(\neg P)\land(\neg Q) ¬(P∧Q)\neg(P\land Q) (¬P)∨(¬Q)(\neg P)\lor(\neg Q)
True True False False False False
True False False False True True
False True False False True True
False False True True True True

Check the middle rows when choosing between “neither” and “not both.” If only PP is true, then “neither” is false but “not both” is true.

How do you use the laws in probability and with more sets?

For events, the universal set is the sample space. If AiA_i means the iith event occurs, the event that none occurs is

(⋃i=1nAi)c=⋂i=1nAic.\left(\bigcup_{i=1}^n A_i\right)^c=\bigcap_{i=1}^n A_i^c.

The event that at least one fails is the complementary version for intersections.

(⋂i=1nAi)c=⋃i=1nAic.\left(\bigcap_{i=1}^n A_i\right)^c=\bigcup_{i=1}^n A_i^c.

The equations hold regardless of independence. If the events are independent, their complements are independent too, so the probability that none occurs is the product of their complementary probabilities. OpenStax extends the laws to three sets, and MIT's probability notes review the same event operations.

Worked Examples of De Morgan's Laws

Example 1

Let U={1,2,3,4,5,6,7,8}U=\{1,2,3,4,5,6,7,8\}, A={2,4,6,8}A=\{2,4,6,8\}, and B={6,7,8}B=\{6,7,8\}. Find (A∪B)c(A\cup B)^c.

  1. The union is {2,4,6,7,8}\{2,4,6,7,8\}.
  2. The elements outside that union are {1,3,5}\{1,3,5\}.
  3. The same result follows from intersecting {1,3,5,7}\{1,3,5,7\} with {1,2,3,4,5}\{1,2,3,4,5\}.

Example 2

With the same UU, AA, and BB, find (A∩B)c(A\cap B)^c.

  1. The intersection is {6,8}\{6,8\}.
  2. Its complement is {1,2,3,4,5,7}\{1,2,3,4,5,7\}.
  3. The answer includes 2, which belongs to AA alone and is therefore outside BB.

Example 3

Negate “The school office is open AND the receptionist is at the desk.”

  1. Let PP be the first statement and QQ the second.
  2. Replace AND with OR and negate the two parts.
  3. The negation is “The office is closed OR the receptionist is away from the desk,” with both possibilities allowed.

Example 4

A form asks applicants to select email or text updates, with both options permitted. Describe an applicant who selected neither update type.

  1. Let PP mean email was selected and QQ mean text was selected.
  2. “Neither” is ¬(P∨Q)\neg(P\lor Q).
  3. The applicant did not select email and did not select texts. Leaving just one box unchecked would allow the other option.

Example 5

Two fair dice are rolled. Find the probability of rolling at least one six.

  1. Let AA and BB be the events of a six on the first and second die.
  2. A roll without any six lies in Ac∩BcA^c\cap B^c. Its probability is (5/6)(5/6)=25/36(5/6)(5/6)=25/36, using independence.
  3. The probability of at least one six is 1−25/36=11/361-25/36=11/36. The playing-card probability guide compares a sample-space approach for a single draw.

Example 6

Simplify ¬((P∨Q)∧R)\neg((P\lor Q)\land R).

  1. Negate the outside AND to get ¬(P∨Q)∨¬R\neg(P\lor Q)\lor\neg R.
  2. Apply the other law to the remaining negated OR.
  3. The result is ((¬P)∧(¬Q))∨(¬R)((\neg P)\land(\neg Q))\lor(\neg R).

Mistakes That Change the Result

Mistake 1: Negating the operands and retaining the operator

For a negated union you need an intersection of the complements. Test an element that belongs to only one of the original sets to see the difference.

Mistake 2: Taking a complement without a universal set

If A={2,4}A=\{2,4\}, the complement in {1,2,3,4}\{1,2,3,4\} is {1,3}\{1,3\}. In {1,2,3,4,5}\{1,2,3,4,5\} it is {1,3,5}\{1,3,5\}. State the universe before listing the complement.

Mistake 3: Assuming all probabilities multiply

De Morgan's law identifies the complement without probability assumptions. A product of marginal probabilities needs independence. With a shared condition or sampling without replacement, calculate the joint event using appropriate conditional probabilities.

Try It Yourself

  1. Negate “The library has the book OR has the audiobook.”
  2. Out of 30 students, 17 play chess, 12 play a sport, and 7 do both. How many do neither?
  3. Simplify (X∩Y∩Z)c(X\cap Y\cap Z)^c.

Answers and Reasoning

  1. The library has neither the book nor the audiobook. Both parts must be false.
  2. The union contains 17+12−7=2217+12-7=22 students. Its complement has 30−22=830-22=8 students.
  3. The result is Xc∪Yc∪ZcX^c\cup Y^c\cup Z^c. Any element outside at least one set is outside the intersection.

Questions About De Morgan's Laws

Are the laws valid if one set is empty?

Yes. If B=∅B=\varnothing, then Bc=UB^c=U. For the first law, (A∪∅)c=Ac(A\cup\varnothing)^c=A^c, the same result as Ac∩UA^c\cap U. For the second law, (A∩∅)c=U(A\cap\varnothing)^c=U, the same result as Ac∪UA^c\cup U.

How do the laws relate to the phrase “unless”?

Translate the whole statement into AND, OR, and NOT before moving a negation. In the standard inclusive reading, “PP unless QQ” is ¬Q⇒P\neg Q\Rightarrow P, which is equivalent to P∨QP\lor Q. Its negation is ¬P∧¬Q\neg P\land\neg Q.

Conclusion

  • Negate each part and switch AND with OR, or switch intersection with union.
  • Keep the universal set fixed.
  • For a probability problem, use the laws to identify the event before calculating its probability.

Read More

Research Behind This Article

  1. OpenStax, Contemporary Mathematics — Set Operations with Three Sets. OpenStax
  2. University College London, Algebra 1 — De Morgan’s Laws. UCL
  3. OpenStax, Contemporary Mathematics — De Morgan’s Laws. OpenStax
  4. Massachusetts Institute of Technology, Introduction to Probability — Mathematical Background. MIT OpenCourseWare