01. Mathematical Notation — The Minimum Grammar of Optimization
// BACKGROUND 1/6— read sets, intervals, vectors, functions, mappings, summations, and norms in a consistent way
Optimization documents look difficult because they contain many symbols. But most of them are shorthand for "a collection of possible values," "a rule that maps inputs to outputs," "a way of adding several terms," or "a way of measuring magnitude."
Sets and intervals
A set is a collection of elements. For example, means that " is an element of the set ." Optimization expresses all possible candidates as a set.
An interval is a contiguous portion of the real numbers.
| Notation | Meaning | Endpoints included? |
|---|---|---|
| At least and at most | Both | |
| Greater than and less than | Neither | |
| At least and less than | Left only | |
| Greater than and at most | Right only |
The feasible region of an optimization problem is usually written in set notation:
Here is "the set of candidates satisfying every constraint."
Vectors
A vector bundles several numbers into one decision:
In optimization, is usually the decision variable. In a factory design, for example, might be length, thickness, and flow rate.
:::tip Sentence to remember Choosing one scalar is searching on a line; choosing a vector is searching for a point in a space. :::
Functions and mappings
A function is a rule that maps inputs to outputs.
maps an -dimensional vector to one number. An objective function usually has this form:
In contrast, maps an input vector to an output vector. It is natural to view several constraints or simulation outputs as a vector-valued function.
Summation
Summation notation compresses repeated addition.
The mean squared error of a regression problem is usually written as
It is simple to read: substitute values from through and add everything.
Norms
A norm is a function that measures the magnitude of a vector. The Euclidean norm is used most often:
Optimization uses norms to decide "how far did we move?", "how large is the error?", and "has the gradient become small enough?"
| Norm | Definition | Intuition |
|---|---|---|
| $\sum_i | x_i | |
| Straight-line distance | ||
| $\max_i | x_i |
How to read an optimization statement
Consider
It reads as follows:
- Choose a vector called .
- We want to make small.
- But the constraint must be respected.
- Find the best point among the possible values of .