Courses / Computer Science I
Discrete Mathematics

Propositional Logic

Computer Science I 328 words Free to read

Reasoning with True and False

A proposition is a statement that is definitely true or false — "7 is prime" (true), "3>53 > 5" (false). Propositional logic builds compound statements from simple ones using connectives, and gives rules to determine their truth. This is the logic underlying both mathematical proof and the boolean circuits of the previous unit — the connectives are exactly the logic gates.

The connectives, with the same truth behavior as gates:

Implication deserves care: pqp \to q is false in exactly one case — when pp is true but qq is false. In particular, when pp is false, the implication is vacuously true regardless of qq ("if the moon is cheese, then 2+2=52+2=5" is a true implication). This trips up nearly everyone at first.

A tautology is a proposition true under every assignment (like p¬pp \lor \neg p); a contradiction is false under every assignment. Two propositions are logically equivalent if they have the same truth table — for example, pqp \to q is equivalent to ¬pq\neg p \lor q, and the contrapositive ¬q¬p\neg q \to \neg p is equivalent to pqp \to q (a fact heavily used in proofs).

Common pitfall: misreading implication. pqp \to q is not false when pp is false — it is vacuously true. The only way an implication fails is a true premise with a false conclusion (pp true, qq false). Also, pqp \to q is not the same as its converse qpq \to p; confusing the two is a classic logical error.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes
Start Computer Science I free

Discrete Mathematics