Main content

### Course: Precalculus > Unit 7

Lesson 1: Introduction to matrices# Intro to matrices

Take the red pill and enter the Matrix! Created by Sal Khan.

## Want to join the conversation?

- Can a matrix have an expression or an equation? What about variables and complex numbers, can it have those too?(170 votes)
- Basically, a matrix is just a type of table. You can put in the cells whatever you like, but to preserve all the functionality of a matrix, it should be possible to multiply and add up each cell with any other.

For example, it would make little sense to multiply "y=x+1" with "j=3r".(178 votes)

- Is there a difference between the Scalar "1" and the Matrix [ 1 ] ?(92 votes)
- Yes it is like difference between the 1 apple and 1 basket with 1 apple :)

you have still the 1 apple, but you look at it as 2 different things. On left side, the "Scalar '1'" and on the right side you have 1 basket containing 1 apple: "Matrix [1]"(156 votes)

- Is it okay to have decimal numbers in matrices because every video you have has shown whole numbers inside of the matrices(31 votes)
- The examples use integers (whole numbers) because the math is less complicated so it makes it easier to explain without getting lost in more difficult calculations.

Yes, you can have decimals or fractions in a matrix. When you find the inverse of a matrix, you almost always have fractions (or decimals) in the resulting matrix.(45 votes)

- Hopefully this is the right place to ask this question. What are the elements of a matrix and how is it found?(27 votes)
- the elements of a matix are the numbers in the matrix. How are they found? - well, they just ARE. - you could create a matrix yourself...and that it how itd be "found"(19 votes)

- Didn't Sal spell the word " columns" wrong at1:21?(0 votes)
- Nikki,

Yes, at1:21he misspelled "columns" carelessly omitting the "n". Sal makes mistakes just like you or I do. None of us are perfect, even Sal. But at Khan Academy, we can keep trying to get closer to perfect. My careless math mistakes dropped substantially when I was forced to get 10 questions in a row correct to be proficient in a skill at Khan Academy.(69 votes)

- What is an "array"?(13 votes)
- An array is just a simple picture with rows and columns to represent a value of something.(6 votes)

- In a Matrix can there be varibles like x so 4 0

x 7 or not ?(8 votes)- Yes, and in some fields of mathematics, they are used often. Linear equations can be expressed as matrices:

4x + 2y = 3

2x -- y = 4

would be the matrix equation

| 4 2 | * | x | = | 3 |

| 2 -1 | | y | | 4 |

(I hope the formatting turns out on this. I'm a novice to commenting and am not sure how to display a matrix in-thread. If not, it's a 2x2 of 4, 2, 2, -1 times a 2x1 of x, y set equal to a 2x2 of 3, 4.)(17 votes)

- can you use pie or 3.14 in the matrix(5 votes)
- Luis,

You can use pi (π) in a matrix. In the first matrix in this video, Sal used π as the value in the second row, first column.

You can also use decimals such as 3.14.

3.14 is only an approximate value of π so if you used 3.14 when π was the exact value, you would be using a approximate value and not the exact value.

I hope that helps.(17 votes)

- My sister is a Math Major in college and she says that she has never used a Matrix before. Is a Matrix just helpufll but not required?(4 votes)
- Matrix math is, amongst other things, a means of compacting, streamlining and making more efficient, repetitive operations commonly encountered in applied math. You can probably get by without them, but I wouldn't recommend doing so.(6 votes)

- Can matrices also have imaginary numbers, or is it only for real numbers?(5 votes)
- A matrix CAN contain complex numbers! It can also contain functions, partial derivatives of functions and much more. The idea can be extended quite far.(7 votes)

## Video transcript

What I want to do
in this video is explore the notion
of a matrix outside of the context of a
surprisingly good movie that involves Keanu Reeves. And it's actually
the first of three. I guess we could call the three
movies combined The Matrices. And there is a relationship
between the movie, which is about a virtual
reality constructed by super-smart
computers, and the notion of what a matrix is when
you study it in mathematics, or when you study it
in computer science. And the connection
really is that matrices are used a lot when you
are simulating things or when you're constructing
things in computer science, especially in, frankly,
computer graphics. So the super-intelligent
robots that made the matrix in
the movie Matrix were probably using
matrices in order to do it, if they actually did exist. Now, what is a matrix then? Well, that's a
fairly simple answer. It's just a rectangular
array of numbers. So for example, this
right over here. If I have 1, 0, negative 7,
pi, 5, and-- I don't know-- 11, this is a matrix. This is a matrix where 1, 0,
negative 7, pi-- each of those are an entry in the matrix. This matrix right over
here has two rows. And it has three columns. And because it has two
rows and three columns, people will often say that
this is a 2 by 3 matrix. Whenever they say it's
something by something matrix, they're telling you that it has
two rows-- so you see the two rows right over there. And they are telling you
that it has three columns. You see the three
columns right over there. I could give you other
examples of a matrix. So I could have a 1 by 1 matrix. So I could have the matrix 1. This right over here
is a 1 by 1 matrix. It has one row, one column. I could have a matrix
like this-- 3, 7, and 17. What is this? Well, this has one row. This is the one row
that we see here. And it has three columns. This is a 1 by 3 matrix. I could have a matrix-- and I
think you see where all of this is going. Figuring out the dimensions of
a matrix are not too difficult. I could have a matrix that looks
like this, where it's 3, 5, 0, 0, negative 1, negative 7. This right over
here has three rows. So it's three rows,
and it has two columns. So we would call this a 3 by 2. Let me do that in
that same color. We would call it a 3
by 2 matrix, three rows and two columns. So fair enough. You know that a matrix is just
a rectangular array of numbers. You can say what
its dimensions are. You know that each
of these numbers that take one of these positions--
we just call those entries. But what are matrices good for? I still might not be
clear what the connection is between this and
this right over here. And at the most
fundamental level, this is just a
compact representation of a bunch of numbers. It's a way of
representing information. They become very valuable
in computer graphics because these numbers could
represent the color intensity at a certain point. They could represent
whether an object is there at a certain point. And as we develop an
algebra around matrices, and when we talk about
developing an algebra around matrices, we're going
to talk about operations that we're going to perform on
matrices that we would normally perform with numbers. So we're going to
essentially define how to multiply matrices,
how to add matrices. We'll learn about taking
an inverse of a matrix. And by coming up with an
algebra of how we manipulate these things, it'll
become very useful in the future when you're trying
to write a computer graphics program or you're trying to
do an economic simulation or a probability
simulation, to say, oh, I have this matrix
that represents where different particles
are in space. Or I have this matrix
that represents the state of some
type of a game. And I know the
algebra of matrices. And I know ways of doing
it very efficiently so that I can multiply
a bunch of them. Or I could come
run a simulation, and I can actually come
up with useful results. So that's all matrices are. But as you'll see
through this, we can define operations on them. And then later on, when
you take a linear algebra course in college, you'll
learn a lot more of the depth of how they can be
applied and what you can use them to represent.