If A and B are matrices, they don't need to be of similar size to multiply them. Let's say that they each have two rows and two columns. A has a1 a2 from left to right on the first row and a3 and a4 on the second row. B similarly has b1 to b4. When they're multiplied we get another 2 by 2 matrix with elements: a1*b1+a2*b3 a1*b2+a2*b4 a3*b1+a4*b3 a3*b2+a4*b4, the first of these elements form the top row of AB, the remaining two form the bottom row. 3AB means that each of these elements is multiplied by 3.