Linear Algebra Before the Mathematics: Understanding Vectors, Basis, Dimensions, and Geometry
Imagine you are standing in a room.
You can move forward, backward, left, right, up, or down. Every position you reach can be described using three numbers.
For example:
- 3 steps forward
- 2 steps to the right
- 1 step upward
We can represent this movement mathematically as:
v = (3, 2, 1)
You have just encountered a vector!
This simple idea is at the heart of linear algebra.
Linear algebra is not just about solving equations or multiplying matrices. It is the mathematics of vectors, spaces, directions, relationships, and transformations.
It provides the mathematical foundation for machine learning, computer vision, deep learning, robotics, computer graphics, and scientific computing.
But before exploring these applications, we need to understand some fundamental concepts.
Let’s build our understanding from the ground up.
1. What is a Scalar?
A scalar is simply a single numerical value.
Examples:
- Temperature = 30°C
- Height = 170 cm
- Speed = 60 km/h
- Weight = 65 kg
A scalar tells us the magnitude or amount of something.
For example, if I say:
The temperature is 30°C.
I have given you one numerical value.
Mathematically, we represent a scalar using a single number:
a = 30
That’s it!
A scalar does not represent a direction in space. It represents only a numerical quantity.
2. What is a Vector?
Now imagine I tell you:
Walk 5 metres.
Is that enough information?
Not really!
You know how far to walk, but you don’t know in which direction.
Now consider:
Walk 5 metres towards the north.
This gives you two pieces of information:
- Magnitude: 5 metres
- Direction: North
This is the intuition behind a vector.
A vector represents a quantity that has both magnitude and direction.
For example:
v = (3, 4)
This vector tells us to move:
- 3 units along the horizontal axis.
- 4 units along the vertical axis.
The magnitude of this vector can be calculated using the Pythagorean theorem:
‖v‖ = √(3² + 4²)
‖v‖ = √25 = 5
So, the vector has a magnitude of 5 units.
An important distinction:
A vector is not merely a collection of numbers. It represents a mathematical object that can describe direction and magnitude, or more generally, an element of a vector space.
The numbers we write are its coordinates in a particular basis.
3. Understanding the Coordinate System
How do we describe the position of an object?
We use a coordinate system.
In two dimensions, we have two axes:
- X-axis: Horizontal direction
- Y-axis: Vertical direction
A point can be represented as:
P = (3, 4)
This means:
- Move 3 units along the X-axis.
- Move 4 units along the Y-axis.
The point (3, 4) describes a location.
The vector (3, 4), when drawn from the origin, describes a displacement.
Although they may look identical numerically, a point and a vector represent different mathematical ideas.
This distinction becomes important when we study geometry and transformations.
4. What is a Vector Space?
Now comes one of the most important ideas in linear algebra.
Imagine a collection of vectors.
For example:
v₁ = (1, 2)
v₂ = (3, 4)
Can we add these vectors?
Yes!
(1, 2) + (3, 4) = (4, 6)
Can we multiply a vector by a number?
Yes!
2 × (1, 2) = (2, 4)
These operations allow us to create new vectors from existing vectors.
A vector space is a collection of mathematical objects called vectors, together with two operations:
- Vector addition.
- Scalar multiplication.
These operations must satisfy certain mathematical rules, such as associativity, distributivity, and the existence of a zero vector and additive inverses.
For example, the set of all two-dimensional real vectors is:
R² = {(x, y) | x, y ∈ R}
Similarly:
R³ = {(x, y, z) | x, y, z ∈ R}
Here:
- R¹ represents a one-dimensional real vector space.
- R² represents a two-dimensional real vector space.
- R³ represents a three-dimensional real vector space.
A very important observation:
A vector space does not have to represent physical space. It can also represent polynomials, functions, signals, or even high-dimensional feature representations in machine learning.
5. What is a Linear Combination?
Suppose we have two vectors:
v₁ = (1, 0)
v₂ = (0, 1)
Now multiply them by two scalar values, say 3 and 4.
We get:
3v₁ = (3, 0)
4v₂ = (0, 4)
Adding them:
3v₁ + 4v₂ = (3, 4)
This process is called a linear combination.
In general:
v = a₁v₁ + a₂v₂ + … + aₙvₙ
Here:
- v₁, v₂, …, vₙ are vectors.
- a₁, a₂, …, aₙ are scalar coefficients.
- v is the resulting vector.
Why is this important?
Because many concepts in linear algebra are built around one fundamental question:
Can we construct a particular vector using a combination of other vectors?
This question leads us to span and basis.
6. What is Span?
Let’s return to our two vectors:
v₁ = (1, 0)
v₂ = (0, 1)
We already saw that:
3v₁ + 4v₂ = (3, 4)
But we can also construct:
2v₁ + 5v₂ = (2, 5)
-1v₁ + 3v₂ = (-1, 3)
0v₁ + 0v₂ = (0, 0)
Notice something interesting.
By combining these two vectors using different scalar values, we can generate every possible vector in two-dimensional space.
The collection of all possible linear combinations of a set of vectors is called their span.
Mathematically:
Span(v₁, v₂) = {a₁v₁ + a₂v₂ | a₁, a₂ ∈ R}
For our example:
Span((1, 0), (0, 1)) = R²
This means these two vectors can generate the entire two-dimensional plane.
Now consider another example:
v₁ = (1, 2)
v₂ = (2, 4)
Notice that:
v₂ = 2v₁
Both vectors point in the same direction.
No matter how we combine them, we can generate only vectors along the same line.
Therefore:
Span(v₁, v₂) = a line in R².
This is a crucial geometric insight:
The span tells us how much of a space our vectors can generate.
7. What is Linear Independence?
Let’s examine two sets of vectors.
Set A
v₁ = (1, 0)
v₂ = (0, 1)
These vectors point in different directions.
Neither can be generated by multiplying the other by a scalar.
They are linearly independent.
Set B
v₁ = (1, 2)
v₂ = (2, 4)
Here:
v₂ = 2v₁
The second vector does not provide any new direction.
It is redundant.
These vectors are linearly dependent.
Mathematically, a set of vectors is linearly independent if:
a₁v₁ + a₂v₂ + … + aₙvₙ = 0
has only the trivial solution:
a₁ = a₂ = … = aₙ = 0
If a non-zero combination of coefficients can produce the zero vector, the vectors are linearly dependent.
Why should we care?
Because linear independence tells us whether every vector in a collection contributes a genuinely new direction or whether some vectors are redundant.
This idea is particularly useful in feature selection, dimensionality reduction, and solving systems of equations.
8. What is a Basis?
Now we arrive at one of the most beautiful concepts in linear algebra.
Imagine you want to describe every possible position on a two-dimensional plane.
What is the minimum number of independent directions you need?
Two!
We can use:
e₁ = (1, 0)
e₂ = (0, 1)
These two vectors allow us to represent every point in the plane.
For example:
(5, 3) = 5e₁ + 3e₂
The vectors e₁ and e₂ form a basis for R².
A basis is a set of vectors that satisfies two conditions:
- The vectors are linearly independent.
- They span the entire vector space.
In simple words:
A basis is a minimum independent set of directions that can generate every vector in a space.
Let’s understand this with a familiar analogy.
Imagine a city map.
You can describe every location using two independent directions:
- East–West
- North–South
You do not need hundreds of directions to describe every location.
Two independent directions are sufficient.
That is the intuition behind a basis.
9. Can a Basis Be Different?
Yes!
This is an interesting property.
We usually use the standard basis:
e₁ = (1, 0)
e₂ = (0, 1)
But consider:
b₁ = (1, 1)
b₂ = (1, -1)
These two vectors are also linearly independent.
They can generate every vector in R².
Therefore, they also form a basis.
This means the same vector space can have different bases.
The underlying space does not change. Only the directions we use to describe it change.
For example, consider:
v = (4, 2)
Using the standard basis:
v = 4(1, 0) + 2(0, 1)
Using the alternative basis:
v = 3(1, 1) + 1(1, -1)
Both representations describe the same vector.
The coordinates depend on the chosen basis.
This is one of the most important ideas to understand before learning coordinate transformations.
10. What is Dimension?
If a basis tells us the independent directions required to describe a space, dimension tells us how many such directions are needed.
Examples:
The dimension of a vector space is the number of vectors in any basis of that space.
Notice that dimension is not necessarily the number of coordinates we initially see.
For example, consider three vectors in R³:
v₁ = (1, 0, 0)
v₂ = (0, 1, 0)
v₃ = (1, 1, 0)
Although each vector has three coordinates, all three lie in the XY-plane.
Also:
v₃ = v₁ + v₂
Therefore, only two independent directions exist.
Their span has dimension 2, not 3.
This introduces another important concept: the dimension of a vector space depends on its independent directions, not simply on the number of vectors listed.
11. What is a Subspace?
A subspace is a smaller vector space contained within a larger vector space.
Imagine the entire three-dimensional space, R³.
Now consider all vectors whose Z-coordinate is zero:
W = {(x, y, 0) | x, y ∈ R}
This represents the XY-plane.
The XY-plane is a subspace of R³.
Why?
Because:
- It contains the zero vector.
- Adding two vectors from the plane produces another vector in the plane.
- Multiplying a vector in the plane by any scalar keeps it in the plane.
These are the three essential conditions for a non-empty subset to be a subspace.
A line passing through the origin is also a subspace.
However, a line that does not pass through the origin is not a subspace.
Why?
Because it does not contain the zero vector.
This is a small but important detail.
12. What is Orthogonality?
Consider two vectors:
v₁ = (1, 0)
v₂ = (0, 1)
They meet at a right angle.
We call them orthogonal.
In linear algebra, two vectors are orthogonal if their dot product is zero.
The dot product is calculated as:
v₁ · v₂ = (1 × 0) + (0 × 1)
v₁ · v₂ = 0
Therefore, the vectors are orthogonal.
In general:
u · v = u₁v₁ + u₂v₂ + … + uₙvₙ
If:
u · v = 0
the two vectors are orthogonal.
Why is orthogonality useful?
Orthogonal vectors represent independent perpendicular directions in geometry.
They are particularly important in:
- Projection.
- Least squares.
- Principal Component Analysis (PCA).
- Signal processing.
- Feature representation.
13. What is an Orthonormal Basis?
We already know that a basis consists of linearly independent vectors that span a space.
Now imagine that the basis vectors also satisfy two additional properties:
- They are mutually orthogonal.
- Each vector has a magnitude of 1.
Such a basis is called an orthonormal basis.
For example:
e₁ = (1, 0)
e₂ = (0, 1)
These vectors are orthogonal, and both have unit length.
Therefore, they form an orthonormal basis for R².
Why is this useful?
Because calculations become much simpler.
For example, when projecting a vector onto an orthonormal basis vector, we can directly use the dot product.
Orthonormal bases are central to Fourier analysis, PCA, QR decomposition, and many numerical algorithms.
14. What is a Matrix?
Now that we understand vectors and vector spaces, we can introduce matrices.
A matrix is a rectangular arrangement of numbers.
For example:
A = [[2, 1], [1, 3]]
We can represent it more conventionally as:
A =
[ 2 1 ]
[ 1 3 ]
A matrix can represent a linear transformation.
For example, consider:
v = (1, 2)
and:
A =
[ 2 0 ]
[ 0 3 ]
Multiplying:
Av = (2, 6)
The matrix has transformed the original vector by:
- Doubling its horizontal component.
- Tripling its vertical component.
This is the geometric interpretation of matrix multiplication.
A matrix is not merely a table of numbers. It can describe how vectors are transformed, rotated, scaled, reflected, or projected.
We will explore these transformations in detail in a separate article.
15. What is the Connection to Machine Learning?
Now let’s connect everything to something practical.
Imagine a machine learning model that processes an image.
An image can be represented as a collection of pixel values.
A neural network transforms these values into numerical representations called feature vectors.
For example:
x = (0.2, 0.8, 0.5, 0.1)
This is a vector in a four-dimensional feature space.
Similarly, a speaker recognition model may represent a speech utterance using a 192-dimensional embedding.
That embedding can be written as:
x ∈ R¹⁹²
Each dimension represents a coordinate in the learned feature space.
The model learns representations in which useful relationships can be captured through geometric and statistical operations.
Concepts such as:
- Vector magnitude help us understand normalization.
- Dot products help us calculate similarity.
- Linear independence helps us understand redundancy.
- Basis helps us understand coordinate representations.
- Dimension helps us understand feature spaces.
- Orthogonality helps us understand decorrelation.
- Matrices help us understand transformations.
Even PCA, one of the most widely used dimensionality reduction techniques, relies heavily on these concepts.
This is why linear algebra is not just a mathematical subject. It is one of the languages through which machine learning operates.
16. A Quick Revision: The Big Picture
Let’s summarize the concepts we have explored.
Final Thoughts
Linear algebra becomes much easier when we stop looking at it as a collection of formulas and start looking at it as a way of understanding space.
A vector represents something in a space.
A linear combination allows us to construct new vectors.
A span tells us what we can construct.
Linear independence tells us whether our directions are redundant.
A basis gives us the minimum independent directions required to represent the entire space.
And dimension tells us how many such directions exist.
These ideas form the foundation for almost everything that follows in linear algebra.
Before learning how to multiply matrices, understand what they transform. Before learning eigenvectors, understand what vectors represent. Before learning PCA, understand dimensions, basis, and orthogonality.
Mathematics becomes much more intuitive when we understand the ideas before memorizing the equations.
And that is exactly where our journey into linear algebra begins.
In the next article, we will explore vector operations in detail — addition, subtraction, scalar multiplication, dot product, and projections — with geometric intuition and numerical examples.

