Sets & logic · Lesson 1 of 1

Sets and logic

Complements, unions and intersections on a Venn diagram, De Morgan's laws, counting with two sets, sets defined by inequalities, and writing statements in logical symbols.

16 minYou should already know: Sets & Venn diagrams Logic
  1. 1

This lesson builds on sets and logic.

Complements and De Morgan’s laws

The complement A′A' is everything in the universal set UU that is not in AA. Two rules link complements with unions and intersections:

UAB
(A ∪ B)′ = A′ ∩ B′outside the union: in neither set
UAB
(A ∩ B)′ = A′ ∪ B′not in both: outside at least one
De Morgan's lawsPick a law
UAB1, 23, 45, 67, 8UAB1, 23, 45, 67, 8
{7, 8}(A ∪ B)′{7, 8}A′ ∩ B′
U = {1, …, 8}, A = {1, 2, 3, 4}, B = {3, 4, 5, 6}. (A ∪ B)′ and A′ ∩ B′ both shade the same region, {7, 8}. Outside the union means outside A and outside B.

Worked example · NECO 2023

NECO 2023 · Paper 2 · Q1

Let U={e,f,g,h,i}U = \{e, f, g, h, i\} be a universal set, and X={e,g}X = \{e, g\} and Y={g,h}Y = \{g, h\} subsets of UU.

Draw a Venn diagram to represent the information.

Use the Venn diagram to find (i) X′X'; (ii) (X∪Y)′(X \cup Y)'; (iii) X′∩Y′X' \cap Y'.

  1. The Venn diagram

    • gg is in both; ee is in XX only; hh is in YY only; ff and ii are outside both.

    Think first. Which element is in both X and Y?

  2. The three sets

    • X′={f,h,i}{X' = \{f, h, i\}}.
    • X∪Y={e,g,h}{X \cup Y = \{e, g, h\}}, so (X∪Y)′={f,i}{(X \cup Y)' = \{f, i\}}.
    • Y′={e,f,i}{Y' = \{e, f, i\}}, so X′∩Y′={f,i}{X' \cap Y' = \{f, i\}}: the same set, as De Morgan’s law says.

More: unions, intersections and complements

Counting with two sets

Members of both sets are counted twice in n(A)+n(B)n(A) + n(B), so

n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B)

Worked example · NECO 2023

NECO 2023 · Paper 2 · Q10 (b)

In a junior secondary school, 60 students play table tennis or basketball. The number who play table tennis is 7 more than three times the number who play basketball. If 3 students play both games and every student plays at least one game, how many students play table tennis?

  1. Two equations

    • T+B−3=60{T + B - 3 = 60}, so T+B=63{T + B = 63}.
    • Also T=3B+7{T = 3B + 7}.

    Think first. The 3 who play both are counted in T and in B.

  2. Solve

    • 3B+7+B=63{3B + 7 + B = 63}, so 4B=56{4B = 56} and B=14{B = 14}.
    • T=3(14)+7=49{T = 3(14) + 7 = 49} students play table tennis.

More: counting with two sets

Sets defined by inequalities

A set such as {x:2x2−x−10≤0}\{x : 2x^2 - x - 10 \le 0\} is a range of numbers. Solve each inequality (see quadratic inequalities), draw both ranges on one number line, then read off the union or intersection.

Worked example · WAEC 2016

WAEC 2016 · Paper 2 · Q3

Given that P={x:x∈R, 2x2−x−10≤0}P = \{x : x \in \mathbb{R},\ 2x^2 - x - 10 \le 0\} and Q={x:x∈R, 4x2−1≥0}Q = \{x : x \in \mathbb{R},\ 4x^2 - 1 \ge 0\}, find P∩QP \cap Q.

  1. The set P

    • 2x2−x−10=(x+2)(2x−5){2x^2 - x - 10 = (x + 2)(2x - 5)}, with roots −2{-2} and 52{\frac52}.
    • ≤0{\le 0} is between the roots: −2≤x≤52{-2 \le x \le \frac52}.

    Think first. Factorise: roots, then between or outside?

  2. The set Q

    • 4x2−1=(2x−1)(2x+1){4x^2 - 1 = (2x - 1)(2x + 1)}, with roots ±12{\pm\frac12}.
    • ≥0{\ge 0} is outside the roots: x≤−12{x \le -\frac12} or x≥12{x \ge \frac12}.
  3. The intersection

    • P∩Q={x:−2≤x≤−12}∪{x:12≤x≤52}{P \cap Q = \{x : -2 \le x \le -\frac12\} \cup \{x : \frac12 \le x \le \frac52\}}.

    Think first. Which parts of P are also in Q?

More: sets defined by inequalities

Statements in symbols

∼p\sim p means “not pp”, p∧qp \wedge q means ”pp and qq”, and p∨qp \vee q means ”pp or qq”. “Neither pp nor qq” means “not pp and not qq”.

pqp ∧ q
TTT
TFF
FTF
FFF
p ∧ qTrue only when both are true
pqp ∨ q
TTT
TFT
FTT
FFF
p ∨ qFalse only when both are false

p⇒qp \Rightarrow q means “if pp, then qq”, and p⇔qp \Leftrightarrow q means ”pp if and only if qq”. Both, and how to pick a valid conclusion, are taught in logic.

pqp ⇒ q
TTT
TFF
FTT
FFT
p ⇒ qFalse only when p is true and q is false
pqp ⇔ q
TTT
TFF
FTF
FFT
p ⇔ qTrue when p and q match

More: statements, implications and conclusions

Your turn

NECO 2023 · Paper 1 · Q20

Let pp denote “The cost of living is high” and qq denote “The standard of living is low”. Which of the following describes “Neither the cost of living is high nor the standard of living is low”?

Worked solution (try it first)
  1. "Neither pp nor qq" means "not pp and not qq".
  2. "Not" is ∼\sim and "and" is ∧\wedge, so the statement is ∼p∧∼q\sim p \wedge \sim q, option C.

Report a problem with this question