Expressing vector aglebra in a matrix

Started by
7 comments, last by amani 19 years, 1 month ago
If I have an expression like
(A·V)B where A,V, and B are vectors
is there a way to express this as
MV where M is a square matrix
I'm looking for a general method not dependant on a specific number of coordinates. Also for future reference, what do you call such a conversion?
Advertisement
How about this:

M =[a1*b1       a2*b1       a3*b1       ...      an-1*b1    ][a1*b2       a2*b2       a3*b2       ...      an-1*b2    ][a1*b3       a2*b3       a3*b3       ...      an-1*b3    ][...         ...         ...         ...      ...        ][a1*bn-1     a2*bn-1     a3*bn-1     ...      an-1*bn-1  ]


I'm pretty sure that's right, but not 100%.
Quote:Also for future reference, what do you call such a conversion?
I don't know.
Thanks a lot.
Well, jyk's result is correct (though I don't see the reason for stopping at
index n-1, makes it kind of hard to read...).

To see why it is correct, note that A·V is just a number, and can thus be
moved to the right of B, i.e. (A·V)B = B(A·V).
Now, if we use matrix notation for the vectors, A·V can be written A^tV,
where A^t is the transpose of A.
This means that (A·V)B = BA^tV = MV, where M=BA^t, which is exactly jyk's
result in the case of (n-1)-dimensional vectors.
Quote:(though I don't see the reason for stopping at index n-1, makes it kind of hard to read...)
Oops, sorry, should've been 'n'. Just a habit from 0-based indexing...
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.
There are 10 types of people in the world. Those who understand binary, and those who don't.
awesome
Quote:Original post by jlgosse
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.


No, matrix multiplication is (usually) not communitive, so a(b.c)!=(b.c)a, but a(b.c)=(a.b)c, under the laws of associativity.
"What are you trying to tell me? That I can write an O(N^2) recursive solution for a 2-dimensional knapsack?" "No, programmer. I'm trying to tell you that when you're ready, you won't have to." -Adapted from "The Matrix"
Quote:Original post by eleusive
Quote:Original post by jlgosse
I do believe a(b.c) = (b.c)a because of associativity laws. Or maybe it's commutativity laws.

It's one of them.


No, matrix multiplication is (usually) not communitive, so a(b.c)!=(b.c)a, but a(b.c)=(a.b)c, under the laws of associativity.


The last equation is wrong. A simple counterexample is to take a = (0, 0, 1) and c = (1, 0, 0). Then the left hand side is (0, 0, (b·c)), which is NOT equal to the right hand side, which is ((a·b), 0, 0).

There is no need to get into commutativity or associativity. The fact that a(b·c)=(b·c)a doesn't need to be proved. (b·c) is just a number (as I said in my original answer), and in the standard definition of a vector space, only (b·c)a is defined, while a(b·c) has no meaning. It is however quite natural to let it mean the same thing, especially if you use matrix notation for the vectors, since in this case, the equation follows from matrix algebra:
[ a1 ]                 [ a1 ][ a2 ][ b·c ] = [ b·c ][ a2 ][ a3 ]                 [ a3 ]

This topic is closed to new replies.

Advertisement