Optimization Formula
At its core, an optimization problem is about finding the best possible outcome given certain conditions. The general mathematical formulation is:
Let’s go step by step to understand what each part means.
1. What does represent?
is the decision variable (or a vector of variables). - It represents the choices we can make in the optimization problem.
- Depending on the problem,
could be: - The quantity of items to produce in a factory.
- The investment amount in different stocks.
- The coordinates of a drone trying to find the shortest path.
- The weights in a machine learning model.
If there are multiple variables in our problem (e.g., multiple things to decide at once), then
For example, if you are deciding how much money to invest in 3 different assets, your decision variable could be:
2. What is ?
- The symbol
represents the set of real numbers (all numbers that are not imaginary, including decimals and fractions). - The notation
means an n-dimensional space of real numbers. - In simple terms,
is just a collection of n real numbers.
💡 Analogy:
Think of
For example:
- If
, then is just one number: (like a temperature or price). - If
, then is like a coordinate on a 2D graph. - If
, then is a point in 3D space. - If
, then is a 100-dimensional vector — impossible to visualize but useful in things like AI and machine learning.
3. What is ?
- This is called the objective function.
- It measures what we are trying to minimize or maximize.
- The function assigns a value to each possible choice of
.
For example:
- In logistics,
could be the total cost of delivering packages. - In machine learning,
could be the error of a model. - In finance,
could be the risk of an investment portfolio.
If we minimize
4. What is ? (Feasible Region)
This is a crucial part, and the previous explanation was too vague. Let’s refine it:
is the set of all possible values of that satisfy certain conditions. - It restricts which choices of
are valid. - If there are no restrictions, then we say we have unconstrained optimization and
. - If there are restrictions, then
is a subset of .
Examples of in Real Life
Example 1: Packing a Suitcase (Constrained Optimization)
- You have a suitcase with a weight limit of 20kg.
- You need to pack clothes, shoes, and electronics.
- The total weight of all items must be less than 20kg.
- Your feasible region
is the set of all possible combinations of items that fit within this weight limit.
Mathematically, if
So,
Example 2: Investment Portfolio
- You have $100,000 to invest.
- You can allocate money into stocks, bonds, and cryptocurrency.
- The total investment cannot exceed $100,000.
- Your feasible region
is:
(We also restrict that investments must be non-negative, meaning you can't invest a negative amount!)