HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Statements, Connectives and Truth Tables
  1. 1Statements and their negations
  2. 2Connectives and truth tables
  3. 3Tautologies, equivalence and switching circuits
  1. Mathematics
  2. /Statements, Connectives and Truth Tables
  3. /Connectives and truth tables

Course 36.1·Lesson 2 of 3

Connectives and truth tables

The connective and gives p∧qp \wedge qp∧q, true only when both parts are true. The inclusive or gives p∨qp \vee qp∨q

Lesson 2 of 3Show all lessonsHide
Statements, Connectives and Truth Tables
  1. 1Statements and their negations
  2. 2Connectives and truth tables
  3. 3Tautologies, equivalence and switching circuits

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 ppp and qqq, the statement "ppp and qqq" is the conjunction. We write p∧qp \wedge qp∧q.

p∧qp \wedge qp∧q is true when both ppp and qqq are true, and false in every other case.

pppqqqp∧qp \wedge qp∧q
TTT
TFF
FTF
FFF

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 "ppp or qqq" is the disjunction. We write p∨qp \vee qp∨q.

p∨qp \vee qp∨q is false when both ppp and qqq are false, and true in every other case.

pppqqqp∨qp \vee qp∨q
TTT
TFT
FTT
FFF

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⊕qp \oplus qp⊕q or p⊻qp \veebar qp⊻q.

In mathematics "or" means the inclusive or, unless the question says otherwise. "x≤3x \le 3x≤3" means "x<3x < 3x<3 or x=3x = 3x=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=42 \times 2 = 42×2=4 rows. With three there are 23=82^3 = 823=8. With nnn simple statements there are 2n2^n2n 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 ppp, qqq and rrr 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)\sim(p \vee q)∼(p∨q) is true. Work out the inner part first, then negate it.

ppp, qqqp∨qp \vee qp∨q∼(p∨q)\sim(p \vee q)∼(p∨q)
T, TTF
T, FTF
F, TTF
F, FFT

So ∼(p∨q)\sim(p \vee q)∼(p∨q) is true only when both ppp and qqq are false. That is exactly when ∼p∧∼q\sim p \wedge \sim q∼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)p \wedge (q \vee r)p∧(q∨r). Work out q∨rq \vee rq∨r first, then join it to ppp with "and". Here is each row as a list, so it fits a small screen. Each row gives p,q,rp, q, rp,q,r, then q∨rq \vee rq∨r, then the whole statement.

  1. T, T, T: q∨rq \vee rq∨r is T, so the statement is T.
  2. T, T, F: T, so T.
  3. T, F, T: T, so T.
  4. T, F, F: F, so F.
  5. F, T, T: T, but ppp is F, so F.
  6. F, T, F: F.
  7. F, F, T: F.
  8. F, F, F: F.

The statement is true in 333 of the 888 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 888 rows in the usual order.

Read it first. Then run it. Does the last column match the eight rows in the lesson?

1. Change the statement to p or (q and r). In how many rows is it true now?

2. Write the exclusive or of p and q as p != q. Check that it is true in exactly half the rows.

Common mistakes

  • Reading every "or" as exclusive. In mathematics "or" is inclusive unless the question says "but not both".
  • Missing rows. Two statements need 444 rows and three need 888. Use the halving pattern so that no row is missed.
  • Negating the parts instead of the whole. ∼(p∨q)\sim(p \vee q)∼(p∨q) is not ∼p∨∼q\sim p \vee \sim q∼p∨∼q. Work out the bracket first.
  • Treating "but" as a new connective. In logic it is "and".

Remember these

  • p∧qp \wedge qp∧q is true only when both are true.
  • p∨qp \vee qp∨q is false only when both are false.
  • The exclusive or is true when exactly one part is true.
  • nnn simple statements give 2n2^n2n rows.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Give the truth value of "999 is a perfect square and 999 is a prime number".
  1. Give the truth value of "π\piπ is rational or 4\sqrt{4}4​ is rational".
  1. A truth table has 323232 rows. How many simple statements does it use?
  1. When is ∼p∧q\sim p \wedge q∼p∧q true?
  1. 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.
No payment. You can leave at any time.

Problems (3)

Let p be "17 is a prime number", let q be "every even number is divisible by 4" and let r be "the…Hard · High School (11–12) · by StemPy Lab
A lift in an office block moves only when its doors are shut…Hard · High School (11–12) · by StemPy Lab
A quiz has three judges. Let p, q and r say that judge 1, judge 2 and judge 3 votes yes…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 3Tautologies, equivalence and switching circuits
← Statements, Connectives and Truth Tables
← Statements and their negationsTautologies, equivalence and switching circuits →

Discussion (0)

Log in to join the discussion.

Loading…

, false only when both parts are false; the exclusive or is true when exactly one part is true. A truth table lists every combination of truth values,
2n2^n2n
rows for
nnn
simple statements, and works out the compound statement column by column.
about 25 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

A truth table makerPython Lab · by StemPy Lab