Lesson · Functions

Introduction to Functions

So much of math centers on functions — you'll evaluate them, graph them, and solve with them. This lesson nails down the basics: what a function actually is, and the two sets that pin it down, its domain and its range.

Download the PDF

What is a function?

You've probably seen plenty of functions already — things like y = 4x + 5, f(z) = z2, or g(x, y) = f(x) + h(x). But what is a function? A function is a rule that turns an input into an output. That's pretty abstract, so rather than answer “what counts as a rule? what can the inputs and outputs be?” head‑on, let's look at some examples.

Example: add one

“For every real number, add one” is a function. Its input is any real number, its rule is to add one, and its output is a real number too. As an equation:

h(z) = z + 1,   z ∈ ℝ

The h(z) = z + 1 is the rule; the z ∈ ℝ says the input is any real number (the symbol means “belongs to the set,” here the real numbers ). Now we can use it: h(5) = 6 and h(101.434) = 102.434.

Example: even or odd

“For every positive integer, return its remainder when divided by 2” is a function too. Dividing an integer by 2 leaves only two possibilities — remainder 0 if it's even, remainder 1 if it's odd — so the output is one of {0, 1}. Letting n ∈ ℕ (the positive integers):

even(n) = { 0if n is even 1if n is odd

So even(57) = 1 and even(10112) = 0.

Example: sides of a polygon

“For any polygon, return its number of sides” is a function whose input isn't a number at all — it's a shape. That's perfectly fine; nothing says an input has to be a number. The rule is clear (count the sides), and the output is a whole number — and since the smallest polygon is a triangle, it's always at least 3. Writing sides(p) for the number of sides of a polygon p: a parallelogram gives sides(p) = 4, an octagon gives sides(p) = 8.

Example: mixing colors

“Mix together two primary colors” — red and blue give purple. Is that a function? The input is two primary colors, which we can write as an ordered pair (color1, color2), and mixing two primaries always yields a secondary color for the output. Input, rule, output — so yes, it's a function. Call it mix(color1, color2), and write things like mix(blue, yellow) = green.

Domain and range

Those examples share a shape. Every function works over a set of allowed inputs — its domain — and its rule sends each of them to an output. Collect every output the rule can produce, and you have the function's range. Naming a function's domain and range is often the first thing you do when you meet it.

Ready to practice?

The printable version has practice problems to work through — writing sentences as functions, naming each one's domain and range, and evaluating them at specific inputs.

Download the PDF