Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1.1: What is linear algebra?

Welcome to Math 124! The title of the course is Vectors, Matrices, and Applications. Vectors and matrices are the central objects of study in linear algebra, a branch of mathematics that has applications that touch all aspects of our daily lives.

We’ll introduce vectors in Chapter 1.4, and matrices in Chapter 3. For now, let’s start with an object that you are already familiar with: a line.


Constant rate of change

Lines

Consider the equation

y=2x+1.y=2x+1.

This equation represents a line in slope-intercept form, y=mx+by = mx+b, with a slope of 2 and a yy-intercept of 1.

Image produced in Jupyter

Draw your attention to the fact that this line’s rate of change is constant:

  • From x=1x=1 to x=2x=2, the value of yy increases by 2.

  • From x=6x=6 to x=7x=7, the value of yy also changes by 2.

  • From x=2x=2 to x=6x=6, the value of yy changes by 8, which is 62=46 - 2 = 4 times the amount it changed when we varied the xx-value by 1.

This constant rate of change, or flatness, is what we want you to associate with linear objects.

Note: For reasons we will see later in the term, the line y=2x+1y = 2x + 1 is technically not a linear function, which is a formal term. Why? It does not pass through the origin, (0,0)(0, 0), as a result of it having a yy-intercept of 1 rather than 0. Keep that thought at the back of your mind for now.

Planes

How does the idea of “flatness” extend from two dimensions to three? The natural extension of a line in 2D is a plane in 3D, like

z=2x3y.z = 2x - 3y.
Loading...

A plane is a flat object in three dimensional space. Instead of one “slope” or rate of change, it has two: one in the xx-direction and one in the yy-direction. You should imagine this plane as being a flat sheet of paper, extending infinitely in all directions, floating above the ground (the xyxy-plane).

The plot above is interactive:

  • Rotate it so that the xx-axis increases from left to right. You should see that the plane is sloped up and to the right, because the coefficient on xx in

    z=2x3yz = 2x - 3y

    is positive.

  • Now, rotate it so that the yy-axis increases from left to right. You should now see that the plane is sloped down and to the right (and more steeply than the xx-slope increases), because the coefficient on yy in the equation for the plane is negative.


Why study linear algebra?

But, you may ask, why do we care so much about flat objects with constant rates of change? Lots of real-world problems involve non-constant rates of change. One example you may remember is from kinematics in physics: the position x(t)x(t) at time tt of an object with an initial position of x0x_0, initial velocity of v0v_0, and constant acceleration of aa is

x(t)=x0+v0t+12at2.x(t) = x_0 + v_0t + \frac{1}{2}at^2.

The rate of change of position is not constant anytime a0a \neq 0 – when you accelerate in your car, for example, you are speeding up.

Real engineering systems are messy, even messier than this example from kinematics. Materials bend, air becomes turbulent, sensors saturate, and people behave unpredictably. Why should linear algebra help? We have two answers.

First, linear relationships can model complex phenomenon.
Sometimes, the complexity of a system comes from the fact that there are several variables, but connected by simple linear constraints, e.g. the forces acting upon an object must sum to 0 if it is not moving. One such relationship may be easy. Hundreds of them occurring simultaneously produce a system of linear equations. Linear algebra gives us a way to organize the whole system and reason about all of its unknown quantities at once.

Second, we can find linear approximations of nonlinear relationships.
A curved road is not straight. But if we zoom in around one point, a short piece of it may look almost like a line. See this visualized below: if you hover over the graph with your mouse or finger, you will see buttons that allow you to zoom in and out. If we zoom in close enough, the degree 5 polynomial (which has lots of bends and is non-linear) looks just like its tangent line!

Loading...

The same idea works for far more complicated systems: even when a system is nonlinear overall, if we zoom in enough, its behavior can often be approximated by something linear. Constructing and understanding these local approximations is one of the major ideas of calculus, which you will study in Math 125. Linear algebra is not merely a part of calculus, though. It also studies linear systems directly and gives us the language needed to work with many variables at once.


Engineering applications

Let us show you a few examples of how linear algebra can be applied to real problems from various engineering domains.

Example 1: Water flow

When you turn on a faucet in your kitchen or bathroom, water appears almost immediately. But before it reaches your sink, that water has traveled through a surprisingly complex network of reservoirs, pumps, pipes, and junctions. Engineers designing these systems need to make sure that enough water can flow through the network to meet demand throughout the city.

To illustrate, consider the small water network below. Water enters at junction AA and travels through three pipes:

  • 47 liters per second (L/s) enters the network at AA;

  • 14 L/s leaves the network at BB (say, to a neighborhood that has its own water control system);

  • 33 L/s leaves the network at CC;

  • xx, yy, and zz are the flows through the three internal pipes;

  • a flow meter tells us that z=8z=8 L/s.

Image produced in Jupyter

At each junction, the total amount of water flowing in must be the same as the total amount of water flowing out. In other words, all of the water in the system must be accounted for.

Key idea: the system above obeys a system of linear equations! We can use this system to determine the rate of flow from AA to BB (xx) and from AA to CC (yy).

  • At junction AA, the incoming water splits between the two outgoing pipes. Since the flow into AA is 47 L/s and the flow out of AA is x+yx+y, we must have

    x+y=47.x+y = 47.
  • At junction BB, the incoming flow xx splits into the measured flow zz and the 14 L/s that leaves the network:

    x=z+14.x = z+14.
  • At junction CC, the flows yy and zz combine before 33 L/s leaves the network:

    y+z=33.y+z=33.

Thus, conservation turns the engineering problem into the linear system

x+y=47,xz=14,y+z=33.\begin{aligned} x+y&=47,\\ x-z&=14,\\ y+z&=33. \end{aligned}

The meter reading z=8z=8 can be plugged into the second and third equations to tell us that

x=22,y=25.x=22, \qquad y=25.

Notice that the three conservation equations are not independent: the third equation comes from subtracting the second equation from the first. This is because the total inflow, 47 L/s, equals the total outflow, 14+33=4714+33=47 L/s. Without the meter reading for zz, conservation alone would leave many possible internal flows. This is the type of question we will use linear algebra to answer: do we have enough information to uniquely determine every unknown?

Now imagine we have tens of thousands of such junctions, resulting in tens of thousands of equations. Linear algebra is the tool for solving such problems. Here, the example involve water conservation – flow in equals flow out – but similar rules appear all throughout science and engineering, resulting in similar systems in a variety of domains.

Example 2: Robotic arms

Suppose we have a robotic arm, consisting of two segments: an upper arm (between the shoulder and elbow) and a forearm (between the elbow and hand). Suppose the two segments have lengths l1l_1 and l2l_2, respectively, and that the shoulder angle is θ1\theta_1 and elbow angle is θ2\theta_2. A diagram of what this may look like is below. It is interactive: drag the sliders to change the angles!

Loading...

Assuming the segment lengths are constant, the only way to move the robot’s hand is to move the two angles, θ1\theta_1 and θ2\theta_2. See if you can tweak θ1\theta_1 and θ2\theta_2 above to move the robot’s hand to the target!

This problem – of figuring out how to configure a robot so that one of its endpoints reaches a fixed target – is called inverse kinematics. Given some target (x,y)\color{orange} (x^*, y^*), solving for the angles θ1\theta_1 and θ2\theta_2 that reaches it involves trigonometry. We won’t work out this entire calculation here (take a robotics class if you’re interested!), but to give you a sense of what it would involve, the coordinates of the elbow are

(xelbow,yelbow)=(l1cosθ1,l1sinθ1).(x_\text{elbow}, y_\text{elbow}) = (l_1 \cos \theta_1, l_1 \sin \theta_1).

The relationship between the position of the robot’s hand and the angles θ1\theta_1 and θ2\theta_2 is non-linear, because it contains sines and cosines. For the two-arm setup above, there is a formula for the direct solution. But a real-world robot in 3D has many more knobs to control: it may be able to move up and down, rotate, extend its arm, and so on. Solving this complex system of equations is often infeasible.

The practical solution involves approximating the system with a linear system of equations which is easier to solve, regardless of how many variables are at play. There isn’t always a solution – for instance, you might imagine a target that is out of reach – and if there is a solution, it may not be unique. These are the types of problems we will study in this course. For our two-arm system, that linear approximation may look something like

x=aθ1+bθ2y=cθ1+dθ2{\color{orange} x^*} = a \theta_1 + b \theta_2 \\ {\color{orange} y^*} = c \theta_1 + d \theta_2

where aa, bb, cc, and dd are constants that depend on the problem (e.g. the lengths of the segments).

Example 3: Image compression

We will formally define a matrix in Chapter 3. For now, think of it as a table consisting of rows and columns, with each entry containing a number.

A greyscale image – that is, a black and white image without color – can be viewed as a matrix, where the number at each position in the matrix tells us how bright or dark that pixel is. This is called the pixel’s intensity. A common scale to use is 0 to 255, where 0 means the pixel is black, 255 means the pixel is white, and values in between are grey. 26 is a very dark grey, and 200 is a light grey. (As you will see in Homework 1, a colored image can be stored similarly, with 3 separate intensities describing each pixel – one for red, one for green, and one for blue.)

Here’s a simple 40x4040 x 40 greyscale image of a block M. Hover over a pixel to see its coordinates and intensity.

Loading...

Here is a larger 240×320240\times320 grayscale image of Suraj’s dog Junior (240 being its width, 320 being its height). It contains

240320=76,800240\cdot320=76{,}800

pixels, each represented by one number between 0 and 255.

Loading...

Storing the entirety of Junior’s picture requires storing 76,80076{,}800 numbers.

What if we had to store a compressed version of it? Say, if our internet connection is poor and we’re limited in the file size we can send?

Linear algebra gives us a way to replace the original image matrix with a simpler low-rank approximation that can be stored more compactly. The rank of a matrix is a quantity we will study later in the semester. For now, think of the rank of a matrix as an integer that describes the amount of “information” in the matrix.

Below, you’ll see a slider for kk, the rank of the approximation. Smaller values of kk preserve only the broadest structure, and as kk grows, finer details return. At k=1k=1, what you’re seeing is the best possible approximation of the image of Junior, if we’re restricted to using only rank-1 matrices. In that image, you should notice that all of the columns follow the same general pattern.

Loading...

The original image has 76,80076{,}800 pixel values. A rank-kk approximation can be stored using roughly

(320+240+1)k=561k(320+240+1)k=561k

numbers! For k=20k=20, that is 11,22011{,}220 numbers instead of 76,80076{,}800, about 6.8 times fewer.

The approximation is not identical to the original image, but much of the recognizable structure remains. When we cover eigenvalues and eigenvectors in Chapter 9, we will lay out the foundations of the technique used here. The actual technique employed is called the singular value decomposition, which we will not cover in this course, but you will see in future linear algebra and engineering coursework.

Key takeaway

Hopefully these examples have given you a sense of the types of problems linear algebra can be used to solve. While each problem seemed different, what is shared is that they all involve lots of different numbers, with relationships and constraints between them. Linear algebra is the language for solving problems of this sort.

We are almost ready to introduce the first “main character” of linear algebra, the vector. But first, we need to remember the types of numbers one may encounter in the first place.

  • Chapter 1.2 introduces the languages of sets and set theory, which you will use both in Math 124 and throughout your time at Michigan and beyond.

  • Chapter 1.3 covers the various sets of numbers and their defining properties – the natural numbers, integers, rationals, reals, and so on.