# Does vectors/matrices must share same row-column for dot multiplication?

This must be a very basic question, but since i've just started diving into linear algebra, it's sort of new to me.

Matrix multiplication has a rule: given matrices $$\mathbf{A} \in \mathbb{R}^{j\times k}$$ and $$\mathbf{B}\in \mathbb{R}^{l \times m}$$, the multiplication can only occur if $$k = l$$, and there will be a resulting matrix $$C \in \mathbb{R}^{j \times m}$$.

This also applies to dot product? I couldn't really get the difference between these two operations.

Thanks.

• Yes the same will apply to dot products. Geometrically, dot products measure angles between vectors, but you can only do that if the vectors live in the same space ($\Bbb{R}^n$ vs $\Bbb{R}^m$). If they don't live in the same space, it doesn't make sense to ask for an angle between the two. Dec 7 '20 at 16:50
• Thanks. I'm getting so much confused about this operations in the area of neural networks, where there are matrices operations between inputs and weights. Dec 7 '20 at 16:54