intro practice · coding problem

Dot product and matmul shapes

Vectors a=[1,2,3], b=[4,5,6]. Compute dot(a,b). Matrices A (2×3) and B (3×2): is A·B valid? What is the output shape?

The mechanism

Three lenses keep coming back: linear algebra describes the data (vectors and matrices), calculus describes learning (gradients), probability describes uncertainty. Pick the lens that matches the question.

Study ML Math Foundations

Expected evidence

dot=32; A·B is 2×2.

Try this drill in the practice workspace →

Hints when you need them
  • Dot = sum of elementwise products.
  • Inner dimensions must match for matmul.

Check the sources

Browse all practice briefs