ALGEBRAAlgebraMathematics Calculator
🔢

Matrix Multiplication

Multiply matrices using the row-by-column rule: (AB)ᵢⱼ = Σ AᵢₖBₖⱼ. Columns of A must equal rows of B. Result is m×p when A is m×n and B is n×p. Non-commutative: AB ≠ BA in general.

Concept Fundamentals
(AB)ᵢⱼ = Σ AᵢₖBₖⱼ
Element
A(m×n)·B(n×p)=C(m×p)
Dimensions
AB ≠ BA
Non-commutative
(AB)C = A(BC)
Associative
Multiply MatricesRow-by-column, scalar, power

Why This Mathematical Concept Matters

Why: Matrix multiplication underpins computer graphics, quantum mechanics, neural networks, and economics. Every 3D game uses it for rotation and projection. Neural networks are chains of matrix multiplications.

How: For each element C[i,j], take row i of A and column j of B. Multiply corresponding entries and sum. Dimensions: A(m×n)×B(n×p)→C(m×p). Scalar: multiply every entry. Power: A^n = A×A×...×A (n times, A square).

  • AB ≠ BA in general — order matters for matrix multiplication.
  • Identity matrix I satisfies AI = IA = A for compatible A.
  • Rotation by 90°: [[0,-1],[1,0]]. Two rotations = 180°: [[-1,0],[0,-1]].

📐 Examples — Click to Load

Matrix A

Matrix B

matrix_multiply.sh
CALCULATED
$ matrix_multiply --result
A(2×2) × B(2×2) → C(2×2) ✓
1922
4350
Share:

Result Entries (Bar)

Element Magnitudes (%)

📐 Calculation Steps

Step 1: Verify dimensions. A is 2×2, B is 2×2. Columns of A (2) = Rows of B (2) ✓
Step 2: Result C = A × B will be 2×2
Step 3: Row-by-column: each C[i,j] = sum of (row i of A) · (col j of B)
C[1,1] = (1×5) + (2×7) = 19
C[1,2] = (1×6) + (2×8) = 22
C[2,1] = (3×5) + (4×7) = 43
C[2,2] = (3×6) + (4×8) = 50

Properties

  • • Result dimensions: 2×2
  • • AB ≠ BA in general (non-commutative)
  • • For square matrices: (AB)C = A(BC) (associative)

⚠️For educational and informational purposes only. Verify with a qualified professional.

🧮 Fascinating Math Facts

🖥️

3D games use matrix multiplication for rotation, scaling, and projection of vertices.

— Computer Graphics

⚛️

Quantum mechanics uses matrices; multiplication represents state evolution.

— Physics

📋 Key Takeaways

  • Row-by-column method: C[i,j] = sum over k of A[i,k] × B[k,j]
  • Dimension rule: A(m×n) × B(n×p) → C(m×p). Columns of A must equal rows of B.
  • Non-commutativity: AB ≠ BA in general. Order matters!
  • Associative: (AB)C = A(BC) when dimensions allow
  • Applications: Computer graphics, physics, economics, machine learning

💡 Did You Know?

🖥️Every 3D game uses matrix multiplication for rotation, scaling, and projection of vertices.Source: Computer Graphics
⚛️Quantum mechanics uses matrices; multiplication represents state evolution.Source: Physics
📊Neural networks are essentially chains of matrix multiplications (linear layers).Source: Machine Learning
📐Rotation by 90°: [[0,-1],[1,0]]. Two rotations = 180°: [[-1,0],[0,-1]].Source: Geometry
🔢Identity matrix I: AI = IA = A. It acts like 1 for matrices.Source: Linear Algebra
📈Input-output models in economics use Leontief matrices (matrix multiplication).Source: Economics

📖 Row-by-Column Method

To multiply A × B: take row i of A and column j of B. Multiply corresponding entries and add. That gives C[i,j]. Repeat for every position.

C[i,j] = A[i,1]·B[1,j] + A[i,2]·B[2,j] + ... + A[i,n]·B[n,j]

Example: 2×2

A = [[1,2],[3,4]], B = [[5,6],[7,8]]. C[1,1] = 1×5 + 2×7 = 19. C[1,2] = 1×6 + 2×8 = 22. C[2,1] = 3×5 + 4×7 = 43. C[2,2] = 3×6 + 4×8 = 50.

🔄 Non-Commutativity (AB ≠ BA)

For numbers, a×b = b×a. For matrices, AB and BA are usually different — and BA may not even be defined if dimensions differ. Example: A is 2×3, B is 3×2. Then AB is 2×2, but BA is 3×3. Different sizes!

Even for 2×2: [[1,0],[0,0]] × [[0,1],[0,0]] ≠ [[0,1],[0,0]] × [[1,0],[0,0]]

📊 Dimension Rules Table

ABABValid?
2×22×22×2
2×33×22×2
3×22×43×4
2×32×3✗ (cols≠rows)

🎯 Applications in Computer Graphics

In 2D graphics, transformations are matrices. Rotation by θ: [[cos θ, -sin θ], [sin θ, cos θ]]. Scaling: [[sx, 0], [0, sy]]. Composing: Scale × Rotation. Order matters! For 90°: [[0,-1],[1,0]]. Two 90° = 180°: [[-1,0],[0,-1]].

🔢 Identity and Zero Matrices

Identity I has 1s on diagonal, 0s elsewhere: AI = IA = A. Zero O has all zeros: AO = OA = O. Load the identity example to see A × I = A.

📝 Practice Checklist

Before multiplying, verify:

  • Columns of A = Rows of B
  • Result dimensions: rows of A × columns of B
  • For A^n, A must be square

❓ FAQ

Why must columns of A equal rows of B?

Each element of AB is a dot product: row of A with column of B. They must have the same length.

Is matrix multiplication commutative?

No. AB ≠ BA in general. Order matters for matrix multiplication.

What is the identity matrix?

I has 1s on the diagonal, 0s elsewhere. AI = IA = A for compatible A.

How is this used in graphics?

Transformations (rotate, scale, translate) are matrices. Composing transforms = multiplying matrices.

What is matrix power A^n?

A × A × ... × A (n times). Only defined for square matrices.

⚠️ Disclaimer: This calculator handles standard matrix multiplication. For very large matrices, numerical precision may vary. Educational use only.

👈 START HERE
⬅️Jump in and explore the concept!
AI