Matrix multiplication — conditions, process, non-commutativity
2.6.5· Maths › Matrices & Determinants — Introduction
Overview
Matrix multiplication element-wise multiplication nahi hai. Yeh ek composition of linear transformations hai, jahan product mein har entry ek dot product of a row and column hoti hai. Is operation ke liye strict dimension requirements hain aur, sabse important baat, order matter karta hai.
[!intuition] Matrix Multiplication Aisa Kyun Kaam Karta Hai
Matrices ko transformation machines ki tarah socho. Jab tum multiply karte ho, tum pooch rahe ho: "Kya hoga agar main pehle transformation apply karun, phir transformation ?"
YEH definition kyun hai? Kyunki yeh composition of functions ko preserve karta hai. Agar vector ko mein transform karta hai, aur us result ko mein transform karta hai, toh hum chahte hain ek single matrix jo aisi ho ki .
Row-column dot product is wajah se aata hai:
- ka har column batata hai ki ek basis vector kahan jaata hai
- ki har row batati hai ki un transformed vectors ko kaise combine karna hai
- ki entry yeh hai ki " ka -th column, ki -th row ke output mein kitna contribute karta hai"
[!definition] Matrix Multiplication
Matrices aur ke liye, product tab if and only if define hota hai jab == mein columns ki number mein rows ki number ke barabar ho==.
Result matrix ki dimensions hoti hain, jahan:
Simple shabdon mein: ki entry, == ki -th row aur ke -th column ka dot product== hai.
[!formula] Step-by-Step Process
Condition Check:
Inner dimensions (dono ) zaroor match karni chahiye. Outer dimensions ( aur ) result ki shape dete hain.
Computation:
Har entry ke liye:
- ki row lo:
- ka column lo:
- Calculate karo:
YEH kyun kaam karta hai: Har term represent karta hai "kth intermediate dimension, ki row aur ke column ke through kitna contribute karta hai."
[!example] Example 1 — Valid Multiplication
Check: hai , hai → inner dimensions match karte hain ✓
Result: hogi
compute karo ( ki row 1 · ka column 1):
Yeh step kyun? Hum 3 intermediate dimensions mein se har ek ke contributions ko sum kar rahe hain.
compute karo ( ki row 1 · ka column 2):
compute karo ( ki row 2 · ka column 1):
compute karo ( ki row 2 · ka column 2):
Final result:
[!example] Example 2 — Non-Commutativity Demonstrate Karna
compute karo:
compute karo:
Result: ✓
KYUN? Kyunki composition of transformations order par depend karta hai. Pehle rotate karna phir scale karna, pehle scale karna phir rotate karne se alag hota hai.
[!example] Example 3 — Undefined Multiplication
Check: hai , hai → inner dimensions match NAHI karte (2 ≠ 3) ✗
Result: undefined hai. Tum in matrices ko multiply nahi kar sakte.
Kyun? Yahan ek dimensional mismatch hai— ki rows ko 2 components chahiye, lekin 3 provide karta hai.
[!mistake] Common Mistakes
Mistake 1: Yeh Sochna Ki
Galat kyun lagta hai: Numbers ki regular multiplication commutative hoti hai, isliye students assume karte hain ki matrices bhi aise hi kaam karti hain.
Fix: Matrices transformations represent karti hain, aur order matters in transformations. Pehle moje phir joote pehnna ≠ pehle joote phir moje pehnna. Jab bhi dono aur defined hon (same size ki square matrices), woh usually alag hote hain.
Verification: Dono ko hamesha compute karo aur compare karo. Special cases exist karte hain (jaise ya same diagonal wali diagonal matrices), lekin woh exceptions hain.
Mistake 2: Galat Dimensions Multiply Karna
Galat kyun lagta hai: Students "dono matrices hain" par focus karte hain aur column-row matching rule bhool jaate hain.
Fix: Dimensions explicitly likho hamesha: . Red numbers match karni chahiye. Agar nahi karti, ruk jaao—multiplication undefined hai.
Mistake 3: Element-wise Multiplication
Galat kyun lagta hai: Sirf multiply karna (jise Hadamard product kehte hain, notation ) zyada simple lagta hai.
Fix: Matrix multiplication row-column dot products hai, entry-by-entry nahi. Hadamard product bilkul alag operation hai aur same dimensions maangta hai. Standard multiplication column-row match maangta hai.
[!recall]- Feynman Explanation (ELI12)
Socho tumhare paas recipes ki ek list hai (matrix ) jo batati hai smoothies kaise banani hain. Har recipe kehti hai "2 kele, 1 seb, 3 strawberries use karo."
Ab tumhare paas ek price list hai (matrix ) jo alag-alag stores mein har fruit ki cost batati hai.
Jab tum multiply karte ho, tum answer de rahe ho: "Har store mein har smoothie recipe ki total cost kya hai?"
Store #1 mein smoothie #1 ki cost nikalne ke liye, tum:
- Store #1 ki prices lo ( ki row 1)
- Smoothie #1 ki recipe lo ( ka column 1)
- Har price ko multiply karo us fruit ki quantity se jitni tumhe chahiye
- Sab add kar do
Yahi tumhare answer matrix mein ek entry hai!
Order flip kyun nahi kar sakte? Kyunki "store prices × smoothie recipes" sense mein hai, lekin "smoothie recipes × store prices" nahi—tum "2 kele" ko "$3 per apple" se meaningful tarike se multiply nahi kar sakte. Inner numbers same cheez represent karni chahiye (is case mein, fruits).
[!mnemonic] Memory Hook
"Columns meet Rows to make Entries"
- Pehli matrix ke Columns
- Doosri matrix ki Rows
- Inki count same honi chahiye
- Har pair dot product ke zariye ek Entry banata hai
Alternatively: "ColRow →RowCol flips the result"
kyunki tum transformations ko opposite order mein compose kar rahe ho.
Properties of Matrix Multiplication
- Associative: ✓
- Distributive: ✓
- NOT Commutative: in general ✗
- Identity: jahan identity matrix hai ✓
- Zero property: jahan zero matrix hai ✓
Associative kyun hai? Kyunki function composition associative hoti hai: .
Connections
- Matrix addition and scalar multiplication — same dimensions ke saath simpler operations
- Identity matrix — matrices ke liye multiplicative "1"
- Inverse of a matrix — solve karke nikalna
- Determinants — (determinants ke liye commutativity hold karta hai!)
- Linear transformations — function representations ki tarah matrices
- Matrix transpose properties — (order reverse ho jaata hai!)
- System of linear equations — matrix-vector multiplication use karta hai
Flashcards
aur ko multiply karne ke liye dimension requirement kya hai? :: mein columns ki number mein rows ki number ke barabar honi chahiye, yaani . Result hoga.