Matrix Multiplication and Coordinate Systems

Student project for MA265



1. Matrix Multiplication

1.1 Definition

A matrix multiplication is the production of a new matrix from a pair of matrices.

Matrices can only multiply if the number of columns for the first matrix equals the number of rows for the second matrix.

For example

Multiplying AB

A ---> 3x2 matrix (3 is the # of rows, and 2 is the # of columns)

B ---> 2x3 matrix (2 is the # of rows, and 3 is the # of columns)

THEY DO CAN MULTIPLY!


The new matrix will have the rows of the first matrix and the columns of the second matrix.

For example

AB = C

A ---> "m x p"

B ---> "p x n"

Then C will be "m x n"



1.2 Dot Product

                  $ A= \left(\begin{array}{cccc}a1\\a2\\.\\.\\.\\an\end{array}\right) $        $ B= \left(\begin{array}{cccc}b1\\b2\\.\\.\\.\\bn\end{array}\right) $

A*B = a1b1 + a2b2 + ... + anbn

In order to make a matrix multiplication, there should be the operation of dot product between the rows of the first matrix and the columns of the second matrix. To fin the entry (a,b) in the new matrix, the sum of the products of the bth column in the second matrix and of the ath row in the first matrix.

For example

$ \left(\begin{array}{cccc}1&2\\3&4\end{array}\right) $ $ \left(\begin{array}{cccc}5&6\\7&8\end{array}\right) $

You take a11*b11 + a12*b21 and that's your c11.

(1)*(5) + (2)*(7) = 19

Then a11*b12 + a12*b22 = c12
(1)*(6) + (2)*(8) = 22


After no more columns, you move to the next row. Take a21*b11 + a22*b21 = c21

(3)*(5) + (4)*(7) = 43


And the last one in this case would be a21*b12 + a22*b22 = c22

(3)*(6) + (4)*(8) = 50


So, the new matrix would be $ \left(\begin{array}{cccc}19&22\\43&50\end{array}\right) $



1.3 Matrix Multiplication in the Real World


Matrix multiplication are used in many life situations. In fact this semester I had two classes where matrices where applied.

To solve for variables and to get probabilities are some of the main functions in the real world.

When you have equations, and need to solve for the unknown variables, a matrix multiplication and Rref let you do this.


For example

Equation 1 -------> 12x + 3y = 42

Equation 2 -------> 3x + 8y = 54

Equation 3 -------> 15x + y = 36


You can put them in a matrix multiplication like this: 

$ \left(\begin{array}{cccc}12&3\\3&8\\15&1\end{array}\right) $ $ \left(\begin{array}{cccc}x\\y\end{array}\right) $ $ = \left(\begin{array}{cccc}42\\54\\36\end{array}\right) $


You can verify that the equations and the matrix are equal by doing the dot product.

After doing the Rref: $ \left(\begin{array}{cccc}1&0&2\\0&1&6\\0&0&0\end{array}\right) $

You get that the variable x= 2 and y = 6 .



1.4 Matrix Multiplication Related to Other Classes.

I have known matrices for 1 year, and used them in four classes already. Matrices as told before work for many reasons and areas. Linear Algebra, Differential Equation, Stochastic Models, and Operational Investigation I. In many companies they use the matrix multiplication to get to how many output to produce, or how many employees to have. In Stochastic Models the main reason of matrices where probabilities, where with a Markov Chain, you get the probability of going from one step to another.


For example

In a discrete Markov Chain of 3 steps, you have the probability of 40% to staying from step 1 to step 1, 20% from going from step 1 to step 2, and 40% of going from step 3. 

Then from step 2 to step 1, it has 20%. From step 2 to stay in step 2, it has 30%. To go from step 2 to step 3 it has 50%.

Finally from step 3 to step 1, 60%, from step 3 to step 2 just 20%, and from step 3 to stay in step 3, 20%.

Where you get the matrix:

$ P =\left(\begin{array}{cccc}.4&.2&.4\\.2&.3&.5\\.6&.2&.2\end{array}\right) $


Exercise:

If they ask you, initially (k) it is in step 1, how many times on average does step 3 would be visit in (k+3)?

So, you need to add the entry p13 + (p13)^2 + (p13)^3. In other words, the average number of visits in k+1 would be p13, then you MULTIPLY the matrix times the same matrix and add the same entry. Again the same step but for k+3, where you take the matrix to the third.


$ P^2 =\left(\begin{array}{cccc}.44&.22&.34\\.44&.23&.33\\.4&.22&.38\end{array}\right) $ $ P^3 =\left(\begin{array}{cccc}.424&.222&.354\\.42&.223&.357\\.432&.222&.346\end{array}\right) $

Solution:

P13 + (P13)^2 + (P13)^3 = (.4) + (.34) + (.354) = 1.094 visits on average to state 3.

  • (P13 means entry in row 1, column 3 from P)




1.5 World Cup Problem


The following operation is equal to the amount of championships by Germany and Uruguay. Germany will be variable "x", and Uruguay will be variable "y".

Matrix Equation:

$ \left(\begin{array}{cccc}2&3\\6&8\end{array}\right) $ $ \left(\begin{array}{cccc}x\\y\end{array}\right) $ $ = \left(\begin{array}{cccc}12\\34\end{array}\right) $

You do the dot product and you get that:

2x + 3y = 12

6x + 8y = 34

  • Solving for this equation, you get that Germany has 3 World Championships and Uruguay just 2.

This is an easy example, but is just one of many problems that can be done with matrices multiplication's.



1.6 How I see It

I see matrix multiplication as something new in my life but that has a very positive use. Is not material that a middle school student knows, is something extra. But, at the same time is not that difficult. The process of solving these multiplications is with the same tools you have worked since a nine years old: multiplication, addition, subtraction, etc. Don't be scared because it is a matrix operation, just step by step, get going through the problem and you should not have a problem. The only problem is to know what to do next, and what to avoid. Because there are some properties to follow in matrix multiplication, where in 1.7 would be mentioned.


1.7 Properties


a) The first property is that it is associative:

A(BC) = (AB)C


b) The second property that it is distributive over matrix addition:

(A+B)C = AC + BC ....... A(B+C) = AB + AC


c) The third one is that it is compatible with scalar multiplication:

c(AB) = (cA)B = A(cB)



2. Coordinate System



2.1 A brief Intro

A coordinate system is used to determine where a point or a vector is in the space. The direction and magnitude can be also being shown. There are different types of dimensions, where R2 is the "x" and "y" axis, the most common one. The R3 is three dimensional, where is better known for "x", "y", and "z" axis. There are R4, R5, and so on, but the basic ones are the first two. Coordinate systems are thought in school at a early age, but each time, it gets harder. First you need to just choose points in the graph, and each time it gets more complex. In linear algebra, we use coordinate systems to talk about vectors. Vectors form matrices, so everything is related so far. With this vectors you should be able to understand what a basis, a span, and a subspace really are.



2.2 Uses in Life

The coordinate systems give a better representation of the space, and the locations of things. For example, the whole world has coordinates. To have precise locations of some places, experts use this coordinates of the world. The same happens with the universe, where some people called it a spherical coordinate system, where everything that exists is covered. Another use of real life vectors would be constructions, where you need to add the forces, and get the best design possible so that the building does not have problems in the future. But as this previous examples, also there are many more. If an airplane wants to land with out a problem, they should know the wind velocity and direction, as well the direction and velocity of the plane of course. 



2.3 Related to Other Classes

In many classes with have seen coordinate systems, but related to matrices, this one would be the first one. Most of the classes where coordinate systems where used, where math classes. But also some physics classes use this coordinates. Where the forces, magnitudes and directions need to be found or taken into account. In the classes of mechanics you also use them, because forces are very common. 



2.4 Fun example Imagine you are 5 kilometers to East from the origin, then you girlfriend/boyfriend is 8 kilometers to the North from the origin, and 3 kilometers to the West. How far is you girlfriend from you?

First you should need to graph the vectors, where the first one would be from (0,0) to (5,0). The second one should be from (0,0) to (-3,8). So you need to find the magnitude of the resultant vector.

Where it would be:

The square root of ((5-(-3))^2 + (0-8)^2)

> Square root of (8^2)+(-8)^2

> Square root of 64+64

> Square root of 128

> You are 11.313 kilometers away from her/him.'


2.5 How I see it
When I was a kid a teacher explained to me the coordinate system in a very basic, but easy way. Is just a system that humans created to give locations to stuff. This could be person, places, forces, etc. This includes position and direction. Obviously each time you advance through college you realize is not that easy. It includes lots of uses, and each time more complicated, like dealing with not real numbers. But after all, if you find the logic of it, it can be easier than you think. Imagine just a room, is the universe. Your closet is part of you room and you can have a coordinates just for the closet, but you can also have coordinates for the whole room. Or your floor, if you just count you floor, it would be a plane. But each time you involve more stuff, the space gets bigger.

This is the same with the universe, each times gets smaller: Universe --- Earth --- United States ---- Indiana ---- Purdue ---- Classroom ---- Floor.

At the end, it doesn't matter at what coordinates you are in, but always have a smile in your face.


Back to MA265 Fall 2011 Prof. Walther

Alumni Liaison

BSEE 2004, current Ph.D. student researching signal and image processing.

Landis Huffman