Algebra for Machine Learning

Ojash Shrestha
4 min readMay 10, 2021

This article series will help an individual to start from being a beginner to becoming an Artificial Intelligence (AI) Engineer or a Data Scientist. Today, we start with basic algebra. Algebra plays an integral role on every mathematics that is a part of Artificial Intelligence and Data Science. Most novice enthusiasts have a perception that Artificial Intelligence is just programming, but it is much more than just coding. Elon Musk agreed in a Tweet, saying, “Machine Learning (a subset of Artificial Intelligence) Engineering is 10% Machine Learning and 90% Engineering.” And Mathematics is the heart and soul of any Engineering.

This series of articles will focus on Mathematics, statistics, probability calculations together with data science and machine learning pipelines. The articles will explain how to make you all the way from complete beginner to be able to build your own model.

Why do we care about Mathematics for AI and Machine Learning?

While choosing machine learning algorithm and predicting in the future, we have to find the trend about how data is distributed. One of the tools in ML is Linear Regression. To understand Linear Regression, we must understand Algebra first. In the scenario where there are data points all over the place, we need to find out the line which can describe a pattern. The way to find out that line would be Mathematics.

Branches of Mathematics to learn for AI and Machine Learning

Basic Algebra: Basics of Algebra covers the simple operation of mathematics like addition, subtraction, multiplication, and division involving both constant as well as variables. For example, x+50 = 100. It is one of the broadest areas of mathematics and its origin can be tracked back to the ages of ancient Babylonians which is over 1800 BCE.

Calculus

Calculus is a branch of mathematics that helps us understand changes between values that are related by a function. It is the mathematical study of continuous change. Tracing back its history, we can see how Egyptian Moscow Papyrus has first got the inception of Calculus followed by Archimedes. Later, the Modern Calculus saw its uprising with the efforts from Gottfried Wilhelm Leibniz and Newton.

Linear Algebra

Linear algebra is the branch of mathematics concerning linear equations such as: linear maps such as: and their representations in vector spaces and through matrices. It is the foundation upon which Artificial Intelligence operates.

Statistics

Statistics is a branch of mathematics that deals with data collection, interpretation, analysis and presenting it to give insight of the what the data actually represents. Statistics can be applied to wide range of fields from finance, healthcare, technology, demographics, business and so much more. With proper data, statistics can give a perspective about the details and views unseen and unrealizable to average human. Statistics is the study and manipulation of data, including ways to gather, review, analyze, and draw conclusions from data.

Probabilities

Probability can be defined as the likeliness of something to occur or happen. Every time we need to explain what is the change of some outcome or an event to occur, we talk in terms of Probability. It is about calculating how likely or ‘probable’ something is to happen. The chance of an event happening can be described in words, for example ‘certain’, ‘impossible’ or ‘likely’. In math, probabilities are always written as fractions, decimals or percentages with values between 0 and 1.

What will we need to learn in Algebra for AI?

Topic Covered in this article,

  • Mathematical calculations and fun theories
  • Sets and Intervals
  • Algebraic Expression : Evaluating and Simplifying
  • Algebraic Identities
  • Equations and Functions
  • Functions

You can be creative with mathematics. There isn’t just one way to solve it. Chinese method of solving multiplication calculates by counting the joints from left side first after drawing the lines. For e.g., 32 * 64, Draw 3 and 2 stick lines with some spaces vertically. And then draw, 6 lines and 4 with some spaces horizontally. After counting the joints from left to right, you’ll find the multiplication value.

SETS

Sets can be defined as a collection of numbers.

Examples

Set of even numbers: {…, -4, -2, 0, 2, 4, — -}

Set of odd numbers: {…, -3, -1, 1, 3, …}

Set of prime numbers: {2, 3, 5, 7, 11, 13, 17}

Positive multiples of 3 that are less than 10: {3, 6, 9}

A = {3, 6, 9}

For e.g.,: When we have multiple sets, we can look for overlapping numbers.

LET US TAKE 3 SETS: A, B AND C

A = {1, 2, 4, 7, 8}

B = {4, 5, 7}

C = {7, 8}

Here,

Arranging the sets with its elements, we have the following where,

Union of A and B. i.e., A U B = {1, 2, 4, 5, 7, 8}

Intersection of A and B. i.e., A ∩ B = {4, 7}

Intersection of A, B and C = {7}

7 is the overlapping element among all three sets, A, B and C.

INTERVALS

An interval is a set that consists of all real numbers between a given pair of numbers.

Example — all the numbers between 1 and 6 is an interval.

For two intervals [1,5] and [3,6], [3,5] is the overlap between the intervals.

ALGEBRAIC EXPRESSIONS

Algebraic expressions are made of terms, factors and constants.

Terms in an algebraic expression are separated by addition operators, and factors are separated by multiplication operators.

Let us suppose an algebraic expression,

X2 + 3X — 2,

Here, 3 is a factor and 2 is constant.

Each X2, 3X and 2 are terms.

Let us suppose an algebraic expression,

5x + 2y — xy + 5 –2y + x(3y — 1)

After removing the parenthesis we get,

= 5x + 2y — xy + 5 –2y +3xy –x

Combining like terms we get,

5x — x + 2y — 2y — xy + 3xy + 5

To Read the Full Article, Check out https://www.c-sharpcorner.com/article/algebra-for-machine-learning-and-data-science/

--

--