Algebra for Machine Learning
Algebraic Expressions
The Language of Algebra
Before we can solve complex problems, we need to speak the right language. In algebra, that language is built with expressions. An algebraic expression is a combination of numbers, variables, and operation symbols. Think of it as a phrase in mathematics, like "three more than a number."
It all starts with two basic components: variables and constants.
Variable
noun
A symbol, usually a letter, that represents an unknown value or a value that can change.
Variables give algebra its power. They let us write rules and relationships that work for any number, not just one specific number.
Constant
noun
A number that has a fixed value and does not change.
Variables and constants are grouped together into chunks called terms. Terms are separated by addition or subtraction signs.
Term
noun
A single number, a single variable, or numbers and variables multiplied together.
Within a term, if there's a variable, it often has a number multiplied by it. This number has a special name.
Coefficient
noun
The number multiplied by a variable in an algebraic term.
If you just see a variable by itself, like , its coefficient is 1. We just don't usually write the 1.
Making Expressions Simpler
Algebraic expressions can get long and messy. Our goal is often to simplify them, which means rewriting them in the most compact and clear way possible. Two key techniques for this are combining like terms and using the distributive property.
Like terms are terms that have the exact same variables raised to the exact same powers. Their coefficients can be different.
For example, and are like terms because they both contain the variable to the first power. However, and are not like terms, because the powers of are different. To combine like terms, you just add or subtract their coefficients.
Imagine you have 3 apples and someone gives you 5 more apples. You now have 8 apples. It's the same idea:
Next up is the distributive property. It tells us how to handle multiplication over an addition or subtraction. It's a way of sharing what's outside the parentheses with everything inside.
Let's see it in action with an expression: $4(x + 2)$.
We distribute the 4 to the $x$ and to the 2: $4(x) + 4(2)$
This simplifies to: $4x + 8$
The Rules of the Road
When an expression involves multiple operations, like , which one do you do first? If you add first, you get . If you multiply first, you get . To avoid this confusion, mathematicians agreed on a standard order of operations.
| Order | Operation | Symbol(s) |
|---|---|---|
| 1 | Parentheses | ( ), [ ] |
| 2 | Exponents | x², √ |
| 3 | Multiplication and Division | ×, ÷ |
| 4 | Addition and Subtraction | +, - |
A common way to remember this is with the acronym PEMDAS: Parentheses, Exponents, Multiplication/Division, Addition/Subtraction. When you have Multiplication and Division in the same expression, you work from left to right. The same goes for Addition and Subtraction.
Let's simplify this expression step-by-step: $10 + 2(6 - 3)^2
- Parentheses: First, handle the operation inside the parentheses. $6 - 3 = 3$. The expression becomes $10 + 2(3)^2$.
- Exponents: Next, calculate the exponent. $3^2 = 9$. The expression becomes $10 + 2(9)$.
- Multiplication: Now, the multiplication. $2(9) = 18$. The expression is now $10 + 18$.
- Addition: Finally, the addition. $10 + 18 = 28$.
Mastering these rules is essential. They are the foundation for manipulating and simplifying any algebraic expression you'll encounter.
Time to test your knowledge on these building blocks of algebra.
In the algebraic expression , what is the coefficient of the term ?
Which of the following are considered 'like terms' that can be combined?
Understanding these core concepts—variables, terms, and the rules for simplification—is the first major step. With this foundation, you're ready to tackle more complex algebraic challenges.