Talk:Matrix multiplication

From Wikipedia, the free encyclopedia

WikiProject Mathematics
This article is within the scope of WikiProject Mathematics, which collaborates on articles related to mathematics.
Mathematics rating: B Class High Priority  Field: Algebra
One of the 500 most frequently viewed mathematics articles.

Contents

[edit] Dot products of vectors

A good way to envisage matrix mult is to split the first into rows, the 2nd into columns, and vector dot-produc them. --anon

Matrix multiplication can also be envisages a dot products of vectors. The above example becomes::


\begin{bmatrix} \mathbf{a}_1 \\ \mathbf{a}_2 \end{bmatrix}
*
\begin{bmatrix} \mathbf{b}_1 & \mathbf{b}_2 \end{bmatrix}
= 
\begin{bmatrix}
\mathbf{a}_1 \cdot \mathbf{b}_1 & \mathbf{a}_1 \cdot \mathbf{b}_2
\\
\mathbf{a}_2 \cdot \mathbf{b}_1 & \mathbf{a}_2 \cdot \mathbf{b}_2
\end{bmatrix}

The above is for the article, but trying to get the numbers right makes my brain ache. I'm leaving it here in case I've got them wrong. -- Tarquin 17:30 Jan 15, 2003 (UTC)

Perhaps it is good to work with column vectors; then the a's on the left must get a T for transposed. - Patrick 17:39 Jan 15, 2003 (UTC)
yup, that's the right way to do it.
I like that way a lot better than the other way, and I think the above general formula should be on the page. How I usually envision it is I write a horizontal line, then a verticle line, representing a lines of vectors. Its simpler to me to write a matrix of dotted vectors, rather than handle every element of the matrix separately. Fresheneesz 08:35, 21 March 2006 (UTC)
After reading over the "proportions-vectors method" I don't have any idea what it means by proportions.. Perhaps that should be explained better? Fresheneesz 08:37, 21 March 2006 (UTC)
"we take once the first vector and twice the third vector, while ignoring the second vector"
I'm pretty sure we're not gonna "ignore" anything, you multiplied the second vector by 0. I'm going to change that so it doesn't sound as .. vapid.. (no offense). Unless anyone argues. Fresheneesz 08:39, 21 March 2006 (UTC)

[edit] Picture

Okay, here's something that is probably one of these things that only makes sense to me.

Image:Matrix multiplication diagram.PNG When this picture was posted, it looked different. Find the original here.

it basically shows that the entries of the product matrix are filled in according to which row and column are multiplied. If anyone else gets it & thinks it useful for the article , please add it -- Tarquin 23:46 Jan 21, 2003 (UTC)

(except I've just realised the result matrix in the pic has the wrong number of rows .... hmmmmm. if there's a call for it I'll remake it)

Surely it makes sense to me also! This diagram uses unequal m and p, which is better (more general). I would use the diagram and add a third column for B in the example. - Patrick 01:14 Jan 22, 2003 (UTC)


Ah, that's good to know! There are many concepts in maths that I envisage pictorially in some way... and then I find that nobody else does... very disconcerting! Well, if one more person gets it, we'll put it in the article :-) -- Tarquin 23:03 Mar 14, 2003 (UTC)
This is the best illustration of matrix multiplication I've ever seen. In fact, I think it's one of the best math illustrations on Wikipedia. The second I saw it, I 'got' matrix multiplication for the first time. Beautiful work. Fredrik | talk 23:24, 10 Mar 2005 (UTC)
I fixed the picture, making it have correct number of rows. I also added yellow highlight around the elements that are being used, cause before it could have looked like only two elements were going into the new cell (the cells from which the arrow starts). Thats how I saw the picture so it confused me. I think the outline helps clarify that confusion. Fresheneesz 09:47, 21 March 2006 (UTC)
It looks like you've messed up the description. In the matrix operation AB, the column count from A and the row count from B are taken to form the resulting matrix AB. In other words, the operation shown in your picture is BA, not AB. —The preceding unsigned comment was added by CodeMercenary (talkcontribs) 07:35, 9 April 2007 (UTC).

I created a modified version of the image on the page. I added the names for the items in the matrix (a_1,2 etc) to make it clearer how the multiplication works. Do you agree that this image is better? Would like comments before inserting it. Lakeworks (talk) 23:03, 14 January 2008 (UTC)

Image:Matrix_multiplication diagram 2.svg

Two minor suggestions (which are a matter of taste):
  1. Make the cells square, and mark the two targets with non-flattened circles.
  2. Also fill in the "unused" cells of A and B: a2,1 etcetera, using a grey colour.
 --Lambiam 06:45, 15 January 2008 (UTC)
Updated the image with the suggestions you made. Any more suggestions or can I update the image in the article?
Lakeworks (talk) 21:11, 16 January 2008 (UTC)
It's fine with me (but I can't speak for other editors).  --Lambiam 01:47, 17 January 2008 (UTC)
Go for it. -- Jitse Niesen (talk) 15:12, 17 January 2008 (UTC)
This image is very helpful for me to refresh my memory, thanks for the addition Lakeworks. James Lednik (talk) 00:21, 14 February 2008 (UTC)

[edit] HTML representation

While I love HTML, the statement:

(the HTML entity ⊗ (⊗) represents the direct product, but is not supported on older browsers)

seems out of place. This article is about matrix multiplication, not HTML. Thoughts?

I've seen another article which had a simliar comment, and the consensus was to leave it because "people deserve to know how to write it" or something. I think its small, and should be at the end, but be there none the less. Fresheneesz 08:35, 21 March 2006 (UTC)
Thank you! I cannot imagine things pictorally well, and I always forget the algorithm for Matrix Multiplication. This picture is a lifesaver! wiki@matthewwilkes.name

[edit] Error in Kronecker Product Section

In the Kronecker product section, I believe there is an error.


\begin{bmatrix}
   a_{11}B & a_{12}B & \cdots & a_{1n}B \\
   \vdots  & \vdots  & \ddots & \vdots \\
   a_{n1}B & a_{n2}B & \cdots & a_{mn}B
\end{bmatrix}

Should be:


\begin{bmatrix}
   a_{11}B & a_{12}B & \cdots & a_{1n}B \\
   \vdots  & \vdots  & \ddots & \vdots \\
   a_{m1}B & a_{m2}B & \cdots & a_{mn}B
\end{bmatrix}

Right??

Yup. There should be an m. Fixed it. -- Tarquin 18:14, 22 Jun 2005 (UTC)

[edit] partitioned matrices

There needs to be some explanation of Partitioned matrix algrbra especially with respect to multiplication. I don' the math software so I hereby throw the ball to someone else. MPS 14:53, 20 Jun 2005 (UTC)

[edit] Notation

It is quite unusual to write AxB for the matrix product. AB or if necessary A.B is commonly used. Also, for multiplying numbers one uses 3x4 and not 3.4. The dot is used for the product of variables: a.b if just writing ab would lead to confusion.Nijdam 23:14, 28 February 2006 (UTC)

I agree that A × B for the matrix product is very uncommon, and I edited the article accordingly. However, I've encountered the notation 2 · 3 for the product of the numbers 2 and 3 quite often, so I left that one in. -- Jitse Niesen (talk) 11:20, 2 March 2006 (UTC)

[edit] howto's belong in wikibooks

wikipedia should just say what matrix multiplication is

I agree. This is a how to, and doesn't belong in an encyclopedia any more than the receipe for goat stew.

[edit] The coefficients-vectors method

In the example, it jumps from [3 1]+[0 0]+[2 0] to [5 1] without any explanation. I've had every edit I've made to a math page reverted, so I will suggest here that an extra step be added to point out how you get from the first step to the next. It is [(3+0+2) (1+0+0)]. Without that, it is not obvious what is going on unless you already know matrix multiplication - and if you did, you wouldn't be reading this article. --Kainaw (talk) 14:57, 2 September 2006 (UTC)

[edit] proportions matrix?

In "properties, what the proportions matrix means?

The article either needs to explain or avoid this usage. The "proportions" matrix is the left-hand matrix and the "vector" matrix is the right-hand matrix. Paul D. Anderson 23:13, 6 October 2006 (UTC)

[edit] Inner product

Is there a word for taking the inner product of two matrices as though they are vectors? That is

x=\sum_{i,j} M_{ij}M_{ij}=M:M=M_{11}+M_{12}+\cdots+M_{21}+M_{22}+\cdots

So, is there a name for this? —Ben FrantzDale 17:03, 20 December 2006 (UTC)

I'm not completely sure what you mean, but I think you're talking about the "Frobenius inner product". For two m-by-n matrices A and B, that is defined by
 \langle A, B \rangle_F = \operatorname{trace}(AB^\top) = \sum_{i=1}^m \sum_{j=1}^n a_{ij} b_{ij}.
You need to take conjagates for complex matrices. This inner product leads to the Frobenius norm, but that seems to be the only reference on Wikipedia to the Frobenius inner product. -- Jitse Niesen (talk) 18:16, 20 December 2006 (UTC)
That's the one. Thanks. Do you think it would be appropriate to define Frobenius inner product on this page? —Ben FrantzDale 21:14, 20 December 2006 (UTC)
Yes, it could be mentioned. Perhaps another page would be more appropriate, but I'm not sure which one, so just add it here. -- Jitse Niesen (talk) 16:47, 21 December 2006 (UTC)
Will do. It looks like this is closely related to Frobenius algebra. I don't know enough of the details to be able to say how these topics should be divvied up among pages, though. —Ben FrantzDale 18:03, 21 December 2006 (UTC)

[edit] This article sucks

I nominate that this article gets the suck award. 136.159.197.83 20:44, 17 April 2007 (UTC)

[edit] way to complicated

seriously how is the average joe meant to understand this? please could someone simplify it

I agree, I just wanted to see how to simply multiply 2 matrices; and multipy a scalar and a matrix, but this is site didn't help. —Preceding unsigned comment added by 129.21.40.143 (talk) 22:15, 11 February 2008 (UTC)
You are right. This page could do with a simple introduction. In my junior-high curriculum, we ran into matrix multiplication in 8th grade (age 12ish), well before I ever saw summation notation and well before we saw any applications for matrices. I just added a little bit, but more could be added to make this article much more accessible. While it's easy to state the algorithm for matrix–matrix multiplication, I find it impossible to understand before you have an intuition for what the vectors themselves mean. Then matrix–vector multiplication is just a way to make a new vector by having each entry in the new vector be some weighted sum in the initial vector. Then matrix–matrix multiplication is the "right" way to find P=BA such that Px=BAx. I hope that helps and I hope people work to make this article more approachable. —Ben FrantzDale (talk) 01:33, 12 February 2008 (UTC)

[edit] Broken link?

The link for "Efficient Matrix Multiplication for single dimension arrays" (http://angelo.freeshell.org/computer/docs/mmult.php) appears to be down (503 error). Is there another reference to that article? A google search didn't find it. -- Ed Burnette

An copy archived on 10 May 2007 is available at http://web.archive.org/web/20070510025901/http://angelo.freeshell.org/computer/docs/mmult.php . However, I don't think it is a useful resource, so I removed the link. -- Jitse Niesen (talk) 04:39, 2 August 2007 (UTC)

[edit] Possibility of adding a section explaining why matrices work the way they do

Does anyone else think that it wouldn't harm to mention how matrices can be seen as maps between vector spaces and that matrix multiplication corresponds to the composition of maps (after picking a basis)? LkNsngth (talk) 03:50, 3 May 2008 (UTC)

It is important to add that. Matrix multiplication is defined in such a seemingly non natural way because it corresponds precisely to composition of associated linear transformations. A new section might be in order.--Shahab (talk) 04:48, 3 May 2008 (UTC)
I've started working on such a section.  --Lambiam 16:34, 3 May 2008 (UTC)
Y Done; please review and improve.  --Lambiam 18:07, 3 May 2008 (UTC)
I believe there was a small technical error in your writing, a vector space is constructed over a field. Modules are generalizations of vector spaces over a ring. Other than that it looks good LkNsngth (talk) 23:18, 5 May 2008 (UTC)
That means that matrices over integers are excluded, so I removed the reference to integers. -- Jitse Niesen (talk) 08:38, 6 May 2008 (UTC)