Omni Calculator logo

Column Space Calculator

Created by Maciej Kowalski, PhD candidate
Reviewed by Dominik Czernia, PhD and Jack Bowater
Last updated: Jun 05, 2023


Welcome to Omni's column space calculator, where we'll study how to determine the column space of a matrix. The whole process is quite similar to how we calculate the rank of a matrix (we did it at our matrix rank calculator), but, if you're new to the topic, don't worry! We'll slowly go through all the theory and provide you with some examples. And we will not only find the column space, we'll give you the basis for the column space as well!

So sit back, pour yourself a nice cup of tea, and let's get to it!

What is a matrix?

The first time we learned about matrices was way back in primary school. Yes, that's right! You've known them all this time without even realizing it.

At first, we counted apples and bananas using our fingers. Then they taught us to add and subtract the numbers, and still fingers proved the superior tool for the task. If nothing else, they're very handy wink wink.

But then multiplication barged its way into the picture, and everything got a little more complicated. Even if we took off our shoes and started using our toes as well, it was often not enough. Those big-headed scientists... why did they invent so many numbers?

Still, there is this simple tool that came to the rescue - the multiplication table. And that was the first matrix of our lives! (Unless you'd already seen the movie by that time, which we don't recommend at that age.)

1\boldsymbol{\cdot1}

2\boldsymbol{\cdot2}

3\boldsymbol{\cdot3}

4\boldsymbol{\cdot4}

5\boldsymbol{\cdot5}

6\boldsymbol{\cdot6}

7\boldsymbol{\cdot7}

8\boldsymbol{\cdot8}

9\boldsymbol{\cdot9}

10\boldsymbol{\cdot10}

1\boldsymbol{1\cdot}

11

22

33

44

55

66

77

88

99

1010

2\boldsymbol{2\cdot}

22

44

66

88

1010

1212

1414

1616

1818

2020

3\boldsymbol{3\cdot}

33

66

99

1212

1515

1818

2121

2424

2727

3030

4\boldsymbol{4\cdot}

44

88

1212

1616

2020

2424

2828

3232

3636

4040

5\boldsymbol{5\cdot}

55

1010

1515

2020

2525

3030

3535

4040

4545

5050

6\boldsymbol{6\cdot}

66

1212

1818

2424

3030

3636

4242

4848

5454

6060

7\boldsymbol{7\cdot}

77

1414

2121

2828

3535

4242

4949

5656

6363

7070

8\boldsymbol{8\cdot}

88

1616

2424

3232

4040

4848

5656

6464

7272

8080

9\boldsymbol{9\cdot}

99

1818

2727

3636

4545

5454

6363

7272

8181

9090

10\boldsymbol{10\cdot}

1010

2020

3030

4040

5050

6060

7070

8080

9090

100100

A matrix is an array of elements (usually numbers) that has a set number of rows and columns. An example of a matrix would be:

A=(310211)A = \begin{pmatrix}3&-1\\0&2\\1&-1\end{pmatrix}

Moreover, we say that a matrix has cells, or boxes, into which we write the elements of our array. For example, matrix AA above has the value 22 in the cell that is in the second row and the second column. The starting point here are 1-cell matrices, which are, for all intents and purposes, the same thing as real numbers.

As you can see, matrices came to be when a scientist decided that they needed to write a few numbers concisely and operate with the whole lot as a single object. As such, they naturally appear when dealing with:

  • Systems of equations, especially with Cramer's rule, as we've seen at the Cramer's rule calculator;
  • Vectors and vector spaces;
  • 3-dimensional geometry (e.g., the dot product and the cross product);
  • Linear transformations (translation and rotation); and
  • Graph theory and discrete mathematics.

We can look at matrices as an extension of the numbers as we know them. After all, the multiplication table above is just a simple example, but, in general, we can have any numbers we like in the cells: positive, negative, fractions, decimals. If you're feeling especially brainy, you can even have some complex numbers in there too.

The usefulness of matrices comes from the fact that they contain more information than a single value (i.e., they contain many of them). Arguably, it makes them fairly complicated objects, but it's still possible to define some basic operations on them, like, for example, addition and subtraction

However, the possibilities don't end there! Matrices have an extremely rich structure. To illustrate this with an example, let us mention that to each such matrix, we can associate several important values, such as the determinant.

🙋 Our matrix determinant calculator teaches you all you need to know to calculate the most fundamental quantity in linear algebra!

But let's not dilly-dally too much. After all, we're here for the column space of a matrix, and the column space we will see! We have the basic object well-defined and understood, so it's no use wasting another minute - we're ready to go further!

Column space of a matrix

Believe it or not, the column space has little to do with the distance between columns supporting a building. Rather than that, we will look at the columns of a matrix and understand them as vectors. As such, they will be elements of Euclidean space, and the column space of a matrix will be the subspace spanned by these vectors.

To have something to hold on to, recall the matrix from the above section:

(310211)\begin{pmatrix}3&-1\\0&2\\1&-1\end{pmatrix}

It has two columns:

(301)\begin{pmatrix}3\\0\\1\end{pmatrix}

And:

(121)\begin{pmatrix}-1\\2\\-1\end{pmatrix}

In a more concise notation, we can write them as (3,0,1)(3, 0, 1) and (1,2,1)(-1, 2, -1). Note how a single column is also a matrix (as are all vectors, in fact). In this case, the array has three rows, which translates to the columns having three elements. As such, they are elements of three-dimensional Euclidean space.

The column space of a matrix AA is, as we already mentioned, the span of the column vectors v1\vec{v}_1, v2\vec{v}_2, v3\vec{v}_3, ..., vn\vec{v}_n (where nn is the number of columns in AA), i.e., it is the space of all linear combinations of v1\vec{v}_1, v2\vec{v}_2, v3\vec{v}_3, ..., vn\vec{v}_n, which is the set of all vectors ww of the form:

w=α1v1+α2v2+α3v3+...+αnvn\begin{split} w&=\alpha_1\cdot\vec{v}_1+\alpha_2\cdot\vec{v}_2\\ &+\alpha_3\cdot\vec{v}_3+...+\alpha_n\cdot\vec{v}_n \end{split}

Where α1\alpha_1, α2\alpha_2, α3\alpha_3, ...αn\alpha_n are any numbers. In our case, this means the space of all vectors:

w ⁣= ⁣α(3,0,1) ⁣+ ⁣β(1,2,1)w\!=\!\alpha\cdot(3,0,1)\!+\!\beta\cdot(-1,2,-1)

With α\alpha and β\beta set arbitrarily.

In fact, we can also define the row space of a matrix: we simply repeat all of the above, but exchange column for row everywhere. However, we'll not do that, and it's not because we're lazy. No, really, it's not that. Seriously.

In mathematics, the column space of a matrix is more useful than the row space. This is because when we look at an array as a linear transformation in a multidimensional space (a combination of a translation and rotation), then its column space is the image (or range) of that transformation, i.e., the space of all vectors that we can get by multiplying by the array.

If the above paragraph made no sense whatsoever, don't fret. We can leave it at "It's useful to know the column space of a matrix." The rest is in the details.

So why do we need the column space calculator? After all, the space is defined by its columns. Why use some fancy tool for that?

It may happen that, although the column space of a matrix with 44 columns is defined by 44 column vectors, some of them are redundant. Here's where the definition of the basis for the column space comes into play.

Basis for the column space

As we've mentioned at the end of the previous section, it may happen that we don't need all of the matrix' columns to find the column space. What we mean by this is that we can obtain all the linear combinations of the vectors by using only a few of the columns.

We call this notion linear dependence. We say that v1\vec{v}_1, v2\vec{v}_2, v3\vec{v}_3, ..., vn\vec{v}_n are linearly independent vectors if the equation:

0=α1v1+α2v2+α3v3+...+αnvn\begin{split} 0&=\alpha_1\cdot\vec{v}_1+\alpha_2\cdot\vec{v}_2\\ &+\alpha_3\cdot\vec{v}_3+...+\alpha_n\cdot\vec{v}_n \end{split}

(here 00 is the vector with zeros in all coordinates) holds if and only if α1=α2=α3=...=αn\alpha_1=\alpha_2=\alpha_3=...=\alpha_n. Otherwise, we say that the vectors are linearly dependent.

In essence, linear dependence means that you can construct (at least) one of the vectors from the others. If that's the case, then it's redundant in defining the span, so why bother with it at all? We can just forget about it.

The basis of the space is the minimal set of vectors that span the space. With what we've seen above, this means that out of all the vectors at our disposal, we throw away all which we don't need so that we end up with a linearly independent set. This will be the basis.

"Alright, I get the idea, but how do I find the basis for the column space?" Well, how nice of you to ask! We were just about to answer that!

To find the basis for the column space of a matrix, we use so-called Gaussian elimination (or rather its improvement: the Gauss-Jordan elimination). This algorithm tries to eliminate (i.e., make 00) as many entries of the matrix as possible using elementary row operations. They are:

  1. Exchange two rows of the matrix.
  2. Multiply a row by a non-zero constant.
  3. Add to a row a non-zero multiple of a different row.

For instance, say that you have a matrix of size 3×23\times 2:

(a1a2b1b2c1c2)\begin{pmatrix} a_1&a_2\\ b_1&b_2\\ c_1&c_2 \end{pmatrix}

If the first cell in the first row (in our case, a1a_1) is non-zero, then we add a suitable multiple of the top row to the other two rows, so that we obtain a matrix of the form:

(a1a20s20t2)\begin{pmatrix} a_1&a_2\\ 0&s_2\\ 0&t_2 \end{pmatrix}

Next, provided that s2s_2 is non-zero, we do something similar using the second row to transform the bottom one:

(a1a20s200)\begin{pmatrix} a_1&a_2\\ 0&s_2\\ 0&0 \end{pmatrix}

Lastly (and this is the extra step that differentiates the Gauss-Jordan elimination from the Gaussian one), we divide each row by the first non-zero number in that row. This gives an array in its so-called reduced row echelon form:

(1k20100)\begin{pmatrix} 1&k_2\\ 0&1\\ 0&0 \end{pmatrix}

🙋 The name may sound daunting, but we promise is nothing too hard. Visit our reduced row echelon form calculator to learn more!

Also, note how you don't have to do the Gauss-Jordan elimination yourself - the column space calculator can do that for you! Just open up the advanced mode and choose "Yes" under "Show the reduced matrix?".

We call the first 11's in each row the leading ones. The last thing to do here is read off the columns which contain the leading ones. These are the ones that form the basis for the column space.

Phew, that was a lot of time spent on theory, wouldn't you say? It's high time we leave the letters and see some example which actually have numbers in them.

Ready?

Example: using the column space calculator

Your dream has finally come true - you've bought yourself a drone! You can't wait to turn it on and fly around for hours (how many? find it out with our drone flight time calculator). However, apparently, before you start playing around, you have to input three vectors that will define the drone's movements.

It will only be able to fly along these vectors, so it's better to do it well. The worst-case scenario is that they will define a low-dimensional space, which won't allow us to move freely. After all, the world we live in is three-dimensional, so restricting ourselves to 2 is like only being able to turn left.

You close your eyes, flip a coin, and choose three vectors at random: (1,3,2)(1, 3, -2), (4,7,1)(4, 7, 1), and (3,1,12)(3, -1, 12). Note that each has three coordinates because that is the dimension of the world around us. Now, we'd better check if our choice was a good one, i.e., if their span is of dimension 33. Oh, how fortunate that we have the column space calculator for just this task!

Let's take a look at our tool. At the top, we have to choose the size of the matrix we're dealing with. We have three vectors (so we need three columns) with three coordinates each (so we need three rows). We choose these values under "Number of columns" and "Number of rows". This will trigger a symbolic picture of our chosen matrix to appear, with the notation that the column space calculator uses.

We need to input our three vectors as columns of the matrix. We see that the first one has cells denoted by a1a_1, b1b_1, and c1c_1. Looking back at our values, we input

a1=1b1=3c1=2\begin{split} a_1&=1\\ b_1&=3\\ c_1&=-2 \end{split}

Similarly, for the other two columns we have

a2=4b2=7c2=1\begin{split} a_2&=4\\ b_2&=7\\ c_2&=1 \end{split}

And:

a3=3b3=1c3=12 \begin{split} a_3&=3\\ b_3&=-1\\ c_3&=12 \end{split}

Once we input the last number, the column space calculator will spit out the answer: it will give us the dimension and the basis for the column space. But we're too ambitious to just take this spoiler of an answer for granted, aren't we? Let's grab a piece of paper and calculate the whole thing ourselves!

Example: how to calculate column space of a matrix by hand?

Let's continue our example. First of all, let's see how our matrix looks:

A=(1433712112)A=\begin{pmatrix} 1&4&3\\ 3&7&-1\\ -2&1&12 \end{pmatrix}

According to the instruction from the above section, we now need to apply the Gauss-Jordan elimination to AA. Since the first cell of the top row is non-zero, we can safely use it to eliminate the 33 and the 2-2 from the other two. Since 3+(3)1=03 + (-3)\cdot1 = 0 and 2+21=0-2 + 2\cdot1 = 0, we add a multiple of (3)(-3) and of 22 of the first row to the second and the third, respectively. This gives:

A=(1433+(3)17+(3)41+(3)32+211+2412+23)A=\begin{pmatrix} 1&4&3\\ 3+(-3)\cdot1 &7+(-3)\cdot4 &1+(-3)*3 \\ -2+2\cdot1&1+2\cdot4&12+2\cdot3 \end{pmatrix}

Which is:

A=(14305100918)A=\begin{pmatrix} 1&4&3\\ 0&-5&-10\\ 0&9&18 \end{pmatrix}

Next, we'd like to use the 5-5 from the middle row to eliminate the 99 from the bottom one. Since 9+(9/5)(5)=09 + (9/5) \cdot (-5) = 0, we add a multiple of 9/59/5 of the second row to the third one:

A=(143051009+(9/5)(5)18+(9/5)(10))A=\begin{pmatrix} 1&4&3\\ 0&-5&-10\\ 0&9+(9/5)\cdot(-5)&18+(9/5)\cdot(-10) \end{pmatrix}

Which is:

A=(1430510000)A=\begin{pmatrix} 1&4&3\\ 0&-5&-10\\ 0&0&0 \end{pmatrix}

Lastly, we divide each non-zero row of the matrix by its left-most number. In our case, this means that we divide the top row by 11 (which doesn't change a thing) and the middle one by 5-5:

A=(14305/(5)10/(5)000)=(143012000)\begin{split} A &= \begin{pmatrix} 1&4&3\\ 0&-5 / (-5)&-10 / (-5)\\ 0&0&0 \end{pmatrix}\\ &=\begin{pmatrix} 1&4&3\\ 0&1&2\\ 0&0&0 \end{pmatrix} \end{split}

Our end matrix has leading ones in the first and the second column. This means that the column space is two-dimensional and that the two left-most columns of AA generate this space. In our case, this means that the basis for the column space is: (1,3,2)(1, 3, -2) and (4,7,1)(4, 7, 1).

Well, that is precisely what we feared - the space is of lower dimension than the number of vectors. We can't have our drone flying only in two directions... It'd be best if we change one of the vectors slightly and check the whole thing again. Oh, how lucky we are that we have the column space calculator to save us time!

Maciej Kowalski, PhD candidate
Number of rows
3
Number of columns
2
A=
a1a2
|b1b2
c1c2
First row
a₁
a₂
Second row
b₁
b₂
Third row
c₁
c₂
Result
A=|
Check out 35 similar linear algebra calculators 🔢
Adjoint matrixCharacteristic polynomialCholesky decomposition… 32 more
People also viewed…

Black Friday

How to get best deals on Black Friday? The struggle is real, let us help you with this Black Friday calculator!

Circumference

Use this free circumference calculator to find the area, circumference and diameter of a circle.

Equivalent fractions

The equivalent fractions calculator works out a list of fractions equivalent to the input. It can also tell you if two particular fractions are equivalent or not.

Powers of i

The powers of i calculator will help you raise the imaginary unit to any power you want.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service