Linear Algebra breakdown for beginners

The Language of Linear Algebra: Scalars and Vectors

Understanding vectors and scalars is crucial to mastering Linear Algebra. These two concepts form the building blocks of nearly all operations you’ll encounter. Let’s break them down in detail and explore their properties with real-world examples, visual aids, and exercises.


What Are Scalars?

A scalar is a single number, often representing a quantity that has no direction. It’s like the concept of “just a number” in basic math.

Examples of Scalars:

  • Temperature: 30°C (It tells you how hot it is but not the direction of heat flow.)
  • Speed: 60 km/h (It tells you how fast, but not which direction you’re going.)
  • Mass: 5 kg (It tells you the weight but doesn’t have a direction.)

In mathematical terms, a scalar is typically written as a lowercase letter (e.g., a, b, c) and belongs to the set of real numbers (R).


What Are Vectors?

A vector is a mathematical object that has two properties:

  1. Magnitude (Length): How long the vector is.
  2. Direction: Where the vector points.

Vectors are represented as ordered lists of numbers:

Real-world Examples of Vectors:

  • Wind velocity: 10 m/s east (The magnitude is 10 m/s, and the direction is east.)
  • Force: 50 Newtons at a 30° angle.
  • Movement in a video game: A player moves 5 steps left and 7 steps up (v=[−5, 7])

Adding, Subtracting, and Scaling Vectors

Vectors can be combined or manipulated in several ways. Let’s break these operations down with visuals and examples.


1. Adding Vectors

When you add two vectors, you combine their respective components:

Imagine you’re walking: first 3 steps right and 4 steps up (v1), then 1 step right and 2 steps up (v2). Adding them gives your total movement: 4 steps right and 6 steps up.

Visualization:
  • Plot v1 and v2 as arrows on a graph.
  • Draw the resulting vector by connecting the origin to the head of the second vector.

2. Subtracting Vectors

Subtracting vectors is like reversing the direction of the vector being subtracted and then adding:

Visualization:

Subtracting v2 from v1 is like flipping v2‘s direction, then adding it to v1.


3. Scaling Vectors

Scaling means multiplying a vector by a scalar (a single number). Scaling changes the vector’s length but not its direction.

Scaling stretches or shrinks the vector. If the scalar is negative, it flips the vector’s direction.


Visualizing Vectors in 2D and 3D

2D Vectors

  • A 2D vector is represented as an arrow in a flat plane.
  • Its components [x, y] define its horizontal (x) and vertical (y) movements.
Example:

Plot v=[3, 4]. The vector starts at the origin (0, 0) and ends at (3, 4).

3D Vectors

  • A 3D vector is represented in space with components [x, y, z], where zz represents the third dimension.
  • Think of it like plotting a point in a 3D video game.
Example:

Plot v = [2, 3, 1]. Start at (0, 0, 0) and move 2 units along the x-axis, 3 along the y-axis, and 1 along the z-axis.


Exercises: Drawing and Manipulating Vectors

Add and Subtract Vectors: Given v1 = [4, 2] and v2 = [−1, 3]:

  • Add v1 + v2
  • Subtract v1 v2

Scale a Vector: Scale v = [3, −2] by:

  • a = 2
  • a = −1

Plot Vectors:

  • Plot v = [5,−2] on a graph.
  • Multiply it by 0.5 and 2, and plot the scaled versions.

Explore 3D: Plot the vectors [2, 3, 1] and [−1, 4, 2]. Visualize their addition.

Answer:

The plots have been generated:

  1. 2D Vectors and Their Scaled Versions:
    • The original vector v = [5,−2] is shown in blue.
    • The scaled version 0.5 ⋅ v is shown in green.
    • The scaled version 2 ⋅ v is shown in red.
  2. 3D Vectors and Their Addition:
    • The vector v1 = [2, 3, 1] is shown in blue.
    • The vector v2 = [−1, 4, 2] is shown in green.
    • Their sum v1 + v2 = [1, 7, 3] is shown in red.
Go Back