Relations as subsets of A × B
Formally a relation from A to B is just a subset of A × B — no more structure than that. The domain is the set of first coordinates actually used, the range (or image) the set of second coordinates. Because a relation is a set, all the usual set operations apply, and the number of relations from A to B is 2^(|A|·|B|), since each pair is independently in or out.
✓ Unlimited questions · marked criterion by criterion · no card needed
Method: how to approach it
The order below is what examiners expect to see, and each step carries its own marks.
- List the pairs explicitlyWhether the relation is given by a rule or a picture, writing the pairs makes domain and range immediate for finite cases.
- Domain = first coordinatesdom(R) = {a : ∃b, (a,b) ∈ R}. It is a subset of A and need not equal A.
- Range = second coordinatesran(R) = {b : ∃a, (a,b) ∈ R}, a subset of B. The codomain B is given; the range is computed.
- Take images of subsetsR[X] = {b : ∃a ∈ X, (a,b) ∈ R}. The range is R[A], the image of the whole domain.
Worked example
Let A = {1,2,3}, B = {p,q,r} and R = {(1,p),(1,q),(3,q)}. Give dom(R), ran(R), R[{1}] and the number of relations from A to B.
- First coordinates used: 1 and 3, so dom(R) = {1,3} — note 2 is absent.
- Second coordinates used: p and q, so ran(R) = {p,q}; r is unused.
- R[{1}] collects partners of 1: {p, q}.
- |A × B| = 9, and each of the 9 pairs is independently in or out.
Answer. dom(R) = {1,3}, ran(R) = {p,q}, R[{1}] = {p,q}, and there are 2⁹ = 512 relations from A to B.
Where marks get dropped
These are the specific errors that cost credit on relations as subsets of a × b questions — QED's rubric penalises each of them separately.
- Equating the range with the codomain. The codomain is declared; the range is what is actually hit, and they differ whenever some element of B is unused.
- Assuming the domain is all of A. Unlike a function, a relation may leave elements of A unrelated to anything.
- Forgetting that one element may have several partners. Relations are not functions, so 1 relating to both p and q is perfectly legal.
Practise this until it is automatic
Unlimited fresh questions
QED generates new relations as subsets of a × b problems on demand at warm-up, exam and challenge level, so you can drill this one skill until it stops costing you marks.
Marked like an examiner
Every answer is scored against a point-by-point rubric with partial credit, so you see exactly which step of the method broke down — not just a tick or a cross.
Answer in real notation
A one-tap symbol palette, a visual equation editor and a truth-table builder — or photograph your handwritten working and QED converts it to LaTeX.
Saved to your library
Every question you generate is kept and re-takeable as a timed exam, and your Relations mastery is tracked so you know when this is exam-ready.
Relations as subsets of A × B — frequently asked questions
When is a relation a function?
Exactly when every element of A appears as a first coordinate exactly once — totality plus single-valuedness. R above fails both: 2 is missing and 1 has two partners.
How many relations are there on a set of size n?
2^(n²), since a relation on A is a subset of A × A which has n² elements. For n = 3 that is 512.
Is the empty set a relation?
Yes — it is a subset of A × B, with empty domain and empty range. It is vacuously symmetric, antisymmetric and transitive.
The rest of Relations
Properties of relations, composition, and representations. Each subtopic below has its own method, worked example and mark-losing traps.
- 1Reflexive, symmetric, antisymmetric & transitive
- 2Checking properties for a given relation
- 3Composition R∘S & inverse R⁻¹
- 4Matrix & digraph representations
- 5Reflexive & transitive closures
- 6Relations as subsets of A × B
- 7Powers Rⁿ & reachability
- 8Warshall’s transitive closure algorithm
- 9Counting relations with a given property
- 10Union, intersection & complement of relations
- 11n-ary relations & the relational data model
- 12Restricting a relation to a subset
- 13Symmetric closure vs transitive closure
Ready to make relations as subsets of a × b exam-proof?
Generate your first questions free — no card, no setup, no personal data stored. Practise until the method is second nature.
Start practising free →