Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Find the domain, codomain, and range of a function

Use when: you're given a function in f: A \to B notation, with a rule, and asked for its domain, codomain, and range

Goal: the domain and codomain read off the notation, plus the range computed from the rule and checked against the codomain

Taught in Domain, codomain, range, image

  1. 1

    In f: A \to B, the domain is A and the codomain is B, both announced before any output is computed.

    Example

    For f: \{1,2,3,4,5,6\} \to \mathbb{Z}: the domain is \{1,2,3,4,5,6\} and the codomain is \mathbb{Z}, both read straight from the notation.

    Why: domain and codomain are stated boundaries, not something to compute from the rule itself.

  2. 2

    Apply the rule to each element of the domain one at a time, keeping track of every result.

    Example

    For f(n) = \lfloor n/2 \rfloor on \{1,2,3,4,5,6\}: f(1)=0, f(2)=1, f(3)=1, f(4)=2, f(5)=2, f(6)=3.

    • the domain is a small finite set — list f(a) for every single a, one at a time.
    • the domain is an infinite set described by a rule — describe the range with its own rule or interval, since an infinite list can't be finished.

    Why: the range only contains outputs that are actually produced, so it has to be found by running the rule, not read off the notation.

  3. 3

    Write the range as the set of results from the previous step, dropping any repeat, since a set lists each value once.

    Example

    The raw outputs 0,1,1,2,2,3 collapse to the range \{0,1,2,3\}, with each repeated value counted only once.

    Why: repeated outputs from different inputs still count as a single element of the range.

  4. 4

    Check that every value found in the previous step belongs to the codomain, since the range can equal the codomain or be a smaller subset of it.

    • the range equals the codomain — every announced target actually gets hit.
    • the range is a proper subset of the codomain — the codomain was announced larger than what the rule actually uses, which is still a legal codomain.

    Why: the codomain only promises an upper boundary, so checking this is what distinguishes it from the range instead of assuming the two always match.

Common mistakes

  • Assuming the codomain must always equal the range instead of checking.
  • Stopping after listing raw outputs without removing duplicates before naming the range.
  • Reading the domain off the rule's formula instead of off the stated notation, missing a domain restricted to a finite set.