Propositional Logic

Propositional logic is the part of logic that studies statements that are either true or false, called propositions, and how connectives such as “not,” “and,” “or,” “if … then” and “if and only if” combine them. To use it, give each simple statement a letter, translate the connecting words into symbols, and find the truth value of the result.

Before this lesson: Conditional Statements and Inductive and Deductive Reasoning

What is a proposition?

A proposition is a declarative sentence that is either true (T) or false (F), but not both. “17 is a prime number” is a true proposition, and “2 + 2 = 5” is a false one. Questions, commands and sentences whose truth depends on an unknown, like “x + 3 = 7,” are not propositions.

We name simple propositions with lowercase letters such as p, q and r, called propositional variables. A compound proposition is built from simpler ones with connectives, and its truth value depends only on the truth values of its parts.

The logical connectives

ConnectiveSymbolRead asTrue exactly when
Negation\lnot pnot pp is false
Conjunctionp \land qp and qboth p and q are true
Disjunctionp \lor qp or qat least one of p, q is true
Exclusive orp \oplus qp or q, but not bothexactly one of p, q is true
Conditionalp \to qif p, then qp is false or q is true (false only when p is T and q is F)
Biconditionalp \leftrightarrow qp if and only if qp and q have the same truth value

The disjunction p ∨ q is inclusive: it is true when both parts are true. In everyday English “or” sometimes means “one or the other, but not both,” which is the exclusive or. The diagram shows the difference.

Three Venn diagrams of two overlapping circles labeled p and q inside a rectangle. In the first, only the overlap is shaded: p and q is true only when both are true. In the second, both whole circles are shaded: p or q is true when at least one is true. In the third, both circles are shaded except the overlap: p exclusive-or q is true when exactly one is true.
Conjunction, inclusive or and exclusive or. Each shaded region shows the cases where the compound statement is true.

The conditional p → q

In p → q, p is the hypothesis and q is the conclusion, as in conditional statements in geometry. The only way to break the promise “if p, then q” is for p to be true and q false. When p is false, p → q counts as true no matter what q is; this is called vacuously true.

Order of operations

Without parentheses, connectives are applied in this order: ¬ first, then ∧, then ∨, then →, then ↔. So ¬p ∨ q → r means ((¬p) ∨ q) → r. When in doubt, write the parentheses.

Translating English into symbols

English phraseSymbolsNote
not p; it is not the case that p\lnot p
p and q; p but q; p, although qp \land q“but” adds contrast, not a new connective
p or qp \lor qinclusive unless the context says “not both”
if p, then q; q if p; p implies qp \to qthe part after “if” is the hypothesis
p only if qp \to q“only if” points to the conclusion
p is sufficient for q; q is necessary for pp \to q
p unless q\lnot q \to pthe same as p \lor q
p if and only if q; p exactly when qp \leftrightarrow q

Propositional logic examples

Example 1: Which sentences are propositions?

SentenceProposition?Reason
“17 is a prime number.”Yes, trueA declarative sentence that is true
“2 + 2 = 5”Yes, falseA declarative sentence that is false
“Close the door.”NoA command has no truth value
“Is it raining?”NoA question has no truth value
“x + 3 = 7”NoTrue for x = 4 and false otherwise, so it depends on x

Answer: only the first two sentences are propositions. Sentences like “x + 3 = 7” become propositions once x is given a value, or once a quantifier such as “for all x” is added.

Example 2: Finding truth values

Let p be “6 is even,” q be “5 > 8” and r be “3 divides 12.” Find the truth values of (p ∧ ¬q) → r and ¬p ∨ (q ↔ r).

p = \text{T},\quad q = \text{F},\quad r = \text{T}

6 is even; 5 is not greater than 8; 12 = 3 · 4.

\lnot q = \text{T}

Negation flips F to T.

p \land \lnot q = \text{T} \land \text{T} = \text{T}

Both parts are true.

(p \land \lnot q) \to r = \text{T} \to \text{T} = \text{T}

True hypothesis and true conclusion.

\lnot p = \text{F}

Negation flips T to F.

q \leftrightarrow r = \text{F} \leftrightarrow \text{T} = \text{F}

The two parts have different truth values.

\lnot p \lor (q \leftrightarrow r) = \text{F} \lor \text{F} = \text{F}

Neither part is true.

Answer: (p ∧ ¬q) → r is true, and ¬p ∨ (q ↔ r) is false.

Example 3: Translating English into symbols

Let p be “it is raining,” q be “I take the bus” and r be “I am late.” Translate each sentence.

  1. It is raining, but I am not late.
  2. If it is raining, then I take the bus or I am late.
  3. I take the bus only if it is raining.
  4. I am late unless I take the bus.
p \land \lnot r

Sentence 1: “but” means “and”; “not late” is ¬r.

p \to (q \lor r)

Sentence 2: “if … then” with the disjunction as the conclusion.

q \to p

Sentence 3: “q only if p” makes p the conclusion.

\lnot q \to r

Sentence 4: “r unless q” means “if not q, then r.”

\lnot q \to r \equiv q \lor r

Sentence 4 can also be written as a disjunction.

Answer: p ∧ ¬r; p → (q ∨ r); q → p; ¬q → r (or q ∨ r). Sentence 3 is the one students most often reverse: taking the bus guarantees that it is raining, not the other way around.

Example 4: Using the order of operations

Add parentheses to show how p ∨ ¬q ∧ r → s is read. Then find its truth value when p, q and s are false and r is true.

p \lor ((\lnot q) \land r) \to s

Apply ¬ first, then ∧.

(p \lor ((\lnot q) \land r)) \to s

Then ∨, and → last.

\lnot q = \text{T}

q is false.

(\lnot q) \land r = \text{T} \land \text{T} = \text{T}

Both parts are true.

p \lor \text{T} = \text{F} \lor \text{T} = \text{T}

At least one part is true.

\text{T} \to s = \text{T} \to \text{F} = \text{F}

True hypothesis with a false conclusion.

Answer: (p ∨ ((¬q) ∧ r)) → s, which is false for these values.

Example 5: A course passing rule (word problem)

A syllabus says: “You pass the course if and only if you pass the final exam or score at least 90 on the project, and you miss no more than 5 classes.” Write the rule in symbols. Then decide whether a student passes who failed the final, scored 93 on the project and missed 3 classes.

f,\ g,\ m,\ c

Let f: passes the final; g: project score at least 90; m: misses more than 5 classes; c: passes the course.

c \leftrightarrow ((f \lor g) \land \lnot m)

“if and only if” gives ↔; “no more than 5” is ¬m.

f = \text{F},\quad g = \text{T},\quad m = \text{F}

Failed the final; 93 is at least 90; 3 is not more than 5.

f \lor g = \text{F} \lor \text{T} = \text{T}

One part is true.

\lnot m = \text{T}

m is false.

(f \lor g) \land \lnot m = \text{T} \land \text{T} = \text{T}

Both parts are true.

Answer: the rule is c ↔ ((f ∨ g) ∧ ¬m). The right side is true, and a biconditional is true only when both sides match, so c is true: the student passes.

Common mistakes

MistakeExample of the errorFix
Calling a question, command or open sentence a propositionSaying “x + 3 = 7” is falseA proposition must be true or false on its own; this one depends on x.
Reversing “only if”Writing p → q for “q only if p”“q only if p” is q → p.
Reading “unless” as “and not”Writing r ∧ ¬q for “I am late unless I take the bus”“r unless q” is ¬q → r, which is the same as q ∨ r.
Calling p → q false when p is falseSaying “If 5 > 8, then 1 = 2” is falseA false hypothesis makes the conditional vacuously true.
Ignoring the order of operationsReading ¬p ∧ q as ¬(p ∧ q)¬ applies only to the variable right after it unless there are parentheses.
Using inclusive or for “but not both”Writing s ∨ d for “soup or salad, but not both”Use the exclusive or, s ⊕ d.

Related ideas

Truth tables list the truth value of a compound proposition for every combination of its variables. They are the topic of the next lesson, Truth Tables. Propositional logic is also the starting point for proofs: a valid argument is a chain of deductive reasoning steps, like the reasons in two-column proofs.

Practice problems

  1. Is “The number 91 is prime” a proposition? If so, give its truth value.
  2. Is “x − 4 = 10” a proposition? Explain.
  3. Let p be true and q be false. Find the truth values of p ∨ q, p ∧ q and p → q.
  4. Let p be false, q be true and r be false. Find the truth value of (p → q) ∧ ¬r.
  5. With the same values as Problem 4, find the truth value of ¬(p ∨ r) ↔ q.
  6. Let s be “it snows” and c be “the game is canceled.” Translate “The game is canceled if it snows.”
  7. Let v be “you can vote” and r be “you are registered.” Translate “You can vote only if you are registered.”
  8. Let a be “the alarm sounds” and e be “the code is entered.” Translate “The alarm sounds unless the code is entered.”
  9. Add parentheses to show how ¬p ∧ q → r ∨ s is read.
  10. A meal comes with soup (s) or salad (d), but not both. Write this in symbols, and find its truth value for a customer who gets both.
Show answers

1.

91 = 7 \cdot 13

91 has the factors 7 and 13, so it is not prime.

Answer: yes, it is a proposition, and it is false

2.

x = 14 \Rightarrow \text{T},\quad x = 0 \Rightarrow \text{F}

Its truth value changes with x.

Answer: no; it is an open sentence until x has a value

3.

p \lor q = \text{T} \lor \text{F} = \text{T}

At least one part is true.

p \land q = \text{T} \land \text{F} = \text{F}

Not both parts are true.

p \to q = \text{T} \to \text{F} = \text{F}

True hypothesis, false conclusion.

Answer: T, F, F

4.

p \to q = \text{F} \to \text{T} = \text{T}

A false hypothesis makes the conditional true.

\lnot r = \text{T}

r is false.

(p \to q) \land \lnot r = \text{T} \land \text{T} = \text{T}

Both parts are true.

Answer: true

5.

p \lor r = \text{F} \lor \text{F} = \text{F}

Neither part is true.

\lnot(p \lor r) = \text{T}

Negate.

\text{T} \leftrightarrow q = \text{T} \leftrightarrow \text{T} = \text{T}

Both sides have the same truth value.

Answer: true

6.

s \to c

“c if s” makes s the hypothesis.

Answer: s → c

7.

v \to r

“v only if r” makes r the conclusion.

Answer: v → r

8.

\lnot e \to a

“a unless e” means “if not e, then a.”

Answer: ¬e → a, or equivalently e ∨ a

9.

((\lnot p) \land q) \to (r \lor s)

¬ first, then ∧ and ∨, and → last.

Answer: ((¬p) ∧ q) → (r ∨ s)

10.

s \oplus d

“but not both” calls for the exclusive or.

\text{T} \oplus \text{T} = \text{F}

Exclusive or is false when both parts are true.

Answer: s ⊕ d, which is false for a customer who gets both

Propositional logic FAQ

What is propositional logic?

It is the branch of logic that works with whole statements that are true or false and the connectives that join them. It is the first topic in most discrete math courses because it underlies proofs, circuits and computer programs.

What is a proposition in discrete math?

A proposition is a declarative sentence that is either true or false, but not both. “7 is odd” is a proposition; “x is odd” is not, because its truth depends on x.

What are the logical connectives?

The main connectives are negation (¬), conjunction (∧), disjunction (∨), the conditional (→) and the biconditional (↔). Many courses also use the exclusive or (⊕).

How do you translate “only if” into logic?

“p only if q” means p → q: whenever p is true, q must be true. The statement after “only if” is the conclusion, not the hypothesis.

Summary

  • A proposition is a sentence that is true or false, but not both.
  • The connectives ¬, ∧, ∨, ⊕, → and ↔ build compound propositions.
  • p → q is false only when p is true and q is false.
  • Without parentheses, apply ¬, then ∧, then ∨, then →, then ↔.
  • “p only if q” is p → q, and “p unless q” is ¬q → p.

Previous lesson: Laplace’s Equation (the last lesson of Differential Equations)

Next lesson: Truth Tables

Back to the Discrete Math Index