Skip to content

Latest commit

 

History

History
217 lines (170 loc) · 7.58 KB

algebra-introduction.md

File metadata and controls

217 lines (170 loc) · 7.58 KB

Introduction to algebra

Erika Duan 2023-07-22

Summary

This tutorial introduces basic algebra concepts and illustrates some algebraic tricks, such as factorisation and working with inequalities, that are useful for solving mathematical problems related to calculus and statistical mathematics in later tutorials.

Elementary algebra

Elementary algebra, also referred to as just algebra, is commonly associated with tasks like Find x if 2x = 6. However, it is more useful to think of algebra as a form of expression that allows us to represent infinitely possible terms using a finite one.

For example, the terms 2x + y, 4x + 2y and 6x + 3y are equivalent and infinite variations of this expression exist, with the simplest being 2x + y. When we read the term 2x + y, we can intuit that 2 parts of x and 1 part of y are always required (usually to make up another quantity).

Mathematics involves being precise with descriptions, and it is much easier to write 2x + y than to write ‘all possible values where we have 2 parts of one component and one part of a different component’.

An algebraic term can therefore be decomposed into three components:

  • Variable(s): a variable is a varying quantity of an entity, usually represented by concise symbols such as x, y, z or x_i where i=1, \cdots, n.
  • Operator(s): the arithmetic operation applied to variables. For example, in additive models, the relationship between parameters y = b_o+b_1x_1 + \cdots + b_nx_n is additive and the dependent variable y therefore increases by +b_1 for per unit increase in x_1.
  • Relative quantity of variable(s): For example, let x represent the number of eggs and y represent the number of cups of sugar required to make a dessert. The term x + y describes a 1:1 ratio of eggs to sugar whereas the term 2x + y describes a 2:1 ratio of eggs to sugar and will result in a very different taste.

Simplifying algebraic terms

A few rules of algebraic manipulation are:

  • We can simplify product terms using product expansion. For example, 4(x + 2.5y) = 4x + 10y.
  • We cannot further simplify a term if it is the input of another mathematical operator. For example, (4x + 10y)^2 = 6z \not\equiv (2x + 5y)^2 = 3z$.
  • We can add or subtract fractions by multiplying the fractions to form a common denominator. For example, \tfrac{3y}{x} + \tfrac{4x}{y} = \tfrac{3y^2 + 4x^2}{xy}.

::: panel-tabset ## R

# Solve algebraic term in R ----------------------------------------------------
4 <= 4
#> [1] TRUE

4 < 4
#> [1] FALSE

class(4 < 4)
#> [1] "logical"

Factorisation

Factorisation is the reverse process to product expansion and can be thought of as breaking down a fully expanded algebraic term into the product of its factors. For example, the factors of 10x + 2y are 2 and 5x + y as 10x + 2y = 2(5x + y).

The reason why factorisation is useful is that it allows us to solve for special function properties, for example to identify whether a quadratic function intersects the x-axis.

Quadratic equations with the form ax^2 + bx + c can be simplified through factorisation using:

Manipulating inequalities

Algebraic terms using inequalities are common when we want to prove the existence of an upper or lower bound. For example, if A is an event in the probability space, we know that the probability of event A occurring is between 0 and 1 inclusive i.e. 0 \leq P(A) \leq 1.

There are three rules for manipulating inequalities:

  • Adding or subtracting the same quantity from both sides of an inequality leaves the inequality symbol unchanged.
  • Multiplying or dividing both sides of an inequality by a positive number leaves the inequality symbol unchanged.
  • Multiplying or dividing both sides of an inequality by a negative number reverses the inequality symbol.

R

In R, inequality statements are outputted as Boolean values i.e. TRUE or FALSE.

# Compute inequality in R ------------------------------------------------------
4 <= 4
#> [1] TRUE

4 < 4
#> [1] FALSE

class(4 < 4)
#> [1] "logical"

Python

In Python, inequality statements are also outputted as Boolean values i.e. True or False.

# Compute inequality in Python -------------------------------------------------
4 <= 4
#> True 
type(4 <= 4)
#> <class 'bool'>  

Julia

In Julia, inequality statements are also outputted as Boolean values i.e. true or false.

# Compute inequality in Julia --------------------------------------------------
4 <= 4
#> true 

typeof(4 <= 4) 
#> true
#> Bool

a = 1
b = 2
c = 3

a < b, a + c < b + c
#> (true, true) 

Resources

  • Entry on algebra from the Stanford Encyclopedia of Philosophy.
  • Khan academy YouTube series on algebra basics.
  • A factsheet on manipulating inequalities from the Uk Maths Centre.