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
| Connective | Symbol | Read as | True exactly when |
|---|---|---|---|
| Negation | \lnot p | not p | p is false |
| Conjunction | p \land q | p and q | both p and q are true |
| Disjunction | p \lor q | p or q | at least one of p, q is true |
| Exclusive or | p \oplus q | p or q, but not both | exactly one of p, q is true |
| Conditional | p \to q | if p, then q | p is false or q is true (false only when p is T and q is F) |
| Biconditional | p \leftrightarrow q | p if and only if q | p 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.
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 phrase | Symbols | Note |
|---|---|---|
| not p; it is not the case that p | \lnot p | |
| p and q; p but q; p, although q | p \land q | “but” adds contrast, not a new connective |
| p or q | p \lor q | inclusive unless the context says “not both” |
| if p, then q; q if p; p implies q | p \to q | the part after “if” is the hypothesis |
| p only if q | p \to q | “only if” points to the conclusion |
| p is sufficient for q; q is necessary for p | p \to q | |
| p unless q | \lnot q \to p | the same as p \lor q |
| p if and only if q; p exactly when q | p \leftrightarrow q |
Propositional logic examples
Example 1: Which sentences are propositions?
| Sentence | Proposition? | Reason |
|---|---|---|
| “17 is a prime number.” | Yes, true | A declarative sentence that is true |
| “2 + 2 = 5” | Yes, false | A declarative sentence that is false |
| “Close the door.” | No | A command has no truth value |
| “Is it raining?” | No | A question has no truth value |
| “x + 3 = 7” | No | True 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.
- It is raining, but I am not late.
- If it is raining, then I take the bus or I am late.
- I take the bus only if it is raining.
- 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
| Mistake | Example of the error | Fix |
|---|---|---|
| Calling a question, command or open sentence a proposition | Saying “x + 3 = 7” is false | A 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 false | Saying “If 5 > 8, then 1 = 2” is false | A false hypothesis makes the conditional vacuously true. |
| Ignoring the order of operations | Reading ¬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
- Is “The number 91 is prime” a proposition? If so, give its truth value.
- Is “x − 4 = 10” a proposition? Explain.
- Let p be true and q be false. Find the truth values of p ∨ q, p ∧ q and p → q.
- Let p be false, q be true and r be false. Find the truth value of (p → q) ∧ ¬r.
- With the same values as Problem 4, find the truth value of ¬(p ∨ r) ↔ q.
- Let s be “it snows” and c be “the game is canceled.” Translate “The game is canceled if it snows.”
- Let v be “you can vote” and r be “you are registered.” Translate “You can vote only if you are registered.”
- Let a be “the alarm sounds” and e be “the code is entered.” Translate “The alarm sounds unless the code is entered.”
- Add parentheses to show how ¬p ∧ q → r ∨ s is read.
- 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