# What is a Function

Function is one of the most important concept in mathematics. Well, that’s not exactly a definition you would use in your finals but it doesn’t matter. A function is really important term and you should get it right.

So what is a function? A function is a rule that assigns one real number to another real number. It’s a definition you could almost use in your finals. Let’s see an example. We can have a simple rule which assigns to each length in inches the corresponding length in centimeters. The relation between inches and centimeters is 1 inch = 2.54 centimeters. Elementary, 10 inches = 25.4 cm and 50 inches = 127 cm.

It’s a simple rule: we take the length in inches and we multiply it by 2.54 and we get the length in centimeters. It’s not exactly rocket science. Or is it? NASA once lost \$125-million due to mistake in converting from English to metric measurements back in 1999 … so may be it kind of _is_ rocket science.

Our example is a simple function. It converts inches to centimeters and it can save you \$125-million. It assigns the real number 10 to another real number 25.4. We can visualize some of the assignments using a table:

Inches Centimeters
1 2.54
10 25.4
50 127
80 203.2

## The Notation

We have a basic idea what a function is. Now we can introduce some notation so we can talk about functions without any metaphors. We need a way how to set a name to a function. We usually by convention use small letters and most commonly we use the letter “f” for obvious reasons. Thus we can say that our convention function from previous chapter is the function f.

Then we need notation for those two numbers. We can say that the length in inches is the input and the length in cm is the output of the function f. So for input 10 inches our function f gives us output 25.4 centimeters. We can write it down using standard notation f(10) = 25.4. We can read the expression f(x) as “value of f at x”.

Summary: If x is input of the function f, then the output is equal to f(x): f(input) = output. The concrete numbers depends on the definition of f. We can have a function that assigns to each number the square of that number. For input x = 4 we get output f(4) and this equals to 16 since 4 · 4 = 16.

## Defining a Function Using a Table

Now we’re gonna learn how to define function using a table. We can define a simple function using a table with two columns. In the first column will be inputs and in the second column will be outputs. See example:

Input Output
1 1
2 4
3 9
4 16
5 25

Clearly, this table defines a function that assign to each number it’s square. We name this function f. Now we can write f(4) = 16 etc.

What is the main problem of the table method? Well, it’s not quite precise since we had to use the three dots to indicate that the input 5 is not the last input the function take. In other words, we can compute the square of the number 8 as well, it’s 82 = 64. Thus f(8) = 64 even though there is no input 8 in the table.

To be honest, we can compute the square of negative numbers too, e. g. ( − 5)2 = 25. So there should also be three dots in the beginning of the table:

Input Output
1 1
2 4
3 9
4 16
5 25

And finally: we can compute the square of rational numbers, e. g. 1.52 = 2.25. Should we put the three dost between all rows…? Clearly, that’s nonsense.

Basically, we can use table method to define a function but it’s hard to define function with infinite inputs. On the other hand, it’s perfectly fine to use a table to define a simple function like this one:

Input Output
1 8
7 -41
10 3.15
42 0

This table defines a function f that takes as an input one of four numbers and assigns them to another four numbers. Can you guess the meaning of this function? No? Me neither. It’s just eight numbers that popped in my mind. But that doesn’t matter. It’s a function so we can write f(7) = − 41 etc.

## The Exactly One Real Number Rule

We’ve defined the function as a rule that assigns one real number to another real number. The crucial part is that for each input there exists exactly one output. It’s not possible for a function to have two outputs for the same input. It doesn’t even make sense: can 10 inches equals 25.4 centimeters and also 30 centimeters? No, that’s nonsense. We can convert 10 inches to 25.4 centimeters and that’s all.

Let’s take another example: a function f that computes the length of a word. I know, it’s not exactly a function following our definition since it does not assigns numbers to numbers, but words to numbers. But nevertheless, the logic is the same. Now we have:

• f(the) = 3,
• f(book) = 4,
• f(burzum) = 6,
• f(mathematics) = 11.

It’s not possible for this function to return two different outputs for the same word. The word “book” does have four letters, no more, no less. The function cannot return six as an answer. It has to always return four as a answer for the input “book”.

On the other hand, there can be multiple inputs for the same output. Let’s take as an example the words “love” and “math”. It holds that f(love) = 4 and f(math) = 4. Both words have the same length. So we have different inputs but the same output. And for the same output we have multiple inputs. That’s perfectly fine situation.

The only critical part is, that we must not have two different outputs for the same input.