The connective and gives p∧q, true only when both parts are true. The inclusive or gives p∨q
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
give the truth value of a statement joined by "and" or "or";
tell the inclusive "or" from the exclusive "or";
build the truth table of a compound statement with two or three simple statements.
The word "and"
A notice says: "Entry needs a ticket and a photo card." You bring a ticket but no photo card. You cannot go in. Both parts must hold.
For statements p and q, the statement "p and q" is the conjunction. We write p∧q.
p∧q is true when both p and q are true, and false in every other case.
p
q
p∧q
T
T
T
T
F
F
F
T
F
F
F
F
Words such as "but", "although" and "yet" act like "and" in logic. "The road is long but it is safe" is true only when the road is long and the road is safe.
The word "or"
A form says: "Applicants must know French or German." A person who knows both may still apply. This is the inclusive or. It allows both parts to be true.
The statement "p or q" is the disjunction. We write p∨q.
p∨q is false when both p and q are false, and true in every other case.
p
q
p∨q
T
T
T
T
F
T
F
T
T
F
F
F
Now a menu says: "The meal comes with tea or coffee." You get one drink, not both. This is the exclusive or. It is true when exactly one part is true. Some books write it p⊕q or p⊻q.
In mathematics "or" means the inclusive or, unless the question says otherwise. "x≤3" means "x<3 or x=3", and only one of them can hold. Read the context, but use the inclusive or when in doubt.
How many rows?
Each simple statement is T or F. With two statements there are 2×2=4 rows. With three there are 23=8. With n simple statements there are 2n rows.
The usual order: the first statement takes T in the top half and F in the bottom half. The next one halves each block again, and so on. The picture shows the eight rows for p, q and r as branches.
A tree that branches three times from a starting point. The first branching gives p true and p false, the second gives q true and q false under each, and the third gives r true and r false under each. The eight ends are labelled with the rows T T T, T T F, T F T, T F F, F T T, F T F, F F T and F F F, from top to bottom.
Building a truth table step by step
Let us find when ∼(p∨q) is true. Work out the inner part first, then negate it.
p, q
p∨q
∼(p∨q)
T, T
T
F
T, F
T
F
F, T
T
F
F, F
F
T
So ∼(p∨q) is true only when both p and q are false. That is exactly when ∼p∧∼q is true. Two statements that agree in every row say the same thing. The next lesson calls them equivalent.
A table with three statements
Take p∧(q∨r). Work out q∨r first, then join it to p with "and". Here is each row as a list, so it fits a small screen. Each row gives p,q,r, then q∨r, then the whole statement.
T, T, T: q∨r is T, so the statement is T.
T, T, F: T, so T.
T, F, T: T, so T.
T, F, F: F, so F.
F, T, T: T, but p is F, so F.
F, T, F: F.
F, F, T: F.
F, F, F: F.
The statement is true in 3 of the 8 rows.
Practise with new numbers
Try it in Python
The program prints the truth table of any statement you write as a Python function of p, q and r. It uses itertools.product to make the 8 rows in the usual order.
Common mistakes
Reading every "or" as exclusive. In mathematics "or" is inclusive unless the question says "but not both".
Missing rows. Two statements need 4 rows and three need 8. Use the halving pattern so that no row is missed.
Negating the parts instead of the whole.∼(p∨q) is not ∼p∨∼q. Work out the bracket first.
Treating "but" as a new connective. In logic it is "and".
Remember these
p∧q is true only when both are true.
p∨q is false only when both are false.
The exclusive or is true when exactly one part is true.
n simple statements give 2n rows.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Give the truth value of "9 is a perfect square and 9 is a prime number".
Give the truth value of "π is rational or 4 is rational".
A truth table has 32 rows. How many simple statements does it use?
When is ∼p∧q true?
A ticket "is valid on Saturday or on Sunday, but not on both days". Which "or" is this, and when is the sentence false?
References
NCERT, Mathematics Textbook for Class XI (edition before 2023), Chapter 14, sections 14.3 and 14.4.
OpenStax, Contemporary Mathematics, Chapter 2, sections on compound statements and truth tables.
Enroll free in Statements, Connectives and Truth Tables
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.