Math for Machine Learning
Contents

01 Foundations

Algebra Foundations

Build the symbolic foundations needed for every later topic: variables, expressions, equations, signs, brackets, and fractions.

mathematics · algebra

Algebra Foundations

Algebra uses letters to represent numbers. These letters are called variables.

For example:

\[y = 3x + 2\]

Here, \(x\) is the input, \(y\) is the output, and 3 and 2 are constants.

If \(x=4\), then:

\[y = 3(4)+2 = 12+2 = 14\]

1.1 Solving equations

An equation states that two expressions are equal. Solving an equation means finding the value of the variable that makes the equality true.

The central principle is that whatever operation is applied to one side of an equation must also be applied to the other side.

For example:

\[3x+2=14\]

Subtract 2 from both sides:

\[3x=12\]

Divide both sides by 3:

\[x=4\]

The same principle applies when an equation contains brackets:

\[2(x+3)=14\]

Divide both sides by 2:

\[x+3=7\]

Subtract 3:

\[x=4\]

1.2 Negative numbers and brackets

Brackets matter when working with negative numbers.

\[(-4)^2=(-4)(-4)=16\]

But:

\[-4^2=-(4^2)=-16\]

The first expression squares the negative number. In the second expression, the exponent applies to 4 before the negative sign.

A negative sign outside a bracket changes every sign inside when the bracket is removed:

\[-(x-3)=-x+3\]

Similarly:

\[-2(x+4)=-2x-8\]

1.3 Fractions in equations

A fraction containing a variable can be handled by isolating the fraction and then undoing the division.

For example:

\[\frac{x}{4}+3=8\]

Subtract 3 from both sides:

\[\frac{x}{4}=5\]

Multiply both sides by 4:

\[x=20\]

For:

\[\frac{2x}{3}=8\]

Multiply both sides by 3:

\[2x=24\]

Divide by 2:

\[x=12\]

Division by zero is undefined. Therefore, an expression such as \(\frac{1}{x}\) cannot have \(x=0\).