Reading history

Functions and Relations: Domain, Range and f(x)

4 min read 4 views

SSC maths: ordered pairs, Cartesian products, relations and functions, domain and range, f(x) notation, inverse images and the vertical line test.

A function is a rule that gives exactly one output for each input. “Each student has one roll number” is a function; “each student and the subjects they take” is not, because one student takes several subjects. Functions are the language of algebra, graphs, physics and programming. This lesson builds the idea step by step: ordered pairs, Cartesian products, relations, and finally functions with their domain and range.

In this lesson you will learn

  • Ordered pairs and the Cartesian product A × B
  • What a relation is
  • When a relation is a function
  • Domain, range and function notation f(x)
  • Finding values, inverse images and checking with the vertical line test

You should know sets and set notation from Sets and Venn Diagrams.

Ordered Pairs and Cartesian Products

An ordered pair (a, b) is two items where the order matters: (2, 3) and (3, 2) are different. Two ordered pairs are equal only when their first parts are equal and their second parts are equal.

The Cartesian product A × B is the set of every ordered pair whose first part comes from A and second part from B.

A = {1, 2},  B = {a, b, c}
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
n(A × B) = n(A) × n(B) = 2 × 3 = 6

B × A contains pairs such as (a, 1), so A × B and B × A are different sets, although both have 6 elements.

Relations

A relation from A to B is any subset of A × B. Usually it is described by a rule.

A = {1, 2, 3},  B = {2, 4, 6, 8}
Relation R = {(x, y) : x ∈ A, y ∈ B and y = 2x}
R = {(1, 2), (2, 4), (3, 6)}

The domain of a relation is the set of first parts, here {1, 2, 3}. The range is the set of second parts, here {2, 4, 6}. The element 8 of B is not used, so it is not in the range.

Functions

A relation is a function when every element of the domain is paired with exactly one element. An input may never have two different outputs, but two inputs may share an output.

RelationFunction?Reason
{(1, 2), (2, 4), (3, 6)}YesEach input has one output
{(1, 5), (2, 5), (3, 5)}YesInputs may share an output
{(1, 2), (1, 3), (2, 4)}NoInput 1 has two outputs, 2 and 3

A function is often written f(x), read “f of x”, meaning the output when the input is x. For f(x) = 2x + 1:

f(3)  = 2(3) + 1  = 7
f(−2) = 2(−2) + 1 = −3
f(a + 1) = 2(a + 1) + 1 = 2a + 3

Finding Domain and Range

When a function is given only by a formula, its domain is every real number for which the formula makes sense. Watch for two danger signs: dividing by zero and taking the square root of a negative number.

f(x) = 1 / (x − 2)      x − 2 cannot be 0, so domain: all real x except 2
g(x) = √(x − 3)         x − 3 must be ≥ 0, so domain: x ≥ 3
h(x) = x²               domain: all real x;  range: y ≥ 0 (a square is never negative)

Working Backwards: Inverse Images

Sometimes the output is given and the input is unknown. Set the formula equal to the output and solve.

f(x) = 3x − 4.  For which x is f(x) = 11?
3x − 4 = 11
3x = 15
x = 5

For f(x) = x², the output 9 comes from two inputs, 3 and −3. That is allowed for a function, but it means f has no inverse function on all real numbers.

The Vertical Line Test

On a graph, a relation is a function if no vertical line crosses it more than once, because a vertical line is one x value. A straight line y = 2x + 1 and the U-shaped curve y = x² pass the test. A circle such as x² + y² = 25 fails: the vertical line x = 3 meets it at (3, 4) and (3, −4).

Common Mistakes

  1. Treating (a, b) and (b, a) as the same. Order matters in a pair.
  2. Calling the whole set B the range. The range is only the outputs actually used.
  3. Thinking two inputs with the same output break the rule. Only one input with two outputs does.
  4. Forgetting excluded values such as x = 2 in 1/(x − 2).

Practice Exercises

Exercise 1. If A = {a, b} and B = {1, 2, 3}, how many elements does A × B have? List them.

Show answer

2 × 3 = 6: (a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3).

Exercise 2. If f(x) = x² − 2x, find f(4) and f(−1), and find x when f(x) = 0.

Show answer

f(4) = 16 − 8 = 8, f(−1) = 1 + 2 = 3. x² − 2x = 0 gives x(x − 2) = 0, so x = 0 or x = 2.

Exercise 3. State the domain of f(x) = (x + 1) / (x² − 9).

Show answer

x² − 9 = 0 when x = 3 or x = −3, so the domain is all real numbers except 3 and −3.

Frequently Asked Questions

What is the difference between range and codomain?

The codomain is the set the outputs are allowed to come from, such as B. The range is the set of outputs actually produced. In A = {1, 2, 3} to B = {2, 4, 6, 8} with y = 2x, the codomain is B but the range is {2, 4, 6}.

Why do functions matter in computer programming?

A programming function also takes inputs and returns a result. A mathematical function always gives the same output for the same input, and programmers call functions that behave this way “pure” functions.

Summary

  • A × B is the set of all ordered pairs (a, b) with a ∈ A and b ∈ B.
  • A relation is any subset of A × B; its domain and range are the first and second parts.
  • A function gives exactly one output for each input.
  • Exclude inputs that cause division by zero or square roots of negatives.

Next: Ratio and Proportion.

Lessons are also marked complete when you click Next.

Leave a Reply

Your email address will not be published. Required fields are marked *