QED
Functions · step 13 of 13

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.

  1. Identify the domain of definitionFind every input where the rule produces a value — exclude division by zero, negative square roots, and non-terminating cases.
  2. Decide totalityTotal means defined everywhere on the declared domain. Otherwise say precisely where it fails.
  3. Totalise if requiredEither shrink the declared domain to the domain of definition, or extend the codomain with a special undefined value ⊥.
  4. 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.

  1. The rule fails exactly when the denominator is zero.
  2. x² − 4 = 0 gives x = 2 and x = −2.
  3. So the domain of definition is ℝ \ {−2, 2}.
  4. 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.

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.

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 →