Skip to content

Instantly share code, notes, and snippets.

@JossWhittle
Created August 10, 2012 16:27
Show Gist options
  • Save JossWhittle/3315357 to your computer and use it in GitHub Desktop.
Save JossWhittle/3315357 to your computer and use it in GitHub Desktop.
| 5 7| |-2 1 0|
A = |-3 2| B = | 5 9 -6|
| 5 7| |-2 1 0| | |
|-3 2| * | 5 9 -6| = | |
|4 .5 -2| |-3|
D = |12 1 3| E = |34|
|.5 2 -2| | 1|
Do:
D * E = F
D is 3x3
E is 3x1
3x3 .. 3x1
- -
It works. F will be a matrix 3x1
|4 .5 -2| |-3| | |
|12 1 3| * |34| = | |
|.5 2 -2| | 1| | |
4(-3) + .5(34) + -2(1) =
-12 + 17 + -2 = 3
12(-3) + 1(34) + 3(1) =
-36 + 34 + 3 = 1
.5(-3) + 2(34) + -2(1) =
-1.5 + 68 + -2 = 64.5
|4 .5 -2| |-3| | 3 |
|12 1 3| * |34| = | 1 |
|.5 2 -2| | 1| |64.5|
| 3 |
F = | 1 |
|64.5|
| 5 7| |-2 | |* |
| | * | 5 | = | |
Such that:
5(-2) + 7(5) =
-10 + 35 = 25
So:
| 5 7| |-2 1 0| |25 |
|-3 2| * | 5 9 -6| = | |
The top middle element of the result will be equal to the top row of A
times the middle column of B...
5(1) + 7(9) =
5 + 63 = 68
So:
| 5 7| |-2 1 0| |25 68 |
|-3 2| * | 5 9 -6| = | |
And finally for the top row, the top right element will be equal to the
top row of A times the right column of B...
5(0) + 7(-6) =
0 + -42 = -42
So:
| 5 7| |-2 1 0| |25 68 -42|
|-3 2| * | 5 9 -6| = | |
Now we do exactly the same for the bottom row. The bottom row of A will
be multiplied by each column of B
So:
-3(-2) + 2(5) =
6 + 10 = 16
-3(1) + 2(9) =
-3 + 18 = 15
-3(0) + 2(-6) =
0 + -12 = -12
| 5 7| |-2 1 0| |25 68 -42|
|-3 2| * | 5 9 -6| = |16 15 -12|
So Matrix C equals:
|25 68 -42|
C = |16 15 -12|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment