# Matrix multiplications (obtaining values)

I have a final tomorrow and it includes multiplying matrices (getting a table of values) but i do not understand how he is getting some of the numbers

something like this

suppose the matrices are

 A3X4  B4X5    C5x7    D7X2


in the results table he has

          A    B     C       D
A     0    60    165     134
B           0    140     110
C                0       70
D                        0

A     B      C      D
A    A     A*B    A*B*C  A*B*C*D
B          B      B*C    B*C*D
C                 C      C*D
D                        D


How is he getting 165 unders C for example? I know how he is getting the twi dimentional ones like for instance the 140 under C would be B*C which is 4X5X7 = 140 but I have no idea how he is getting for the A*B*C = 165

Thank you

-
Does this make sense to other people? –  Alex Becker May 1 '11 at 23:44
It does to my professor :(, I think the value on the table is the number of possible multiplications.. butt as you can see, he gets the 140 by multiplying 4X5X7... Thanks for helping me figure itt out –  edprog May 1 '11 at 23:49
edprog: by possible number of muliplications, do you mean the possible number of multiplications of entries necessary to compute the resulting Matrix? This simply isn't making sense, and we're going to need more clarification in order to point you in the right direction. –  amWhy May 2 '11 at 0:05
This is for Analysis and Design of Algorithms, I have a power point and this where the numbers are comming from, the topic is Multiplyinf Matrices –  edprog May 2 '11 at 0:19
It's confusing for me too –  edprog May 2 '11 at 0:19

Here's my guess as to what's going on. The table purports to show the number of (scalar) multiplications necessary to carry out the indicated matrix multiplication in the most efficient way. E.g., the entry for $AB$ is $60$ because each entry in the product requires $4$ multiplications, and there are $15$ entries in the product, and $4\times15=60$.
Now things get a little tricky when there are more than two matrices involved. While of course $A(BC)=(AB)C$, the number of multiplications required can be different for the two ways of setting out the calculation. Let's look at $ABCD$ and see if we can reproduce that $134$. First, do $CD$. $7$ multiplications per entry, $10$ entries, so $70$ multiplications, resulting in a $5\times 2$ matrix. Then do $B(CD)$, a $4\times5$ times a $5\times2$. That takes $40$ multiplications, and yields a $4\times2$ matrix. Finally, do $A(B(CD))$, a $3\times4$ times a $4\times2$. That's another $24$ multiplications. All told, $70+40+24=134$, voila!