Algebra (Part 1)
I suggest you read my previous article about Pre-Algebra because we are going further. Let's become more serious about Algebra. Algebra is heavily used in Artificial Intelligence (AI). It is important to master Algebra if you want to master AI Engineering.
Compound Inequality
A compound inequality is a combination of two or more simple inequalities linked by the words "AND" or "OR". These inequalities can be graphed on a number line to visually represent the solution set. Here are examples.
\[x \lt 3 \text{ OR } x \gt 5\]

We use dashed lines to print \(\lt\) and \(\gt\).
\[x \le 3 \text{ OR } x \ge 5\]

We use solid lines to print \(\le\) and \(\ge\).
\[x \gt 0 \text{ AND } x \lt 4\]

So, in this case, 1, 2, or 3 is a solution of the compound inequality, but -1, 0, 4, or 5 is not because it only satisfies one of the inequalities, not both.
We could also simplify \(x \gt 0 \text{ AND } x \lt 4\) to \(0 \lt x \lt 4\).
Simplify Compound Inequality
It's important to be able to simplify compound inequalities. Simple compound inequalities can make them easier to understand.
\[5x - 4 \ge 12 \text{ OR } 12x + 5 \le -4\] | |
---|---|
|
|
\[x \ge \frac{16}{5} \text{ OR } x \le -\frac{3}{4}\] |
\[-7x - 50 \le -1 \text{ AND } -6x + 70 \gt -2\] | |
---|---|
|
|
|
Graphing Slope-intercept Form
In my previous article, Pre-Algebra, I already introduced equations of Slope and Slope-Intercept Form. Let's recap those equations by drawing graphs.
Remember that the line is always linear or straight. To draw a straight line, we need at least two points. Here is an example.
\[y = -4x - 1\] | |
---|---|
\(x\) | \(y\) |
0 | -1 |
1 | -5 |
Now, we already have two points here (0, -1) and (1, -5). So, the graph will be like this.

Now, let's reverse. How about we have a graph, and we need to write the equation? Here is an example.

We have two points here: (2, 9) and (4, 1). We need to find the slope (\(m\)) first.
- \(m = \frac{\Delta y}{\Delta x}\)
- \(m = \frac{y2 - y1}{x2 - x1}\)
- \(m = \frac{1 - 9}{4 - 2}\)
- \(m = -\frac{8}{2}\)
- \(m = -4\)
We found that the slope of (2, 9) and (4, 1) is -4. Now, let's find the y-intercept (\(b\)).
- \(y = mx + b\)
- \(9 = -4 \cdot 2 + b\)
- \(9 = -8 + b\)
- \(8 + 9 = b\)
- \(17 = b\)
So, the answer is \(y = -4x + 17\).
Point-slope Form
Point-slope form is a way to represent the equation of a straight line using its slope and a point on the line.
\[y - b = m(x - a)\]
If we found a line that passes through (7, 3) whose slope is 2. Then \(m = 2\), \(a = 7\), and \(b = 3\). So, the point-slope form is \(y - 3 = 2(x - 7)\).
.webp)
Standard Form

The standard form of a linear equation is \(ax + by = c\), where a, b, and c are real numbers.
As an example, let's say we have \(5x - 2y = 10\). Let's find the two points from this equation.
\[5x - 2y = 10\] | |
---|---|
\(x\) | \(y\) |
0 |
|
|
0 |
We already got two points from \(5x - 2y = 10\), they are (0, -5) and (2, 0). Let's draw the graph.

System of Equations
A system of equations is a set of two or more equations that are considered together because they involve the same variables. The goal is to find values for the variables that satisfy all equations in the system simultaneously. These systems can be linear or nonlinear and are used to model relationships between multiple variables.
There are several methods to solve systems of equations: Substitution, Elimination, Graphing, and Matrices. Here are examples for substitution and elimination.
Substitution Method
- \(-5x + 4y = 3\)
- \(x = 2y - 15\)
- \(-5x + 4y = 3\)
- \(-5 \cdot (2y - 15) + 4y = 3\)
- \(-10y + 75 + 4y = 3\)
- \(-10y + 4y = 3 - 75\)
- \(-6y = -72\)
- \(y = \frac{-72}{-6}\)
- \(y = 12\)
- \(x = 2y - 15\)
- \(x = 2 \cdot 12 - 15\)
- \(x = 24 - 15\)
- \(x = 9\)
Elimination Method
- \(10y - 11x = -4\)
- \(-2y + 3x = 4\)
We need to multiply \(-2y + 3x = 4\) by 5 to get \(-10y + 15x = 20\). They are equivalent, but we can eliminate the \(y\) term by adding it with \(10y + 11x = -4\).
- \( \begin{aligned} 10y - 11x = -4 \\ -2y + 3x = 4 \\ \end{aligned} \)
- \( \begin{aligned} 10y - 11x = -4 \\ 5 \cdot (-2y + 3x = 4) \\ \end{aligned} \)
- \( \begin{aligned} 10y - 11x = -4 \\ -10y + 15x = 20 \\ \end{aligned} \)
- \( \begin{aligned} 10y - 11x = -4 \\ +~-10y + 15x = 20 \\ \hline \\ 4x = 16 \end{aligned} \)
- \(x = \frac{16}{4}\)
- \(x = 4\)
- \(-2y + 3x = 4\)
- \(-2y + 3 \cdot 4 = 4\)
- \(-2y + 12 = 4\)
- \(-2y = 4 - 12\)
- \(-2y = -8\)
- \(y = \frac{-8}{-2}\)
- \(y = 4\)
Number of solutions to system of equations
A system of linear equations mostly has a single solution, but sometimes it can have no solution (parallel lines) or infinite solutions (same line).
No Solution
- \(y = x + 7\)
- \(y = x - 8\)
If you see that they have the same slope, this means that they have no solution and they have parallel lines.

Infinite Solutions
- \(y = -2x + 4\)
- \(7y = -14x + 28\)
If we divide \(7y = -14x + 28\) by 7, we will get \(y = -2x + 4\). They are the same. It means that they have infinite solutions and they are on the same line.
References
- Khan Academy
- https://en.wikipedia.org/wiki/Linear_equation