# matrix multiplication,

• Sep 7th 2010, 01:53 AM
craigmain
matrix multiplication,
Hi,

I have a matrix that looks like the following.
$\displaystyle A = \left[\begin{matrix} 3 & 9 \\ 5 & 2 \\ 1 & 4 \end{matrix}\right]$

by doing the following, I can add the two columns.

$\displaystyle \left[\begin{matrix} 3 & 9 \\ 5 & 2 \\ 1 & 4 \end{matrix}\right] * \left[\begin{matrix} 1 \\ 1 \end{matrix}\right] = \left[\begin{matrix} 12 \\ 7 \\ 5 \end{matrix}\right]$

My question is:

Is there any clever way to multiply columns in the matrix.

$\displaystyle \left[\begin{matrix} 3 & 9 \\ 5 & 2 \\ 1 & 4 \end{matrix}\right] * X = \left[\begin{matrix} 18 \\ 10 \\ 4 \end{matrix}\right]$

Can X be a matrix of any kind?

Regards
Craig.
• Sep 7th 2010, 02:11 AM
Debsta
X must be a 2 x 1 matrix. You could let it have elements a and b, and try solving simultaneously.
• Sep 7th 2010, 02:17 AM
Prove It
You need to take into account the dimensions of the matrix.

You know that for matrices $\displaystyle A$ and $\displaystyle B$, the number of columns in $\displaystyle A$ has to equal the number of rows in $\displaystyle B$ to be able to multiply them. And if $\displaystyle A$ has dimensions $\displaystyle m \times n$ and $\displaystyle B$ has dimensions $\displaystyle n \times p$, then $\displaystyle AB$ has dimensions $\displaystyle m \times p$.

So you have a $\displaystyle 3 \times 2$ multiplied by $\displaystyle X$ to give $\displaystyle 3 \times 1$.

That means $\displaystyle X$ has dimensions $\displaystyle 2 \times 1$.

There are two ways to solve this.

The first is to write $\displaystyle X$ as $\displaystyle \left[\begin{matrix}x\\y\end{matrix}\right]$ so that your equation is

$\displaystyle \left[\begin{matrix}3 & 9\\ 5 & 1\\ 1 & 4\end{matrix}\right] \left[\begin{matrix}x\\y\end{matrix}\right] = \left[\begin{matrix}18\\10\\4\end{matrix}\right]$.

Perform the multiplication on the LHS to get

$\displaystyle 3x + 9y = 18$
$\displaystyle 5x + y = 10$
$\displaystyle x + 4y = 4$.

Solve for $\displaystyle x$ and $\displaystyle y$.

The other way is to create a "pseudo-inverse" matrix.

If you have an equation

$\displaystyle A\mathbf{x} = B$

only square matrices have inverses, so to create a square matrix on the LHS, premultiply both sides by $\displaystyle A^T$.

$\displaystyle A^TA\mathbf{x} = A^TB$.

Since $\displaystyle A^TA$ is square, you can multiply both sides by its inverse (as long as it's invertible).

$\displaystyle A^TA\mathbf{x} = A^TB$

$\displaystyle (A^TA)^{-1}A^TA\mathbf{x} = (A^TA)^{-1}A^TAB$

$\displaystyle I\mathbf{x} = (A^TA)^{-1}A^TB$

$\displaystyle \mathbf{x} = (A^TA)^{-1}A^TB$.
• Sep 7th 2010, 02:27 AM
yeKciM
Quote:

Originally Posted by craigmain
Hi,

I have a matrix that looks like the following.
$\displaystyle A = \left[\begin{matrix} 3 & 9 \\ 5 & 1 \\ 1 & 4 \end{matrix}\right]$

by doing the following, I can add the two columns.

$\displaystyle \left[\begin{matrix} 3 & 9 \\ 5 & 1 \\ 1 & 4 \end{matrix}\right] * \left[\begin{matrix} 1 \\ 1 \end{matrix}\right] = \left[\begin{matrix} 12 \\ 7 \\ 5 \end{matrix}\right]$

My question is:

Is there any clever way to multiply columns in the matrix.

$\displaystyle \left[\begin{matrix} 3 & 9 \\ 5 & 1 \\ 1 & 4 \end{matrix}\right] * X = \left[\begin{matrix} 18 \\ 10 \\ 4 \end{matrix}\right]$

Can X be a matrix of any kind?

Regards
Craig.

this can be done :D

$\displaystyle \displaystyle \begin{bmatrix} a_{11} & a_{12}\\ a_{21} & a_{22} \\ a_{31} & a_{32} \end{bmatrix} \cdot \begin{bmatrix} b_{11} \\ b_{12} \end{bmatrix}$

meaning that matrix A(m x n) can be multiplied with another matrix B (n x m) only if matrix B have same number of the columns as the matrix A have rows :D:D:D

important is that (mostly)

$\displaystyle A\cdot B \ne B\cdot A$

only in some cases can be $\displaystyle AB = BA$

as for the your problem there :D

$\displaystyle \displaystyle \left[\begin{matrix} 3 & 9 \\ 5 & 1 \\ 1 & 4 \end{matrix}\right] * X = \left[\begin{matrix} 18 \\ 10 \\ 4 \end{matrix}\right]$

your X can be $\displaystyle X= \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}$

so when multiplied you get system of equations like :

$\displaystyle 3x_1+9x_2=18$
$\displaystyle 5x_1+x_2=10$
$\displaystyle x_1+4x_2=4$

Edit : sorry Prove It I have no idea why i didn't see your post .... early hm... very very sorry (P.S. when i refreshed this thread it wasn't there, and i waited to my post be posted at least 5 min. don't know what just happen .... )