Proofs of Algorithm Correctness and Runtime Estimates · Polynomial, Exponential, and Logarithmic Functions

Lesson 6

Nikolai Chukhin · Alexander S. Kulikov

Below are the plots of four exponential functions \(c^{n}\), for the bases \(c=1.5; 2; e=2.37\dotsc; 3\). For \(1< a < c\), the inequality \(a^{n} < c^{n}\) holds for all (positive integers) \(n\).

import matplotlib.pyplot as plt
import numpy as np

n = np.linspace(1, 10)
plt.plot(n, 1.5 ** n, label='$1.5^n$')
plt.plot(n, 2 ** n, label='$2^n$')
plt.plot(n, np.exp(n), label='$e^n$')
plt.plot(n, 3 ** n, label='$3^n$')
plt.axis([1, 10, 1, 10])
plt.legend()
plt.savefig('exponential.png')