Skip to content

Mathematics · Ch 2 — Relations and Functions

Functions

2.4

Functions

What is a Function?

A function is a special kind of relation — the most important one in mathematics. You can think of it as a rule that takes an input and gives you exactly one output. If a relation is a set of ordered pairs, a function is that relation with two strict conditions:

  1. Every element of the first set (the domain) must appear as a first element in some ordered pair. No element is left out.
  2. No element of the domain can appear as the first element in two different ordered pairs with different second elements. Each input has exactly one output.
Note

The words 'function', 'map', and 'mapping' are used interchangeably. When we say "ff maps AA to BB", we mean exactly the same thing as "ff is a function from AA to BB".

Definition 5 (from the textbook) states this formally: A relation ff from a set AA to a set BB is said to be a function if every element of set AA has one and only one image in set BB.

In other words, a function ff is a relation from a non-empty set AA to a non-empty set BB such that:

  • The domain of ff is AA (every element of AA is used).
  • No two distinct ordered pairs in ff have the same first element (no input maps to two different outputs).

If ff is a function from AA to BB and (a,b)∈f(a, b) \in f, we write f(a)=bf(a) = b. Here:

  • bb is called the image of aa under ff.
  • aa is called the preimage of bb under ff.

The notation f:A→Bf: A \to B means "ff is a function from AA to BB".

Watch out

A common mistake is to think every relation is a function. Look back at the earlier examples in the chapter: the relation in Example 7 failed because element 6 had no image. The relation in Example 8 failed because elements in the domain were connected to more than one image. The relation in Example 9 also failed — can you see why? (Check if every domain element has exactly one image.)


Checking Whether a Relation is a Function

Example 10

Let NN be the set of natural numbers. Define a relation RR on NN by

R={(x,y):y=2x,  x,y∈N}.R = \{(x, y) : y = 2x, \; x, y \in N\}.

  • Domain of RR: NN (all natural numbers).
  • Codomain of RR: NN (the set in which we look for images).
  • Range of RR: The set of even natural numbers {2,4,6,8,… }\{2, 4, 6, 8, \dots\}.

Is RR a function? Yes. Every natural number nn has exactly one image: 2n2n. No natural number maps to two different values. So this relation satisfies both conditions of a function.

Example 11

Examine each relation and state, with reasons, whether it is a function.

(i) R={(2,1),(3,1),(4,2)}R = \{(2,1), (3,1), (4,2)\}

The domain elements are 2,3,42, 3, 4. Each appears exactly once as a first element, and each has a unique image. This is a function.

(ii) R={(2,2),(2,4),(3,3),(4,4)}R = \{(2,2), (2,4), (3,3), (4,4)\}

The first element 22 appears twice, with images 22 and 44. This violates the "one and only one image" rule. This is not a function.

(iii) R={(1,2),(2,3),(3,4),(4,5),(5,6),(6,7)}R = \{(1,2), (2,3), (3,4), (4,5), (5,6), (6,7)\}

Every first element 1,2,3,4,5,61,2,3,4,5,6 appears exactly once, each with a unique image. This is a function.

Tip

To quickly test if a relation is a function, check the set of first elements. If any first element repeats with a different second element, it's not a function. If a first element is missing entirely (and the domain is supposed to be the whole set), it's also not a function.


Real Functions and Real-Valued Functions

Definition 6

A function whose range is either R\mathbb{R} (the set of real numbers) or a subset of R\mathbb{R} is called a real-valued function.

If, in addition, its domain is also either R\mathbb{R} or a subset of R\mathbb{R}, it is called a real function.

In practice, most functions you study in Class 11 are real functions — they take real numbers as input and give real numbers as output.

Example 12 …

Definition 5Function

A relation ff from a set AA to a set BB is called a function if it satisfies two conditions:

  1. Every element of AA has an image in BB — that is, the domain of ff is exactly AA. No element of AA is left out.
  2. Each element of AA has exactly one image in BB — no element of AA is paired with more than one element of BB.

In the language of ordered pairs: a function ff is a relation from a non-empty set AA to a non-empty set BB such that no two distinct ordered pairs in ff have the same first element. If (a,b)∈f(a, b) \in f, we write f(a)=bf(a) = b, where bb is the image of aa and aa is the preimage of bb. The notation f:A→Bf: A \to B means ff is a function from AA to BB.

Note

The textbook also defines a real function as a function whose domain and range are subsets of R\mathbb{R} (or R\mathbb{R} itself). That is a special case — the core definition above applies to any sets AA and BB.

Intuition: A function is a rule that gives each input exactly one output — like a vending machine: you press one button (input), you get exactly one item (output). If a button gives nothing, or gives two different items at once, it's not a function.

Tiny concrete example:

Let A={1,2,3}A = \{1, 2, 3\} and B={4,5,6}B = \{4, 5, 6\}. …

Definition 6Real Valued Function

Definition

A real valued function is any function whose range is either the entire set R\mathbb{R} or a subset of R\mathbb{R}.

If, in addition, the domain of that function is also either R\mathbb{R} or a subset of R\mathbb{R}, then the function is called a real function.

In other words, a real function is a function that takes real numbers (or a part of them) as inputs and gives real numbers as outputs. Every real function is automatically a real valued function, but a real valued function need not have a domain that is a subset of R\mathbb{R} — its domain could be any set.

Note

The textbook makes a careful distinction:

  • Real valued function — range is a subset of R\mathbb{R} (domain can be anything).
  • Real function — both domain and range are subsets of R\mathbb{R}.

Intuition

Think of a machine that only produces real numbers as output. That machine is a real valued function. If the machine also only accepts real numbers as input, it is a real function. The key idea is that the output is always a real number — that is the "real valued" part.

Example

Take f:N→Nf : \mathbb{N} \to \mathbb{N} defined by f(x)=2x+1f(x) = 2x + 1. …