Courses / Computer Science I
Discrete Mathematics

Propositional Logic

Computer Science I 281 words Free to read

Propositional Logic Basics

A proposition is a statement that is definitely true or false, like "7 is prime" (true) or "3>53 > 5" (false). We build compound statements using connectives.

ConnectiveSymbolMeaningTrue WhenDirectX
Negation¬p\neg pnot pppp is false-
Conjunctionpqp \land qpp and qqboth true-
Disjunctionpqp \lor qpp or qqat least one-
Biconditionalpqp \leftrightarrow qpp iff qqpp and qq match-

A tautology is true under every assignment (p¬pp \lor \neg p). A contradiction is false under every assignment. Two propositions are logically equivalent if they share the exact same truth table.

Connectives as one switch driving five lamps at once

Mastering Implication

The implication pqp \to q ("if pp then qq") is false in only one case: when pp is true and qq is false.

When pp is false, the implication is vacuously true regardless of qq. For example, "if the moon is cheese, 2+2=52+2=5" is a true implication.

TermDefinition / RulePitfall
Implication (pqp \to q)False only if pp is true and qq is falseVacuously true when pp is false
Contrapositive (¬q¬p\neg q \to \neg p)Logically equivalent to pqp \to qDo not confuse with converse qpq \to p
Converse (qpq \to p)Not equivalent to pqp \to qClassic logical error to swap them

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

Discrete Mathematics