Free preview

83 lessons

Mathematical Foundations for ML

Free preview

Mathematical Foundations for ML · 83 lessons

Build the maths foundations that make ML click

No surprise gaps

Actually remember it

Skip what you know

One subscription. All learning paths included.

Our content is best on a larger screen

Exponential functions

The exponential function

Explanation

So far, expressions like x2x^2 or x5x^5 have had the variable in the base and a fixed number in the exponent. An exponential function flips this: the base is fixed and the variable sits in the exponent.

Exponential function

Definition

An exponential function has the form

f(x)=axf(x) = a^x

where a>0a > 0 and a1a \neq 1. The constant aa is called the base, and the variable xx is the exponent.

Because the input is itself the exponent, the exponent rules we already know tell us exactly what ff does at familiar values:

  • a0=1a^0 = 1, so f(0)=1f(0) = 1 for every base.
  • an=1ana^{-n} = \dfrac{1}{a^n}, so negative inputs give reciprocals.
  • am/n=(an)ma^{m/n} = \left(\sqrt[n]{a}\right)^m, so fractional inputs involve roots.
Why restrict aa?

Details

Example

Let f(x)=3xf(x) = 3^x. Evaluate f(0)f(0), f(2)f(-2), and f ⁣(32)f\!\left(\dfrac{3}{2}\right).

Solution

First, f(0)f(0). Any non-zero base raised to the power 00 equals 11:

f(0)=30=1f(0) = 3^0 = 1

Next, f(2)f(-2). A negative exponent gives the reciprocal:

f(2)=32=132=19f(-2) = 3^{-2} = \dfrac{1}{3^2} = \dfrac{1}{9}

Finally, f ⁣(32)f\!\left(\dfrac{3}{2}\right). A fractional exponent combines a root and a power. The denominator 22 gives the square root and the numerator 33 gives the power. Taking the root first:

f ⁣(32)=33/2=(3)3=33\begin{align*} f\!\left(\dfrac{3}{2}\right) &= 3^{3/2} \\ &= \left(\sqrt{3}\right)^3 \\ &= 3\sqrt{3} \end{align*}

So the three outputs are f(0)=1f(0) = 1, f(2)=19f(-2) = \dfrac{1}{9}, and f ⁣(32)=33f\!\left(\dfrac{3}{2}\right) = 3\sqrt{3}.

Practice questions

4 questions

Let f(x)=2xf(x) = 2^x. What is f(3)f(-3)?

Select the correct answer:

+ 3 more questions

Growth and decay

Explanation

Whether an exponential function rises or falls depends entirely on its base.

Growth and decay

Definition

For f(x)=axf(x) = a^x:

  • If a>1a > 1, the function increases - this is exponential growth.
  • If 0<a<10 < a < 1, the function decreases - this is exponential decay.

The key idea is what happens when xx increases by 11. Since ax+1=aaxa^{x+1} = a \cdot a^x, each unit step in xx multiplies the output by the base aa. When a>1a > 1, multiplying by aa makes the output larger; when 0<a<10 < a < 1, multiplying by aa makes it smaller.

Growth and decay are two sides of the same coin. Notice that

(1a)x=ax\left(\dfrac{1}{a}\right)^x = a^{-x}

so a decay curve with base 1a\dfrac{1}{a} is the growth curve axa^x reflected across the yy-axis. For every a>1a > 1, the two curves are mirror images of each other:

0.511.522.5−0.5−1−1.51234567−2−2.5
y=2.0x
y=2.0x

Drag to change the base a. The growth curve ax and decay curve ax stay mirror images across the y-axis.

Every decay function can be rewritten as a growth function with a negated exponent, and vice versa.

Rewritten forms can be misleading

Gotcha

A function like f(x)=7xf(x) = 7^{-x} looks like growth because 7>17 > 1, but the negative exponent flips the behaviour. Rewriting as f(x)=(17)xf(x) = \left(\dfrac{1}{7}\right)^x reveals the effective base 17<1\dfrac{1}{7} < 1, confirming decay.

Example

Classify f(x)=5xf(x) = 5^x and g(x)=(25)xg(x) = \left(\dfrac{2}{5}\right)^x as growth or decay. Then show that g(x)g(x) can be rewritten using base 52\dfrac{5}{2}.

Solution

f(x)=5xf(x) = 5^x: The base is 55. Since 5>15 > 1, each unit increase in xx multiplies the output by 55, so ff represents exponential growth.

g(x)=(25)xg(x) = \left(\dfrac{2}{5}\right)^x: The base is 25\dfrac{2}{5}. Since 0<25<10 < \dfrac{2}{5} < 1, each unit increase in xx multiplies the output by 25\dfrac{2}{5}, making it smaller. So gg represents exponential decay.

Rewriting gg: We can express 25\dfrac{2}{5} as the reciprocal of 52\dfrac{5}{2}:

25=(52)1\dfrac{2}{5} = \left(\dfrac{5}{2}\right)^{-1}

Substituting into g(x)g(x) and applying the power-of-a-power exponent rule:

g(x)=(25)x=[(52)1]x=(52)x\begin{align*} g(x) &= \left(\dfrac{2}{5}\right)^x \\ &= \left[\left(\dfrac{5}{2}\right)^{-1}\right]^x \\ &= \left(\dfrac{5}{2}\right)^{-x} \end{align*}

This confirms the relationship: decay with base 25\dfrac{2}{5} is the same as growth with base 52\dfrac{5}{2} reflected across the yy-axis.

Practice questions

4 questions

Which of the following represents exponential decay?

Select the correct answer:

+ 3 more questions

Graphs of exponential functions

Explanation

Every exponential function f(x)=axf(x) = a^x shares a core set of graphical features, no matter what the base is.

Key features of f(x)=axf(x) = a^x

Definition

For every valid base a>0a > 0 with a1a \neq 1, the graph has four features:

  1. yy-intercept: (0,1)(0, 1), since a0=1a^0 = 1 for every valid base.
  2. Horizontal asymptote: the line y=0y = 0 is a horizontal asymptote - a line that the graph approaches but never touches. As xx becomes very negative, the curve flattens towards the xx-axis without ever reaching it.
  3. Always positive: ax>0a^x > 0 for all xx, so the graph stays above the xx-axis.
  4. No xx-intercept: because the output is never zero.

The base determines the shape:

  • When a>1a > 1 (growth), the curve rises steeply to the right and flattens towards zero on the left.
  • When 0<a<10 < a < 1 (decay), the curve falls from left to right, the mirror image of a growth curve.
  • A larger base produces steeper growth. For example, 3x3^x rises faster than 2x2^x.

Use the slider below to adjust the base and watch how the curve changes. As aa crosses 11, the graph flips from decay to growth.

0.511.522.5−0.5−1−1.512345678−2−2.59
f(x)=2.0x

Drag to change the base a. As a crosses 1, the curve flips from decay to growth. A larger a makes growth steeper.

Example

For f(x)=2xf(x) = 2^x, identify the yy-intercept and horizontal asymptote, and explain why the graph is always positive. Then sketch g(x)=(12)xg(x) = \left(\dfrac{1}{2}\right)^x on the same axes and describe the relationship between the two graphs.

Solution

Features of f(x)=2xf(x) = 2^x:

  • yy-intercept: Setting x=0x = 0 gives f(0)=20=1f(0) = 2^0 = 1, so the yy-intercept is (0,1)(0, 1).
  • Horizontal asymptote: As xx becomes very negative, 2x2^x gets arbitrarily close to 00 but never reaches it. The horizontal asymptote is y=0y = 0.
  • Always positive: Since 2x>02^x > 0 for all xx, the curve stays above the xx-axis and never crosses it - there is no xx-intercept.

Sketching g(x)=(12)xg(x) = \left(\dfrac{1}{2}\right)^x:

Since (12)x=2x\left(\dfrac{1}{2}\right)^x = 2^{-x}, replacing xx with x-x reflects the graph across the yy-axis. The decay curve gg is the mirror image of the growth curve ff. Both curves pass through (0,1)(0, 1) and share the same asymptote y=0y = 0.

123−1−2−32468101214
f(x)=2x
g(x)=(12)x

The blue growth curve f(x)=2xf(x) = 2^x and the red decay curve g(x)=(12)xg(x) = \left(\dfrac{1}{2}\right)^x are reflections of each other in the yy-axis. They share the yy-intercept (0,1)(0, 1) and the asymptote y=0y = 0.

Practice questions

4 questions

What is the yy-intercept of f(x)=10xf(x) = 10^x?

Select the correct answer:

+ 3 more questions