Logical Connectives and Truth Tables

Every case for and, or and not, in one table.

Four cases, and no more

A statement in mathematics is either true or false, never both and never neither. Write T for true and F for false. Two statements, P and Q, can then be true or false in four combinations: both true, P true and Q false, P false and Q true, or both false.

Take P to be “n is even” and Q to be “n > 10”, for a whole number n. All four cases happen. At n = 12, P and Q are both true. At n = 4, P is true and Q false. At n = 15, P is false and Q true. At n = 3, both are false. A truth table lists the four cases as four rows, and each new statement built from P and Q gets a column.

Each further statement doubles the count, since each existing case splits into one where the new statement is true and one where it is false. Three statements give 8 rows, not 6.

PQn = 12TTn = 4TFn = 15FTn = 3FF

The four cases for P: n is even, and Q: n > 10, each met by one value of n.

And: both must hold

The statement “P and Q” is true when P is true and Q is true, and false in every other case. Of the four rows it is true in one, the first. At n = 12, “n is even and n > 10” is true; at n = 4, n = 15 and n = 3 it is false, because at least one part fails.

Ueven> 10124153

The whole numbers, with one circle for the even ones and one for those above 10, and a sample number in each region. The four regions are the four rows of the table. “n is even and n > 10” holds only in the shaded overlap, where 12 is.

Or: at least one holds

The statement “P or Q” is true when at least one of P and Q is true. It is false in one row only, the last, where both are false. At n = 12, n = 4 and n = 15, “n is even or n > 10” is true; at n = 3 it is false.

In mathematics or is inclusive: “P or Q” is true when both hold, as at n = 12. Everyday speech often means the exclusive or, “one or the other but not both”, as in “tea or coffee”. That is a different connective, true in the two middle rows only. Where a problem means the exclusive one, it says so.

Ueven> 10124153

The same regions with both circles shaded: “n is even or n > 10” holds in three of the four regions, the overlap included. Only 3, outside both circles, fails it.

PQP and QP or Q1TTTT2TFFT3FTFT4FFFF

The truth table for and and or. And is true in row 1 only; or is false in row 4 only.

Not: one statement, flipped

“Not P” is built from a single statement, and it is true exactly when P is false. So the table for not has two rows: when P is T, not P is F, and when P is F, not P is T. For P: “n is even”, with n a whole number, not P is “n is odd”.

Applying not twice brings back the original: not (not P) is true exactly when P is.

Building a statement column by column

A longer statement is worked out one connective at a time, each in its own column. For “P and not Q”, first fill a column for not Q by flipping Q: F, T, F, T. Then combine it with P using and, which needs both: the result is true only in row 2, where P is T and not Q is T. With P: “n is even” and Q: “n > 10”, “n is even and not more than 10” is true at n = 4 and false at the other three.

Brackets decide which connective comes first. In the alarm application below, the rule (A and D) or P and the wired circuit A and (D or P) use the same letters and the same connectives, and differ in two of their eight rows.

PQnot QP and not Q1TTFF2TFTT3FTFF4FFTF

P and not Q, built in two columns: not Q flips Q, and the last column is true only in row 2, where P and not Q are both true.

If and if and only if

Two more connectives are defined by tables in the same way. The conditional “if P then Q”, written P ⇒ Q, is false in one row only: P true and Q false. In the other three rows it is true, including the two where P is false, since a promise that starts “if P” makes no claim when P fails.

The biconditional “P if and only if Q”, written P ⇔ Q, is true when P and Q have the same truth value, in rows 1 and 4, and false in rows 2 and 3.

PQif P then QP iff Q1TTTT2TFFF3FTTF4FFTT

The conditional is false only in row 2. The biconditional, P iff Q for short, is true in rows 1 and 4, where P and Q agree.

The usual mistakes

Reading or as exclusive. “P or Q” is true when both are true.

Calling “P and Q” true when only one part holds. At n = 4, n is even but not above 10, so “n is even and n > 10” is false.

Treating not as a connective between two statements. It acts on one statement; “not P” says nothing about Q.

Missing rows. Two statements give 4 rows and three give 8; a table with fewer leaves cases unchecked.

An insurance clause and an alarm

In the applications below, a travel insurance clause written with “or” and “unless” is turned into and, or and not and tested against four claims, and the refusal condition is counted over all eight combinations. Then a siren rule and the circuit an installer wired are compared row by row in an eight-row truth table.

Worked example: A Travel Insurance Refund Written with "Or" and "Unless"

Question A travel insurance policy says: "The cost of a canceled trip is refunded if the traveler is ill or the airline cancels the flight, unless the trip was booked less than 7 days before departure." The policy states that "or" includes the case where both happen, and that "refunded if X, unless Y" means refunded exactly when X is true and Y is false. (a) Claim 1: the traveler was ill, the airline did not cancel, and the trip was booked 30 days ahead. Claim 2: the traveler was well, the airline canceled, and the trip was booked 3 days ahead. Claim 3: the traveler was ill, the airline canceled, and the trip was booked 10 days ahead. Claim 4: the traveler was well, the airline did not cancel, and the trip was booked 60 days ahead. Which claims are refunded? (b) Write the condition for a claim to be refused without "not" in front of a bracket, and find in how many of the 8 possible combinations of the three facts a claim is refused.

  1. 1.Translate the clause. "Unless B" means the refund also needs B to be false, so a claim is refunded exactly when (I or A) and (not B). The "or" is true when either or both of I and A hold.

    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFF2FTT3TTF4FFF
    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFF2FTT3TTF4FFF
    Late means booked less than 7 days ahead. A refund needs (I or A) and not B.
  2. 2.Test each claim. Claim 1 has I true and was booked 30 days ahead, so it is refunded. Claim 2 was booked 3 days ahead, so B is true and it is refused, even though the airline canceled.

    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFFyes2FTTno3TTF4FFF
    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFFyes2FTTno3TTF4FFF
    Claim 1 is refunded. Claim 2 was booked 3 days ahead, so it is refused.
  3. 3.Claim 3 has I and A both true, so the inclusive "or" is true, and the trip was booked 10 days ahead, so it is refunded. Claim 4 has neither I nor A, so it is refused. (a) Claims 1 and 3 are refunded.

    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFFyes2FTTno3TTFyes4FFFno
    refund = (ill or airline) and not lateClaimillairlinelaterefund1TFFyes2FTTno3TTFyes4FFFno
    (a) Claims 1 and 3 are refunded. Claim 3 has both, and this "or" includes both.
  4. 4.A refusal is the negation of "(I or A) and (not B)". By De Morgan's laws the negation of an "and" is an "or" of the negations: not (I or A), or B. Then not (I or A) is (not I) and (not A). So a claim is refused when the traveler was well and the airline did not cancel, or the trip was booked less than 7 days ahead.

    refused = (not ill and not airline) or lateillairlinelaterefusedTTTTTFTFTTFFFTTFTFFFTFFF
    refused = (not ill and not airline) or lateillairlinelaterefusedTTTTTFTFTTFFFTTFTFFFTFFF
    Refused: ((not I) and (not A)) or B.
  5. 5.(b) Count the combinations. B is true in 4 of the 8, and each of those is refused. Of the 4 with B false, only the one with I and A both false is refused. That makes 4 + 1 = 5 refused combinations. Check: 3 combinations are refunded, and 3 + 5 = 8.

    refused = (not ill and not airline) or lateillairlinelaterefusedTTTyesTTFnoTFTyesTFFnoFTTyesFTFnoFFTyesFFFyes4 rows with late, and 1 more: 5 refused
    refused = (not ill and not airline) or lateillairlinelaterefusedTTTyesTTFnoTFTyesTFFnoFTTyesFTFnoFFTyesFFFyes4 rows with late, and 1 more: 5 refused
    (b) Refused in the 4 rows where B is true and in 1 more: 5 of the 8.

Answer: (a) Claims 1 and 3; (b) refused exactly when the traveler was well and the airline did not cancel, or the trip was booked less than 7 days ahead: 5 of the 8 combinations

Common mistakes

  • Refusing Claim 3 by reading "or" as "one or the other but not both". The policy says "or" includes the case where both happen, so an ill traveler whose flight was also canceled is covered.
  • Negating the clause as ((not I) or (not A)) and B. De Morgan's laws swap every "and" for "or" and every "or" for "and" as the negation passes through, so the refusal is ((not I) and (not A)) or B.

More mathematical statements problems, worked step by step →

Worked example: A Home Alarm's Siren Rule, and the Circuit an Installer Wired

Question A home alarm's siren should sound when the system is armed and a door is opened, or when the panic button is pressed, whether or not the system is armed. Let A be "the system is armed", D be "a door is opened" and P be "the panic button is pressed", so the rule is (A and D) or P. Number the rows of the truth table 1 to 8, with A, D, P taking the values TTT, TTF, TFT, TFF, FTT, FTF, FFT, FFF in that order. (a) In which rows should the siren sound? (b) The installer wires the circuit as A and (D or P). In which rows does the wired siren behave differently from the rule, and what is happening in the house in those rows?

  1. 1.In the rule, the bracket A and D is true only when both are true, which is rows 1 and 2. P is true in rows 1, 3, 5 and 7.

    rowADPrulewired1TTT2TTF3TFT4TFF5FTT6FTF7FFT8FFF
    rowADPrulewired1TTT2TTF3TFT4TFF5FTT6FTF7FFT8FFF
    A and D is true in rows 1 and 2. P is true in rows 1, 3, 5 and 7.
  2. 2."Or" is true when at least one side is true, so the rule is true in rows 1 and 2 from the bracket and in rows 3, 5 and 7 from P. Row 1 has both.

    rowADPrulewired1TTTT2TTFT3TFTT4TFFF5FTTT6FTFF7FFTT8FFFF
    rowADPrulewired1TTTT2TTFT3TFTT4TFFF5FTTT6FTFF7FFTT8FFFF
    "Or" is true when either side is true.
  3. 3.(a) The siren should sound in rows 1, 2, 3, 5 and 7, which is 5 of the 8 rows.

    rowADPrulewired1TTTT2TTFT3TFTT4TFFF5FTTT6FTFF7FFTT8FFFF
    rowADPrulewired1TTTT2TTFT3TFTT4TFFF5FTTT6FTFF7FFTT8FFFF
    (a) The siren should sound in rows 1, 2, 3, 5 and 7.
  4. 4.In the wired circuit the outer connective is "and", so it needs A true and is false in rows 5 to 8. In rows 1 to 4, D or P is true in rows 1, 2 and 3.

    rowADPrulewired1TTTTT2TTFTT3TFTTT4TFFFF5FTTTF6FTFFF7FFTTF8FFFFF
    rowADPrulewired1TTTTT2TTFTT3TFTTT4TFFFF5FTTTF6FTFFF7FFTTF8FFFFF
    The wired circuit needs A, so it is silent in rows 5 to 8.
  5. 5.(b) The two columns differ in rows 5 and 7. In both the system is disarmed and the panic button is pressed: the rule sounds the siren, but the wired circuit stays silent. Check: in rows 1 to 4 A is true, so both circuits reduce to D or P and agree there.

    rowADPrulewired1TTTTT2TTFTT3TFTTT4TFFFF5FTTTF6FTFFF7FFTTF8FFFFFRows 5 and 7: disarmed, panic pressed, wired siren silent
    rowADPrulewired1TTTTT2TTFTT3TFTTT4TFFFF5FTTTF6FTFFF7FFTTF8FFFFFRows 5 and 7: disarmed, panic pressed, wiredsiren silent
    (b) The columns differ in rows 5 and 7, where the panic button is pressed in a disarmed house.

Answer: (a) Rows 1, 2, 3, 5 and 7; (b) rows 5 and 7, where the system is disarmed and the panic button is pressed: the wired siren stays silent

Common mistakes

  • Reading "A and D or P" as if the brackets could go either way. The brackets decide which connective is applied first, and here they decide whether the panic button works in a disarmed house.
  • Taking the rows where P is true as the only siren rows. Row 2 also sounds the siren, because an armed system with an open door makes the bracket true even when the panic button is not pressed.

More mathematical statements problems, worked step by step →

Practice Logical Connectives and Truth Tables in the app