Logic, relations and functions

Maths · Sets, functions and groups. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Maths topics

The idea

A proposition is a statement that is either true (T) or false (F), never both. Propositions p and q are joined by connectives, and a truth table lists the result for every combination of T and F.

A tautology is true in every row of its truth table; a contradiction (absurdity) is false in every row.

A relation from A to B is any set of ordered pairs (a, b) with a in A and b in B. It is a function from A to B when its domain is the whole of A and each element of A has exactly one image in B. The range is the set of images.

In simpler words

A proposition is a sentence that is either true or false. You can join propositions with words like 'and', 'or' and 'if...then'. A truth table shows the result for every case. A statement true in every row is a tautology. A function is a rule where every input has exactly one output. Only one-one and onto functions can be reversed.

An everyday comparison

The conditional p → q is like a promise: 'If you pass, I will buy you a phone.' The promise is broken only if you pass and get no phone. If you fail, the promise is not broken whatever happens. That is why p → q is true whenever p is false. The comparison is limited, because logic ignores what the speaker meant.

Rules to remember

Common mistake

Students mark p → q as false whenever p is false. It is the opposite: when p is false the conditional is always true, and the only false case is p true with q false.

In the exam

For a truth table, list all combinations of T and F (four rows for p and q), add one column per step, and fill each using the rules. Conclude: 'All values are T, so it is a tautology'. For converse, inverse and contrapositive, write each one clearly. For a function, test one-one and onto separately, then state whether it is bijective. For f−1, solve y = f(x) for x and interchange.

Worked example

Show that (p ∧ q) → p is a tautology.

  1. p = T, q = T: p ∧ q = T, and T → T is T.
  2. p = T, q = F: p ∧ q = F, and F → T is T.
  3. p = F, q = T: p ∧ q = F, and F → F is T.
  4. p = F, q = F: p ∧ q = F, and F → F is T.

Answer: The statement is true in all four rows, so it is a tautology.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Sets and set operationsBinary operations and groups →Take a Maths test