📘 CodingMarble Learn

Propositions and Conditions: The Logic Behind Maths

A proposition is a sentence that is either true or false. We join propositions with NOT, AND, OR, IF…THEN and IF AND ONLY IF. 'If p then q' is false only when p is true and q is false. Its contrapositive 'if not q then not p' always has the same truth value. When p ⇒ q, p is sufficient for q and q is necessary for p. A predicate like 'x > 3' becomes a proposition when we fix x or add 'for all' / 'there exists'.

🎬 Step-by-step story

  1. A proposition is a sentence that is surely true or surely false. Questions and orders are not propositions.
  2. Small words join propositions. NOT flips the value. AND needs both true. OR needs at least one true.
  3. "If p then q" breaks only when p is true and q is false. In every other row it is true.
  4. The contrapositive "if not q then not p" always agrees with the original. The converse may not.
  5. Sets make it easy: all squares sit inside rectangles. Square is sufficient; rectangle is necessary.
  6. Your turn: switch p and q, pick a connective, and watch the lamp.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why is 'x > 3' not a proposition?

Its truth depends on x. It is a predicate. Fix x, or add 'for all' / 'there exists', and it becomes a proposition.

Why is 'OR' true when both are true?

In maths, OR is inclusive: at least one true is enough, so both true also counts.

How can p ⇒ q be true if p is false?

The promise only talks about what happens when p is true. If p is false, the promise is not broken.

Which statement always matches p ⇒ q?

Only the contrapositive ¬q ⇒ ¬p. Converse and inverse match each other, not the original.

How do I remember necessary vs sufficient?

In p ⇒ q, the small inside set p is sufficient; the big outside set q is necessary.

Can I test all the connectives myself?

Yes. In free play, switch p and q and pick each connective.

What is a proposition?

A proposition (also called a statement) is a sentence that is either true (T) or false (F), not both. This is its truth value.

Joining propositions: NOT, AND, OR, ⇒, ⇔

pqnot p (¬p)p ∧ qp ∨ qp ⇒ qp ⇔ q
TTFTTTT
TFFFTFF
FTTFTTF
FFTFFTT

De Morgan's laws: not (p and q) = (not p) or (not q); not (p or q) = (not p) and (not q).

Converse, inverse and contrapositive

Start with p ⇒ q: "If a shape is a square, then it is a rectangle."

A statement and its contrapositive are always equivalent. So to prove p ⇒ q you may prove ¬q ⇒ ¬p instead (proof by contrapositive).

Proof by contradiction: assume the opposite of what you want, and reach something impossible. Then the opposite was false, so your statement is true.

Necessary and sufficient conditions, and sets

If p ⇒ q is true:

With sets: let P = things for which p is true, Q = things for which q is true. Then p ⇒ q means P ⊆ Q (P is inside Q). If both p ⇒ q and q ⇒ p, then P = Q and p is necessary and sufficient for q (p ⇔ q).

Example: "x = 2" ⇒ "x² = 4". x = 2 is sufficient for x² = 4, but not necessary (x = −2 also works).

Quantifiers: for all and there exists

To negate, swap the quantifier and negate the inside:

One counterexample is enough to prove a "for all" statement false.

Try it

Write "If it rains, the ground is wet" on paper. Write its converse, inverse and contrapositive. Which two always agree? Then check with the free-play lamp in the 3D (choose p ⇒ q).

Key formulas and definitions

Worked examples

1. Which are propositions? (a) 12 is divisible by 4 (b) Shut the window (c) x > 5 (d) 3 + 3 = 7

(a) true proposition, (d) false proposition. (b) is an order and (c) is a predicate; neither is a proposition until x is fixed.

2. p: 'it is a weekday', q: 'school is open'. p is T, q is F. Find p ∧ q, p ∨ q, p ⇒ q.

p ∧ q = F (q is false). p ∨ q = T (p is true). p ⇒ q = F (true leads to false).

3. Write the converse and contrapositive of: 'If n is divisible by 6, then n is even.' Which are true?

Converse: if n is even, n is divisible by 6. False (n = 4). Contrapositive: if n is not even, n is not divisible by 6. True.

4. Is 'x > 5' necessary, sufficient, both or neither for 'x > 3'?

x > 5 ⇒ x > 3, so x > 5 is sufficient. But x = 4 shows x > 3 does not give x > 5, so it is not necessary.

5. Negate: 'Every student in the class has a phone.'

'There is at least one student in the class who does not have a phone.' (∀ becomes ∃, and the inside is negated.)

6. Prove by contradiction that √2 is not a fraction a/b in lowest terms.

Assume √2 = a/b in lowest terms. Then a² = 2b², so a is even, a = 2k. Then 4k² = 2b², b² = 2k², so b is even too. Both even contradicts 'lowest terms'. So the assumption is false.

Common mistakes

Practice quiz

1. Which is a proposition?
2. p ⇒ q is false when…
3. The contrapositive of p ⇒ q is…
4. If p ⇒ q is true, then q is a … condition for p.
5. The negation of '∀x, x > 0' is…

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between converse and contrapositive?

The converse only swaps the parts (q ⇒ p). The contrapositive swaps and negates them (¬q ⇒ ¬p). Only the contrapositive always has the same truth as the original.

What is a necessary and sufficient condition?

p is necessary and sufficient for q when p ⇒ q and q ⇒ p are both true, written p ⇔ q.

How do you negate 'for all' statements?

Change 'for all' to 'there exists' and negate the rest: not every x has P means some x does not have P.

Where this is taught

RomaniaClasa a IX-aAlgebra: Mathematical logic
RomaniaClasa a IX-aAlgebra: Mathematical logic
RomaniaClasa a IX-aAlgebra: Mathematical logic
South Korea고등학교 1학년Sets and propositions
South Korea고등학교 1학년Sets and propositions
China高一Ch.1 Sets and logic

Learn first

Learn next

Related lessons

All Maths lessons