Matrix operations — addition, subtraction (conditions)
2.6.3· Maths › Matrices & Determinants — Introduction
Overview
Matrix addition aur subtraction element-wise operations hain jo matrices ki corresponding entries ko combine karti hain. Ek critical constraint hai: matrices ki dimensions bilkul identical honi chahiye — yeh koi arbitrary algebra nahi hai, balki yeh is fact par based hai ki har entry ek structured data arrangement mein ek specific position represent karti hai.
[!intuition] Element-Wise Kyun?
Matrices ko spreadsheets of data ki tarah socho. Agar Matrix A 3 stores × 4 products ke across sales track karti hai, aur Matrix B usi structure ke liye returns track karti hai, toh unhe add karne par net sales milti hai. Lekin tum ek 3×4 sales sheet ko ek 2×5 inventory sheet mein add nahi kar sakte — positions correspond nahi karti. Har matrix entry ka row-column position se semantic meaning hota hai; operations is meaning ko preserve karte hain by pairing entries jo same logical slot par hain.
Visual analogy: Transparent grids ko stack karna — tum sirf unhi values ko add/subtract kar sakte ho jo perfectly align hon. Mismatched grids mein kuch squares orphaned reh jaate hain.
[!definition] Formal Definition
Maano aur identical order ki matrices hain.
Addition:
Subtraction:
Dono operations ki condition: Order of matrices must be identical ( dono ke liye).
[!formula] First Principles se Derivation
Yeh Condition Kyun?
Purpose se shuru karo: Ek matrix row-items aur column-items ke beech relationships encode karti hai (jaise, students × subjects for grades).
- Entry correspondence: Matrix A mein matlab hai "row-entity paired with column-entity "
- Information combine karna: Matrices add karne ke liye, humein aur ko same relationship refer karna hoga
- Structural requirement: Yeh force karta hai ki dono matrices mein same (row count) aur (column count) ho
Agar dimensions differ karein toh kya toot jaata hai?
- hai , hai : ka third column mein koi partner nahi hai
- hai , hai : ka third row mein koi partner nahi hai
Operation undefined ho jaata hai — humein values invent karni padti, jo algebra ki deterministic nature ko violate karta hai.
Properties (Real Numbers ki Commutativity/Associativity se Derived)
Kyunki aur real number addition commutative hai:
-
Commutativity:
- Kyun? sabhi ke liye
-
Associativity:
- Kyun? sabhi ke liye
-
Identity element: jahan zero matrix hai (sabhi entries 0)
- Kyun?
-
Additive inverse: jahan
- Kyun?
Subtraction as addition: , isliye subtraction in properties ko inherit karta hai (sivaaye commutativity ke jo anti-commutativity ban jaati hai: ).
[!example] Worked Example 1: Valid Addition
Diya gaya:
Dhundo:
Solution:
Step 1: Dimensions check karo
- hai
- hai
- ✓ Identical, operation defined
Step 2: Corresponding entries add karo
Yeh step kyun? Result mein har entry , mein aur mein se aati hai.
Step 3: Simplify karo
[!example] Worked Example 2: Valid Subtraction
Diya gaya:
Dhundo:
Solution:
Step 1: Dimensions check karo
- Dono hain
- ✓ Valid
Step 2: Element-wise subtract karo
Yeh step kyun? Subtraction matlab additive inverse add karna: .
Step 3: Result
[!example] Worked Example 3: Invalid Operation
Diya gaya:
Question: Kya hum compute kar sakte hain?
Solution:
Step 1: Dimensions check karo
- hai (2 rows, 3 columns)
- hai (3 rows, 2 columns)
- ✗ Not identical
Step 2: Conclusion nikalo undefined hai.
Kyun? ki entry (jo 3 hai) ka mein koi corresponding entry nahi hai (uske paas sirf 2 columns hain). ki entry (jo 11 hai) ka mein koi partner nahi hai (uske paas sirf 2 rows hain).
[!mistake] Common Mistakes
Mistake 1: "Total elements ki same count kaafi hai"
Galat soch: Matrix hai (6 elements), Matrix hai (6 elements), toh main unhe add kar sakta hoon.
Yeh sahi kyun lagta hai: Dono mein 6 numbers hain, lagta hai pair kar sakte hain.
Fix: Position matters, sirf count nahi. Ek matrix 2 row-categories × 3 column-categories represent karti hai. Ek represent karti hai 3 × 2 — different structure. mein entry matlab hai "row-1, column-3" jo ki structure mein exist nahi karta.
Steel-man: Confusion isliye aati hai kyunki hum kuch contexts mein matrices ko reshape kar sakte hain (vectorization). Lekin addition mein structural alignment chahiye — tum sirf numbers combine nahi kar rahe, tum relationships combine kar rahe ho.
Mistake 2: "Main dimensions match karne ke liye ek matrix transpose kar sakta hoon"
Galat soch: Agar hai aur hai , toh compute karo aur use matrix addition kaho.
Yeh sahi kyun lagta hai: , ko flip karke bana deta hai, ab dimensions match karti hain!
Fix: ek alag operation hai se. Transposing change kar deta hai ki tum kaun si relationships encode kar rahe ho. Agar "products × stores" track karta hai, toh "stores × products" track karta hai — har entry ka meaning change ho gaya. Tum compute kar sakte ho agar yeh tumhari problem ke liye meaningful ho, lekin yeh " aur ka matrix addition" nahi hai — yeh " aur ke transpose ka matrix addition" hai.
Steel-man: Applied work (machine learning, physics) mein hum strategically transpose karte hain operations enable karne ke liye. Lekin hum aisa intentionally karte hain, jaante hue ki hum semantic structure change kar rahe hain. Sirf arithmetic force karne ke liye transpose mat karo.
[!recall]- Feynman Explanation (Ek 12-Saal Ke Bacche Ko)
Socho tum aur tumhara dost dono ke paas ek chore chart hai — ek grid jisme upar days hain aur side mein chores. Har box batata hai tumne us din us chore par kitne minutes lagaye.
Matrices add karna matlab hai apne charts combine karna: "Monday ko dishes ke liye, maine 15 minutes lagaye, tumne 20 lagaye, toh milke humne 35 lagaye." Tum box-by-box jaate ho, numbers add karte ho.
Lekin yahan ek catch hai: Tum yeh tabhi kar sakte ho jab tumhare charts ka exact same layout ho. Agar tumhare chart mein 7 days hain lekin dost ke chart mein sirf 5 days hain, toh day 6 aur 7 ke liye tum kya likhoge? Unke chart mein koi number add karne ke liye hai hi nahi — blank hai, undefined hai!
Isliye matrices ko identical dimensions chahiye — ek chart ke har box ko doosre chart mein ek partner box chahiye. Agar grids match nahi karti, tum stuck ho.
Subtraction bhi same idea hai: "Maine 15 minutes lagaye, tumne 20 lagaye, toh tumne mujhse 5 minutes zyada kiya." Phir bhi matching grids chahiye.
[!mnemonic] Memory Aid
"Same Size to Synthesize"
- Same Size: Dimensions exactly match karni chahiye ( dono ke liye)
- Synthesize: Element-by-element combine karke result banao
Visual: Do identical photo frames ko overlay karte socho — har pixel neeche wale pixel mein add hota hai. Mismatched frames mein gaps reh jaate hain.
Connections
- Matrix Notation and Terminology — prerequisite: order/dimensions samajhna
- Zero Matrix and Identity Matrix — additive identity yahin se aata hai
- Scalar Multiplication of Matrices — combine kiya ja sakta hai:
- Matrix Multiplication — contrast: multiplication mein alag dimension requirements hain ( times , dono ke liye nahi)
- Transpose of a Matrix — aur mein farq
- System of Linear Equations — matrix addition systems combine karne ko model karti hai (jaise, economic scenarios)
Flashcards
Do matrices ko add ya subtract karne ke liye kya zaroori condition hai? :: Matrices ki dimensions identical honi chahiye (rows ki same number AUR columns ki same number, yaani same order ).
Agar ek matrix hai aur ek matrix hai, toh kya defined hai? :: Nahi. Dono mein 3 rows hain, lekin mein 4 columns hain jabki mein 5 columns hain. Dimensions identical nahi hain.