Math Atom · M-A09

Functions and graphs

8 minMath AtomFunctions

By the end you will be able to

  1. 1Describe a function as a rule that turns each input into one output, and use the notation f(x).
  2. 2Read outputs off a graph, and work out a value from a formula.
  3. 3Tell a straight-line function from a curved one, and an increasing function from a decreasing one.
  4. 4Read and sketch a piecewise function such as max(x − K, 0).

Why you need it

Put a yield in, get a bond price out. Put a share price in, get an option payoff out. Finance is full of rules that turn one number into another, and a graph lets you see the whole rule at a glance.

These Core Path lessons lean on functions and their graphs:

The idea

A machine that turns inputs into outputs

A function is a rule. You feed it a number, the input, and it hands back one number, the output. Same input, same output, every time. Try three machines.

The function machine

Type any input

Choose a machine

Rule f2x + 1
Output f(x)7

A graph shows every input and output at once. Inputs run along the bottom; above each input, at the height of its output, we put a dot. All the dots together make a line or a curve. To read a value, go up from the input to the curve, then across to the vertical axis.

Two questions describe most graphs. Is it straight or curved? And, moving left to right, does it go up or down? A function going up is increasing; going down, decreasing.

Straight, increasingf(x) = 2x + 1
Straight, decreasingf(x) = 10 − 1.5x
Curved, decreasingbond price against its yield
Piecewisemax(x − 100, 0)

The rules

First, the notation. It looks odd at first, but it says exactly what goes in and what comes out.

Straight lines. The simplest functions add the same amount to the output every time the input goes up by 1. Their graphs are straight.

Curves. Anything else bends. For example P(y)=100/(1+y)10P(y) = 100/(1+y)^{10} falls by less and less as yy rises: curved and decreasing. Note that the letter for the input need not be xx; here it is yy, for yield.

Piecewise functions. Some functions switch rule part of the way along. The most famous in finance uses max⁡\max.

Reading a function, in four questions

  1. What goes in, and what comes out? (Name and units of each.)
  2. Straight or curved? (Does each step in the input change the output by the same amount?)
  3. Increasing or decreasing, and where?
  4. Any corners or switches? (A piecewise rule, such as max.)

Try it

Drag the dot along the graph, or use the input slider, and read the output. For mx + c, set the slope to a negative number. For the price curve, watch how a 1-point rise in yield costs less and less as yields rise. For the hockey sticks, move K and drag across the corner.

Function

Output at 2

1

Shapestraight line
Here it isincreasing
the function your point: drag it
-10-50510-4-2024x →↑ f(x)

Worked examples

1. Evaluating a curved function

Step 1 of 3
  1. 1

    The set-up

    The price of a bond paying 100 in 5 years, with nothing before, is P(y)=100/(1+y)5P(y) = 100/(1+y)^{5}, where yy is the yield, a decimal. Find P(0.03)P(0.03) and P(0.05)P(0.05).

2. A hockey stick, point by point

Step 1 of 3
  1. 1

    The set-up

    f(S)=max⁡(S−50, 0)f(S) = \max(S - 50,\, 0). Find the output at 40, 50, 65.

3. A straight line, forwards and backwards

Step 1 of 4
  1. 1

    The set-up

    A broker in Singapore charges a fee of S$5 plus 0.1% of the trade value xx: f(x)=5+0.001xf(x) = 5 + 0.001x. What is the fee on S$10,000? And what trade value gives a fee of S$20?

Common mistakes

Each line below is a tempting slip. Spot what is wrong, then check.

Reaction

Check what stuck

Question 1 · objective 1

f(x) = 3x − 2. What is f(4)?

Question 2 · objective 4

f(S) = max(S − K, 0) with K = 95. What is f(80)?

Question 3 · objective 3

Which of these functions is decreasing for x ≥ 0?

Question 4 · objective 2

P(y) = 100 ÷ (1 + y)². What is P(0.05), to two decimal places?

Question 5 · objective 4

What does the graph of max(x − K, 0) look like?

Glossary

Function
A rule that turns each input into exactly one output.
Input
The number you put into a function, usually called x. Also called the argument.
Output
The number a function gives back, written f(x) and often called y.
Graph
A picture of a function: every input along the bottom, its output as the height above it.
Intercept
Where a graph crosses the vertical axis: the output when the input is 0.
Slope
How much the output changes for each 1 that the input rises. Constant for a straight line.
Increasing
A function is increasing where its graph goes up as you move to the right.
Decreasing
A function is decreasing where its graph goes down as you move to the right.
Piecewise function
A function that uses different rules on different stretches of its inputs.
max(a, b)
The larger of the two numbers a and b.