• Practice
  • About 19 min
  • 5 practice questions

Statements, logical connectives and truth tables

Recognise statements, combine them with not, and, or, if-then, if and only if, and exclusive or, build truth tables, and write the converse, inverse and contrapositive of a conditional.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Decide whether a sentence is a statement (proposition) and give its truth value.
  • Tell simple statements from compound statements.
  • Use ¬, ∧, ∨, →, ↔ and ⊻ and write their truth tables.
  • Find the number of rows of a truth table and write the converse, inverse and contrapositive of p → q.

Mathematical logic studies valid reasoning using symbols. Its history runs from Aristotle's first book on logic, through Leibniz's idea of using symbols, to George Boole (1815–1864) and Augustus De Morgan, who joined logic and algebra in the 19th century. Because the two truth values can be written 1 and 0, logic is also the mathematics of electronic circuits and of checking that computer programs are correct.

Statements and truth values

A statement (or proposition) is a declarative sentence that is either true or false, but not both. Its truth value is T (or 1) if it is true and F (or 0) if it is false. Commands, requests, questions, exclamations and wishes are not statements. An open sentence, whose truth depends on something not fixed in it, such as "x + 4 = 9" (true only when x = 5) or "He is a good singer" (a matter of opinion and of who "he" is), is not a statement until that is fixed.

SentenceStatement?Reason
The sum of the angles of a triangle is 180°.Yes, TDeclarative and true
7 + 5 = 13Yes, FDeclarative and false
Please shut the window.NoA request
Is 91 a prime number?NoA question
What a beautiful sunset!NoAn exclamation
x + 4 = 9No (open)Truth depends on x

Simple and compound statements

A statement that cannot be split into smaller statements is simple (atomic). A combination of two or more simple statements is compound (molecular). "9 is a perfect square and 10 is odd" is compound, made of p: 9 is a perfect square, and q: 10 is odd. Simple statements are represented by statement variables p, q, r, … that take the values T or F. Words that join statements, namely "not", "and", "or", "if … then", "if and only if", are logical connectives, and an expression built from statements and connectives is a statement formula. A truth table lists the truth value of a formula for every combination of truth values of its variables.

The basic connectives

  • Negation ¬p (not p): true exactly when p is false.
  • Conjunction p ∧ q (p and q): true only when both p and q are true.
  • Disjunction p ∨ q (p or q): false only when both are false.
  • Conditional p → q (if p then q): p is the hypothesis (antecedent), q the conclusion (consequent). It is false only when p is true and q is false. The meanings of p and q need not be related: "If 2 + 2 = 5 then the Moon is a star" is true, because the hypothesis is false.
  • Biconditional p ↔ q (p if and only if q): true exactly when p and q have the same truth value.
  • Exclusive or p ⊻ q (p or q but not both): true exactly when p and q have different truth values.
All the connectives in one truth table
pq¬pp ∧ qp ∨ qp → qp ↔ qp ⊻ q
TTFTTTTF
TFFFTFFT
FTTFTTFT
FFTFFTTF

A formula with one variable needs 2 rows, with two variables 2² = 4 rows, and in general with n variables 2ⁿ rows. So a formula in p, q, r needs 8 rows and one in five variables needs 32.

Worked example 1: from words to symbols and back

Let p: "It is hot" and q: "It is humid". Then ¬p: It is not hot. p ∧ q: It is hot and humid. p ∨ ¬q: It is hot or it is not humid. q → p: If it is humid, then it is hot. Going the other way, "It is neither hot nor humid" is ¬p ∧ ¬q.

Converse, inverse and contrapositive

From p → q we form three more conditionals: the converse q → p, the inverse ¬p → ¬q and the contrapositive ¬q → ¬p. Example: for "If a number is a multiple of 4, then it is even", the converse is "If a number is even, then it is a multiple of 4" (false: 6), the inverse is "If a number is not a multiple of 4, then it is not even" (false: 6 again), and the contrapositive is "If a number is not even, then it is not a multiple of 4" (true, like the original). Lesson 5 shows that a conditional and its contrapositive always agree.

The four related conditionals

  • Conditional p → q
  • Converse q → p
    • Swap hypothesis and conclusion
  • Inverse ¬p → ¬q
    • Negate both
  • Contrapositive ¬q → ¬p
    • Swap and negate
    • Always has the same truth value as p → q

Worked example 2: a truth table with three columns of working

Construct the truth table of (p ∨ q) ∧ ¬(p ∧ q). Working, row by row (p, q): TT gives p ∨ q = T, p ∧ q = T, ¬(p ∧ q) = F, result F. TF gives T, F, T, result T. FT gives T, F, T, result T. FF gives F, F, T, result F. The final column F, T, T, F is the same as that of p ⊻ q, which makes sense: "p or q, but not both".

Key takeaways: a statement is a declarative sentence that is definitely true or false. Negation flips the value; ∧ needs both true; ∨ needs at least one; p → q fails only for T → F; ↔ needs equal values; ⊻ needs different values. A truth table for n variables has 2ⁿ rows. The contrapositive ¬q → ¬p, not the converse, says the same as p → q.

Check your understanding

  1. 1. Which of these is a statement?

    1. Close the door.
    2. Is 7 a prime number?
    3. The sum of the angles of a triangle is 180°.
    4. What a lovely day!
    Show answer

    Answer: C. It is a declarative sentence with a definite truth value (true). The others are a command, a question and an exclamation, which are not statements.

  2. 2. How many rows does the truth table of a statement formula in p, q, r and s have?

    1. 8
    2. 16
    3. 4
    4. 32
    Show answer

    Answer: B. With n variables there are 2ⁿ combinations of truth values; here n = 4, so 2⁴ = 16 rows.

  3. 3. When is the conditional p → q false?

    1. When p is false and q is true
    2. When both are false
    3. When both are true
    4. When p is true and q is false
    Show answer

    Answer: D. p → q is false only when the hypothesis p is true and the conclusion q is false. In every other case it is true.

  4. 4. What is the contrapositive of "If it rains, then the ground is wet"?

    1. If the ground is wet, then it rains.
    2. If it does not rain, then the ground is not wet.
    3. If the ground is not wet, then it does not rain.
    4. It rains and the ground is not wet.
    Show answer

    Answer: C. The contrapositive of p → q is ¬q → ¬p: negate both parts and swap them. "If the ground is wet, then it rains" is the converse, and "If it does not rain, then the ground is not wet" is the inverse.

  5. 5. p: 2 + 3 = 5 and q: 4 is an odd number. Which compound statement is true?

    1. p ∧ q
    2. p ↔ q
    3. p ⊻ q
    4. ¬p ∨ q
    Show answer

    Answer: C. p is true and q is false. p ⊻ q is true because exactly one of them is true. p ∧ q is false, p ↔ q is false (different values), and ¬p ∨ q is F ∨ F = F.

Privacy · Terms · Refunds · Delivery