Partial functions, totality & undefinedness
A partial function from A to B assigns a value to some, not necessarily all, elements of A. Its domain of definition is where it is defined, and it is total exactly when that equals A. Real division, square root over ℝ and any program that may loop forever are all naturally partial, which is why computer science treats partiality as a first-class notion rather than an error.
✓ 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.
- Identify the domain of definitionFind every input where the rule produces a value — exclude division by zero, negative square roots, and non-terminating cases.
- Decide totalityTotal means defined everywhere on the declared domain. Otherwise say precisely where it fails.
- Totalise if requiredEither shrink the declared domain to the domain of definition, or extend the codomain with a special undefined value ⊥.
- Compose carefullyA composite of partial functions is defined only where the inner value exists AND lies in the outer function’s domain of definition.
Worked example
For f(x) = 1/(x² − 4) viewed as a partial function ℝ ⇀ ℝ, find its domain of definition and totalise it.
- The rule fails exactly when the denominator is zero.
- x² − 4 = 0 gives x = 2 and x = −2.
- So the domain of definition is ℝ \ {−2, 2}.
- Totalise by declaring f : ℝ \ {−2,2} → ℝ, which is now total on its stated domain.
Answer. Domain of definition ℝ \ {−2, 2}; restricting the declared domain to that set makes f a total function.
Where marks get dropped
These are the specific errors that cost credit on partial functions, totality & undefinedness questions — QED's rubric penalises each of them separately.
- Writing f : ℝ → ℝ for a rule with excluded points. The declaration is then false, and totality fails.
- Assuming a composite is defined wherever the outer function is. The inner value must also exist and be in range.
- Confusing "undefined" with "equals zero". An undefined value is the absence of a result, not a particular one.
Practise this until it is automatic
Unlimited fresh questions
QED generates new partial functions, totality & undefinedness 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 Functions mastery is tracked so you know when this is exam-ready.
Partial functions, totality & undefinedness — frequently asked questions
Why do partial functions matter in computing?
Because a program that may not terminate computes a partial function. The halting problem is precisely the undecidability of whether a given input is in the domain of definition.
How is ⊥ used?
As an explicit "undefined" element added to the codomain, turning a partial function into a total one into B ∪ {⊥}. This is exactly what option and nullable types do in programming languages.
Is every function a partial function?
Yes — total functions are the special case where the domain of definition is the whole declared domain. The containment goes one way only.
The rest of Functions
Injective, surjective, bijective, composition, inverse. Each subtopic below has its own method, worked example and mark-losing traps.
- 1Domain, codomain, image & preimage
- 2Injective, surjective & bijective
- 3Composition g∘f and its properties
- 4Inverse functions
- 5Counting functions between finite sets
- 6Images & preimages of unions and intersections
- 7Restriction, extension & piecewise definitions
- 8Pigeonhole consequences for injections
- 9Countability via a bijection with ℕ
- 10Well-definedness of a proposed function
- 11Monotone & strictly increasing functions
- 12Identity, constant & inclusion functions
- 13Partial functions, totality & undefinedness
Ready to make partial functions, totality & undefinedness 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 →