8 Functions
f(x) = y
A function—along with accompanying terms like “domaine de définition,” “dérivée,” “étude de signe,” and “table de variation”—rarely brings back fond memories. Unfortunately, society has often misunderstood the true meaning of functions and their incredible utility.
Academic settings often focus on studying abstract expressions such as:
\[ y = f(x) = \frac{e^x}{\sin(x) + x^2} \tag{8.1}\]
but in applied contexts, what matters first is defining \(x\) and \(f(x)\). Complex analytical study of such expressions is unnecessary; a geometric understanding is sufficient (Chapter 9).
This chapter covers the formalization and practical significance of functions. This formalization serves as a foundation for other concepts in statistics (Chapter 15, Chapter 16) and programming (Chapter 40). A fundamental aspect of this formalization is that a function cannot be separated from the notions of its domain (source set) and codomain (target set).
In pure mathematics, \(x\) and \(y\) are often abstract, leading to detachment from physical context (as in Equation 8.1). In applied science, however, the significance of a function relies entirely on the practical meaning of its domain and codomain. Examples of meaningful domain–codomain pairs include:
- Changes in average income as a function of age
- Number of species as a function of forest area (species-area relationship)
- Rise in global temperature as a function of \(\text{CO}_2\) emissions
While abstract mathematical formulas can be off-putting, discovering an expression that links domain and codomain is powerful. It enables prediction, optimization, or outcome control—essentially providing a mechanism to achieve desired results or prevent undesirable ones.
Formal
1Let \(D \subseteq \mathbb{R}\) be a non-empty subset of real numbers. A real-valued function \(f\) defined on \(D\) is a rule that assigns to each element \(x \in D\) a unique real number \(f(x) \in \mathbb{R}\):
\[ f: D \subseteq \mathbb{R} \to \mathbb{R} \]
- Domain: \(D = \text{Dom}(f) = \{ x \in \mathbb{R} \mid f(x) \text{ is well-defined} \}\)
- Codomain: \(\mathbb{R}\)
- Range: \(\text{Im}(f) = \{ y \in \mathbb{R} \mid \exists x \in D, \, y = f(x) \} \subseteq \mathbb{R}\)
Examples
To see how abstract mathematical rules map to practical concepts across disciplines, consider the following examples:
Linear Functions: The equation \(y = ax + b\) represents a linear function, where a unit change in \(x\) yields a constant rate of change \(a\) in \(y\).
Geometric Area: For positive values (\(x > 0\)), the function \(y = x^2\) calculates the area of a square with side length \(x\).
Probability Density: The probability density function (PDF) of a Gaussian distribution maps a real value \(x\) to the relative likelihood of drawing that value randomly from a normal population2:
\[ f(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp\left( -\frac{(x - \mu)^2}{2\sigma^2} \right) \tag{8.2}\]
Multivariable Physical Laws: Newton’s law of universal gravitation, expressed as \(F(m_1, m_2, d) = \frac{m_1 \times m_2}{d^2}\), is a multivariable function \(F: D \subseteq \mathbb{R}^3 \to \mathbb{R}\). It calculates the gravitational attraction between two objects of mass \(m_1\) and \(m_2\) separated by distance \(d\). In applied modeling, this function is only well-defined when its input domain (\(\mathbb{R}^3\)) respects physical constraints (e.g., \(m_1, m_2 > 0\) and \(d > 0\)) with consistent measurement units.
Tips and warning
Understanding and Categorizing Functions: whenever a function is introduced, the primary focus should remain on its physical or empirical meaning: What do the input and output concretely represent? The mathematical expression only makes sense once the practical context is established.
In formal notation, functions are commonly denoted by symbolic letters such as \(f\), \(g\), or \(h\). However, these symbols can be anything—as will be seen in practical applications throughout later chapters. When writing mathematical expressions (too) frequently, it is wise to choose concise, intuitive notation. In fact, many authors use \(y(x)\) instead of \(f(x)\) to explicitly combine the notation for the independent variable (\(x\)) and the response variable (\(y\)) into a single, compact expression.
Taxonomy of Mathematical Functions:
Algebraic Functions Functions constructed purely using basic arithmetic operations (addition, subtraction, multiplication, division, and root extraction). These include polynomials and rational (quotient) functions—the forms most easily computed by hand.
Transcendental Functions Functions that “transcend” algebra, including exponential functions (\(e^x\)), logarithmic functions (\(\ln x\)), trigonometric functions (\(\sin x, \cos x\)), and hyperbolic functions (\(\sinh x, \cosh x\)).
Non-Elementary Functions Advanced functions that cannot be expressed using a finite combination of elementary algebraic or transcendental operations. Examples include the Gamma function \(\Gamma(x)\), Bessel functions, and the Lambert \(W\) function—often arising as solutions to complex differential equations.
Regardless of whether a function is elementary or non-elementary, the primary goal in applied modeling remains the same: understanding the concrete relationship between the input and output variables and this is best done with graphical representation (Chapter 9).
Semantic/Notation/Terminology
Throughout this book, concepts from mathematics, statistics, and computer science are categorized into three core functional roles:
Input Variables (The Drivers): The terms independent variable, \(x\), input, covariate, argument, parameter, and predictor are treated as functional synonyms—each representing an input value whose variation drives a change in the output. However, inputs (x, arguments, predictors) are variables that change across individual observations within a model. In contrast, parameters (β, a, b) are fixed constants that define the overall shape or structure of the function (e.g., in y=ax+b, x is the input, while a and b are parameters).
Output Variables (The Responses): The terms dependent variable, \(y\), output, and response variable are used interchangeably to denote the resulting value produced by the system.
Mapping Operations: For the purpose of this book, function, application, and map mean the exact same thing: a formal rule \(f: D \to \mathbb{R}\) assigning each input to a unique output.
this is a minimal defintion based on real valued function, it could be easily generalized but not sure that helps↩︎
In rigorous probability theory, \(f(x)\) represents probability density rather than the exact probability of an isolated continuous point, but the intuition holds for applied modeling.↩︎