Skip to content

Linear Algebra

Notes

1. Lines: slope and intercept

\(y = mx + c\)

  • \(m\) : slope from x-axis
  • \(c\) : intercept from y-axis

TODO: Figure/playground of lines

- \(c<0\) \(c=0\) \(c>0\)
\(m<0\)
\(m=0\)
\(m>0\)

2. Line as a function

\(y = mx + c\)

\(y = line(x; m,c)\)

[aside: sometimes represented as \(line(x, \Theta)\)]

import numpy as np

m, c = 1, 0
x = np.arange(10)

def line(x, m, c):
    return x * m + c

y = line(x, m, c)

class Line:
    def __init__(m, c):
        self.m, self.c = m, c

    def forward(self, x):
        return x * self.m + self.c

ll = Line(m, c)
y  = ll(x)

3a. Aside: Non-lines

\(y = m \times \mbox{sin}(x) + c\)

  • Are there any similarities?
  • Now is the geometry useful?

4. How to represent the y axis?

What are \(m\) and \(c\)?

  • Impossible to express as \(y = mx + c\)
  • Need to 'invert' the dependent and independent variables \(x = my + c\)

5. How to decide which is the independent variable

  • x axis
  • y axis
  • circle?

5a. Functions and relations

name from to
bijection one one
injection many one
surjection? one many
relation many many
  • Seems mathematicians have objections to using just simple expressions

6. Solutions to equations

6a. Point and Point

Given points \(P\), \(Q\), and constants \(a, b, c, d\):

  • \(P := (a, b)\)
  • \(Q := (c, d)\)

Equation: \(P = Q\)

  • What does this mean?
  • How many solutions exist?
  • What are the solutions?
  • What are we solving for?

So, let us introduce some variables:

Given points \(P\), \(Q\), constants \(a, b\) and variables \(x, y\):

  • \(P := (a, b)\)
  • \(Q := (x, y)\)

Equation: \(P = Q\)

  • What does this mean?
  • How many solutions exist?
  • What are the solutions?

6b. Point and Line

For the following cases, we set \(c = 0\). For the following cases, assume \(c = 0\).

Case 1:

Given point \(P\), line \(Q\), constants \(a, b, m\), variables \(x, y\):

  • \(P := (a, b)\)
  • \(Q := (m \times x, m \times y)\)

Equation: \(P = Q\)

  • What does this even mean?
  • What are we solving for?
  • How many solutions exist?
  • What are the solutions?

6c. Line and Line

This is the most interesting case.

Case 1:

Given line \(P\), line \(Q\), constant \(m\), variables \(x, y\):

  • \(P := (x, y)\)
  • \(Q := (m \times x, y)\)

Equation: \(P = Q\)

  • What does this even mean?
  • What are we solving for?
  • How many solutions exist?
  • What are the solutions?

Case 2:

Given line \(P\), line \(Q\), constants \(m, n\), variables \(x, y\):

  • \(P := (n \times x, y)\)
  • \(Q := (m \times x, y)\)

Equation: \(P = Q\)

  • What does this even mean?
  • What are we solving for?
  • How many solutions exist?
  • What are the solutions?

Case 3:

Given line \(P\), line \(Q\), constants \(m, n\), variables \(x, y\):

  • \(P := (n \times x, y)\)
  • \(Q := (m \times x, y)\)

Equation: \(P = Q\)

  • What does this even mean?
  • What are we solving for?
  • How many solutions exist?
  • What are the solutions?

Case 4: \(c = 1\)

Given line \(P\), line \(Q\), constants \(m, n\), variables \(x, y\):

  • \(P := (m \times x + c, y)\)
  • \(Q := (m \times x, y)\)

Equation: \(P = Q\)

  • What does this even mean?
  • What are we solving for?
  • How many solutions exist?
  • What are the solutions?

7. Taking to the other side

  • \(y = m \times x + c\)
  • \(y - c = m \times x\)
  • \(\frac{y - c}{m} = x\)

What is happening here, in terms of our tables?

  • What tables are we talking about?
  • What about geometrically?
  • So, what is the meaning of \(y = f(x) = 0\) for some \(f\)?

8. Solutions to inequalities

  • Above or below?
  • Left or right?

Equality vs Inequality

  • \(y < m \times x + c\)
  • \(y = m \times x + c\)
  • \(y > m \times x + c\)