1. Relations and Functions#

In this section, we introduce relations and functions, which are used to model relationships between two sets.

1.1. Zoom In (A Detailed Look)#

Let’s start by taking a detailed look at the terminology that we’ll be using throughout the course.

1.1.1. Relationships between inputs and outputs#

In many situations, we have one piece of information and we want to use it to find another, related piece of information. For example, your payroll office might need to find an employee’s salary information. If they know the employee, then they can use a table of salary information to look up the corresponding salary. In situations like this, we could think of the table as having a bunch of possible “inputs” (the employee of interest) and a bunch of corresponding “outputs” (their salary).

In this set of notes, we want to explore input-output relationships more carefully. By the end of this set of notes, we’ll see functions, which are a special type of input-output relation. Functions are the most useful relations for computation, because they’re very predictable.

It’s very important in mathematics to have clear, unambiguous definitions for our terms. In these notes, definitions will look like this:

relation (informal)#

A relation has a set of inputs and a set of outputs. For each input, the relation returns at least one output.

The definition of a relation is very broad. Many things are relations. Here are a couple of examples.

Example 4

People and their pets:

Person

Pets

Jill

Jack

Lola

Stevie

Josh

Curie

Kenzie

Ellie

Josie

Lux

Sheyleah

Mittens

We can interpret the above table as a relation if we think of the person as the “input” and their pets as the “outputs”. For example, the input Jill produces the outputs Jack, Lola, and Stevie. The input Josh produces Josh’s only pet, Curie.

Example 5

Total medals per country in the Tokyo 2020 Olympic Games:

Country

Medals

USA

113

China

88

Russia

71

Great Britain

65

Japan

58

Australia

46

Italy

40

Germany

37

Netherlands

36

France

33

The above table represents a relation if we think of the country as the “input” and its number of medals as the “output”.

Before we discuss the types of relations that will be useful in business algebra, we need to make some formal definitions of the sets and types of relations we’ll be using.

1.1.2. Sets#

Every relation has a set of inputs and a set of outputs. A relation represents a connection between two sets. But what are these sets?

set#

A set is a collection of objects (usually called the elements of the set). In this class, those elements can be basically anything: names, countries, images, text, or (most typically) numbers.

Example 6

The set of Jill’s pets from Example 4 could be written like \(\{\text{Jack}, \text{Lola}, \text{Stevie}\}\). If a set is made up of just a few elements, we can use a comma-separated list of the elements - surrounded with curly braces - to denote the whole set.

Often, we want to work with sets of numbers. For example, if we wanted to work with the integers, we could write \(\{..., -3, -2, -1, 0, 1, 2, 3, 4, ...\}\). But this quickly becomes irritating to write, so we have a few abbreviations for common sets.

Name of Set

Shorthand

Corresponding Set

the integers

\(\mathbb{Z}\)

\(\{..., -3, -2, -1, 0, 1, 2, 3, ...\}\)

the reals

\(\mathbb{R}\) or \((-\infty, \infty)\)

all real numbers (like \(0, -0.\overline{333}, \pi, \frac{5}{7}, \sqrt{2}\), etc.)

You can think of the real numbers as being the complete number line - everything between negative and positive infinity.

1.1.3. Domains and Ranges#

To better analyze relations, we have terminology to separate the set of “inputs” from the set of “outputs”.

domain#

The domain of a relation is its set of inputs. It is sometimes denoted \(D\) for short.

range#

The range of a relation is its set of outputs. It is sometimes denoted \(R\) for short.

Note that the domain and range are properties of a specific relation, and that relation should be clear from context. A question like “What’s the domain?” only makes sense if we’re discussing a particular relation already, in the same way that “What’s their age?” only makes sense if we’re discussing a particular person already.

Example 7

Let’s return to the Olympic example. If we look at the relation determined by the top 3 countries by medal count, we get:

Country

Medals

USA

113

China

88

Russia

71

The domain of this relation is \(D = \{\text{USA}, \text{China}, \text{Russia}\}\), and the range of this relation is \(R = \{113, 88, 71\}\).

Remark 1

Sets don’t care about the order of their elements, and they ignore repeated elements. So all of the following sets are identical:

\[\{113, 88, 71\} = \{71, 88, 113\} = \{71, 71, 88, 88, 88, 113\}\]

Any of these would be valid answers to “What’s the range of the relation above?”, but the first one is the most obvious/simple to write, so we usually just go with that one.

1.1.4. Relations#

It is typical to use the ordered pair notation \((x, y)\) to say “the input \(x\) corresponds to the output \(y\)” in the context of a given relation. So, for example, we could represent the USA’s medal count as the ordered pair \((\text{USA}, 113)\). The input is always on the left, and the output is always on the right. With this notation, we can revise our definition of relation to be a little more precise now:

relation#

A relation is a collection of ordered pairs \((x, y)\), where \(x\) belongs to the domain and \(y\) belongs to the range of the relation.

Example 8

The relation from Example 7 could be rewritten this way:

\[\{(\text{USA}, 113), (\text{China}, 88), (\text{Russia}, 71)\}\]

Note the curly braces. We can still use set notation for relations: a relation is technically the set of its input/output pairs.

As in the definition of relation above, we often use variables as temporary stand-ins for values that we haven’t yet decided on.

variable#

A variable (often \(x\), \(y\), or \(n\)) is a shorthand expression of indeterminate value. Its specific, concrete value can be specified or computed later.

Remark 2

The example above is a set of \((x, y)\) pairs. We’re implicitly using \(x\) and \(y\) as variables to stand in for inputs and outputs (respectively) that we’ll decide later.

The possible concrete values for \(x\) (which make up the domain) are USA, China, or Russia, and the possible values for \(y\) (which make up the range) are 113, 88, or 71. If you specify a value for \(x\), then the corresponding \(y\)-value can then be looked up from either the table form or set form of the relation.

Now we’re ready to discuss the most useful type of relations: functions.

1.1.5. Functions#

A function is a special type of relation. So it still has a domain (set of inputs) and a range (set of outputs). But it follows one additional rule: every input has exactly one output. Functions are very predictable - one thing goes in, and one thing comes out.

function#

A function is a relation such that each input corresponds to exactly one output.

In other words: for a relation to be a function, every \(x\) produces only one \(y\).

Remark 3

Note that it’s okay for a function to have multiple inputs that produce the same output. For example, the following does represent a function:

Input

Output

1

7

2

7

3

7

This still satisfies the definition of a function, even though the output is always 7, because each input does have only one output. We just care about the outputs being predictable - it doesn’t matter if a particular output is repeated.

1.2. Zoom Out (Summary)#

Here are some of the main ideas we’ve met in this section:

  • A relation is a mathematical object that relates an input to an output in a pre-determined way.

  • The set of inputs is called the domain of the relation.

  • The set of outputs is called the range of the relation.

  • A function is a special type of relation, whose outputs are especially predictable. That’s important for us, since we want to be doing calculations that depend on the outputs. More formally, a function has the extra property that no \(x\) has multiple \(y\)’s. Each input will only result in a single, predictable output.

1.3. Zoom Deep & Wide (Applications/Practice)#

Here are some examples that you can use for practice.

1.3.1. Practice: Is it a function?#

Exercise 1

Is this relation a function?

\[\{(1, 1), (2, 2), (3, 3), (4, 4)\}\]

Exercise 2

How about this one?

\[\{(1, 1), (2, 1), (3, 4), (4, 4)\}\]

Exercise 3

Lastly, is this relation a function?

\[\{(1, 1), (1, 2), (1, 3), (1, 4)\}\]