Math - Matrix Addition and Scalar Multiplication

In this lecture we learn how to add two matrices together and how to multiply a matrix by a scalar.
These are some of the most basic operations you can do with a matrix and the process is similar to how we perform those same operations on ordinary vectors.

This is how my Matrix came out
a b c d e f
a 0 1 2 0 0 0
b 1 0 0 5 3 0
c 0 0 0 0 0 0
d 0 5 0 0 0 1
e 0 0 0 1 0 4
f 0 0 0 1 4 0

Nice work @Ray_Beattie.

Your answer isn’t wrong but what you’ve got here is the transpose of the matrix (compared to how I was constructing them in the lecture). So all the rows and columns have been flipped.

In the lectures, I was placing the current node on the row the other nodes in the columns, whereas you’ve placed them the other way around.
This isn’t a major problem, provided you maintain that convention and remember your decision for if/when you come to convert your matrix back into a graph. Otherwise, you’ll end up getting back a very different looking graph.

For reference, the matrix I created for this problem is:

  || A | B | C | D | E | F
-------------------------- 
A || 0 | 1 | 0 | 0 | 0 | 0  
B || 1 | 0 | 0 | 5 | 0 | 0
C || 2 | 0 | 0 | 0 | 0 | 0
D || 0 | 5 | 0 | 0 | 1 | 1
E || 0 | 3 | 0 | 0 | 0 | 4
F || 0 | 0 | 0 | 1 | 4 | 0

Privacy & Terms