4.5.33 · D3 · Maths › Linear Algebra (Full) › Inner product spaces — dot product generalization
Yeh page har tarah ki situation ka drill hai jo ek inner-product question tumhare saamne rakh sakta hai. Pehle hum saare case classes ek table mein list karte hain, phir har cell ke liye ek example karte hain taaki koi bhi scenario tumhe surprise na kare. Yahan sab kuch parent note par based hai: ek inner product ⟨ ⋅ , ⋅ ⟩ ek aisa rule hai jo do vectors khaata hai aur ek number return karta hai, jismein symmetry , pehle slot mein linearity , aur positive-definiteness (⟨ v , v ⟩ ≥ 0 , aur = 0 sirf zero vector ke liye) maanna zaroori hai.
Derived geometry ka reminder jo hum baar baar use karte rahenge:
∥ v ∥ = ⟨ v , v ⟩ , cos θ = ∥ u ∥ ∥ v ∥ ⟨ u , v ⟩ , u ⊥ v ⟺ ⟨ u , v ⟩ = 0.
Yeh hai har case class jo is topic mein tumhare saamne aa sakti hai. Baad ke har example mein us cell ka tag hoga jismein woh aata hai.
#
Case class
Kyun tricky hai
Example
A
Standard positive angle (⟨ u , v ⟩ > 0 )
cosine ( 0 , 1 ) mein, acute angle
Ex 1
B
Negative inner product (⟨ u , v ⟩ < 0 )
obtuse angle, cosine ka sign
Ex 2
C
Orthogonal case (⟨ u , v ⟩ = 0 )
us geometry mein right angle
Ex 3
D
Degenerate / zero input (v = 0 )
cosine formula mein zero se divide hota hai
Ex 4
E
Non-standard weights axes ko stretch karte hain
usual right angle right nahi rehta
Ex 5
F
Function space (integral)
ek period integrate karke orthogonality
Ex 6
G
Cauchy–Schwarz ki limiting / boundary (equality)
cos θ = ± 1 , parallel vectors
Ex 7
H
Real-world word problem
words ko inner product mein translate karo
Ex 8
I
Exam twist: "kya yeh inner product hai?"
ek axiom quietly fail karta hai
Ex 9
Ab hum har cell ko hit karte hain.
Worked example Ex 1 (Cell A):
( 3 , 1 ) aur ( 1 , 2 ) ke beech angle standard dot product ke under
⟨ u , v ⟩ = u 1 v 1 + u 2 v 2 use karo. Angle θ nikalo.
Forecast: dono arrows upar-aur-daayein point karte hain, toh guess: acute, cosine positive, kahin 4 5 ∘ ke paas?
Inner product. ⟨ u , v ⟩ = ( 3 ) ( 1 ) + ( 1 ) ( 2 ) = 5 .
Yeh step kyun? Yeh ek number saari geometry carry karta hai; positive hona hi bata deta hai ki angle acute hai (Cell A).
Norms. ∥ u ∥ = 3 2 + 1 2 = 10 , ∥ v ∥ = 1 2 + 2 2 = 5 .
Yeh step kyun? cos θ ke liye lengths chahiye taaki "kitna lamba" normalize ho jaaye aur sirf "kis direction mein" bacha rahe.
Cosine. cos θ = 10 5 5 = 50 5 = 5 2 5 = 2 1 .
Yeh step kyun? Inner product ko lengths ke product se divide karo — angle ki yahi definition hai.
Angle. θ = arccos 2 1 = 4 5 ∘ .
Yeh step kyun? arccos ka jawab hai "kis angle ka yeh cosine hai?" — yeh cosine ko undo karta hai.
Verify: 2 1 ≈ 0.707 ∈ ( − 1 , 1 ) ✓ (Cauchy–Schwarz respected), aur 0 < 0.707 < 1 ✓ toh acute, forecast se match karta hai. Dekho Cauchy-Schwarz Inequality .
Worked example Ex 2 (Cell B):
( 2 , 1 ) aur ( − 1 , 1 ) ke beech angle
Phir se standard dot product.
Forecast: ek arrow daayein jhukta hai, doosra baayein — woh right angle se zyada khulte hain. Guess: obtuse, negative cosine.
Inner product. ⟨ u , v ⟩ = ( 2 ) ( − 1 ) + ( 1 ) ( 1 ) = − 1 .
Yeh step kyun? Ek negative value ka matlab hai ki vectors ek doosre ki taraf se zyada door point karte hain — yahi obtuse ka matlab hai.
Norms. ∥ u ∥ = 5 , ∥ v ∥ = 2 .
Cosine. cos θ = 5 2 − 1 = 10 − 1 ≈ − 0.316 .
Yeh step kyun? Division ke baad bhi minus sign bachta hai, toh cosine negative hai — Cell B ka fingerprint.
Angle. θ = arccos ( − 0.316 ) ≈ 108. 4 ∘ .
Verify: ∣ − 0.316∣ < 1 ✓; cosine negative ⇒ angle ( 9 0 ∘ , 18 0 ∘ ) mein hai ✓, forecast se match karta hai.
Worked example Ex 3 (Cell C): kya
p ( x ) = x aur q ( x ) = 1 − x orthogonal hain?
Degree-≤ 1 polynomials par evaluation inner product use karo: ⟨ p , q ⟩ = p ( 0 ) q ( 0 ) + p ( 1 ) q ( 1 ) .
Forecast: yeh toh sirf kagaz par lines hain — surely perpendicular nahi hongi? Lekin orthogonality inner product ke relative hoti hai. Compute karne se pehle guess karo.
Sample points par evaluate karo. p ( 0 ) = 0 , p ( 1 ) = 1 , q ( 0 ) = 1 , q ( 1 ) = 0 .
Yeh step kyun? Yeh inner product sirf x = 0 aur x = 1 par values "dekhta" hai; har function ke woh do numbers hi uski poori duniya hain.
Combine karo. ⟨ p , q ⟩ = ( 0 ) ( 1 ) + ( 1 ) ( 0 ) = 0 .
Yeh step kyun? Zero inner product hi orthogonal ki definition hai — koi picture-angle ki zaroorat nahi.
Verify: value exactly 0 hai ✓. Toh x ⊥ ( 1 − x ) is geometry mein hai, chahe graph paper par 9 0 ∘ nahi hain. Dekho Orthogonality and Gram-Schmidt .
Worked example Ex 4 (Cell D):
v = ( 2 , 3 ) aur zero vector 0 ke beech angle kya hai?
Standard dot product.
Forecast: zero vector ki koi direction nahi hoti — kya angle exist bhi karta hai? Guess: undefined.
Inner product. ⟨ v , 0 ⟩ = ( 2 ) ( 0 ) + ( 3 ) ( 0 ) = 0 .
Yeh step kyun? Har inner product zero vector ke saath 0 deta hai (linearity: ⟨ v , 0 ⋅ 0 ⟩ = 0 ).
0 ka norm. ∥ 0 ∥ = ⟨ 0 , 0 ⟩ = 0 = 0 .
Yeh step kyun? Positive-definiteness kehta hai sirf zero vector ki length zero hoti hai — yahan hoti hai.
Cosine try karo. cos θ = ∥ v ∥ ⋅ 0 0 = 0 0 .
Yeh step kyun? Denominator 0 hai, toh formula zero se divide karta hai — undefined.
Verify: angle genuinely undefined hai, 9 0 ∘ nahi. Log galti se ⟨ v , 0 ⟩ = 0 ko "orthogonal" bolte hain, lekin zero vector sab cheez ke orthogonal hota hai aur uski koi direction nahi, toh koi angle exist nahi karta. Yeh degenerate boundary case hai.
⟨ v , 0 ⟩ = 0 toh angle 9 0 ∘ hai."
Kyun sahi lagta hai: zero inner product usually right angle ka matlab hota hai.
Fix: cos θ = 0/0 yahan — angle undefined hai, kyunki 0 ki koi direction hi nahi hai jisse angle ban sake.
Worked example Ex 5 (Cell E): kya
( 1 , 0 ) aur ( 0 , 1 ) , ⟨ u , v ⟩ = 3 u 1 v 1 + 2 u 2 v 2 ke under orthogonal hain? Aur ∥ ( 1 , 1 ) ∥ kya hai?
Forecast: usual geometry mein axes perpendicular hote hain. Kya re-weighting se yeh toota? Guess karo.
Axis vectors ka inner product. ⟨( 1 , 0 ) , ( 0 , 1 )⟩ = 3 ( 1 ) ( 0 ) + 2 ( 0 ) ( 1 ) = 0 .
Yeh step kyun? Weights ke bawajood, cross terms vanish hote hain kyunki har vector ek axis par rehta hai — toh axes yahan orthogonal rehte hain .
Ek vector jo axis par nahi hai. ( 1 , 1 ) lo: ⟨( 1 , 1 ) , ( 1 , 1 )⟩ = 3 ( 1 ) + 2 ( 1 ) = 5 , toh ∥ ( 1 , 1 ) ∥ = 5 .
Yeh step kyun? Weights plane ko unevenly stretch karte hain, toh yeh length ordinary 2 se alag hai.
Ek bent angle dikhao. Is inner product ke under ( 1 , 1 ) aur ( 1 , − 1 ) : ⟨( 1 , 1 ) , ( 1 , − 1 )⟩ = 3 ( 1 ) ( 1 ) + 2 ( 1 ) ( − 1 ) = 3 − 2 = 1 = 0 .
Yeh step kyun? Plain paper par ( 1 , 1 ) ⊥ ( 1 , − 1 ) 9 0 ∘ par hain; yahan value 1 = 0 hai, toh woh orthogonal nahi hain — weights ne geometry ko bend kar diya.
Verify: ∥ ( 1 , 1 ) ∥ = 5 ≈ 2.236 = 2 ≈ 1.414 ✓, confirm karta hai ki distances change ho gayi. Dekho Norms and Distance .
Worked example Ex 6 (Cell F): dikhao ki
f ( x ) = 1 aur g ( x ) = cos ( 2 π x ) , [ 0 , 1 ] par orthogonal hain
Integral inner product ⟨ f , g ⟩ = ∫ 0 1 f ( x ) g ( x ) d x use karo.
Forecast: ek flat line aur ek full cosine wave — wave equal time upar aur neeche spend karti hai zero se, toh guess: unka product integrate hokar 0 aayega.
Setup karo. ⟨ f , g ⟩ = ∫ 0 1 1 ⋅ cos ( 2 π x ) d x .
Yeh step kyun? Do functions ko pointwise multiply karo, phir sum (integrate) karo — functions ke liye inner product yahi hai.
Integrate karo. ∫ 0 1 cos ( 2 π x ) d x = [ 2 π sin ( 2 π x ) ] 0 1 = 2 π sin 2 π − sin 0 = 2 π 0 − 0 = 0 .
Yeh step kyun? Hum exactly ek full period par integrate karte hain, toh positive aur negative humps cancel ho jaate hain.
Verify: integral exactly 0 hai ✓ — toh constant function cos ( 2 π x ) ke orthogonal hai. Yeh equal-area cancellation hi Fourier Series ke peeche ka engine hai.
Worked example Ex 7 (Cell G):
( 2 , 4 ) aur ( 1 , 2 ) ke beech angle (parallel vectors)
Standard dot product.
Forecast: ( 2 , 4 ) exactly 2 × ( 1 , 2 ) hai — same direction. Guess: cosine apni extreme value + 1 hit karta hai, angle 0 ∘ , aur Cauchy–Schwarz equality ban jaata hai.
Inner product. ⟨ u , v ⟩ = ( 2 ) ( 1 ) + ( 4 ) ( 2 ) = 10 .
Norms. ∥ u ∥ = 4 + 16 = 20 , ∥ v ∥ = 1 + 4 = 5 .
Cosine. cos θ = 20 5 10 = 100 10 = 10 10 = 1 .
Yeh step kyun? Jab ek vector doosre ka positive scalar multiple hota hai, toh Cauchy–Schwarz mein discriminant trick equality deta hai — parabola zero ko sirf touch karta hai.
Angle. θ = arccos ( 1 ) = 0 ∘ .
Verify: ∣ ⟨ u , v ⟩ ∣ = 10 aur ∥ u ∥∥ v ∥ = 10 , toh ∣ ⟨ u , v ⟩ ∣ = ∥ u ∥∥ v ∥ — Cauchy–Schwarz ka equality case ✓, exactly forecast ke jaisa. (Anti-parallel vectors jaise ( 2 , 4 ) aur ( − 1 , − 2 ) cos θ = − 1 dete, doosri boundary.)
Worked example Ex 8 (Cell H): feature scores se do products ki "similarity"
Phone A ke scores hain ( camera , battery , price ) = ( 8 , 6 , 4 ) aur phone B ke ( 2 , 9 , 7 ) . Cosine similarity (inner-product angle) use karke, woh kitne alike hain?
Forecast: camera par disagree karte hain lekin battery/price par overlap hai — guess: ek middling positive cosine, ek acute angle jo 0 ∘ se door ho.
Inner product. ⟨ A , B ⟩ = 8 ( 2 ) + 6 ( 9 ) + 4 ( 7 ) = 16 + 54 + 28 = 98 .
Yeh step kyun? Dot product add karta hai ki dono feature by feature kitna "agree" karte hain — bada = zyada similar.
Norms. ∥ A ∥ = 64 + 36 + 16 = 116 , ∥ B ∥ = 4 + 81 + 49 = 134 .
Yeh step kyun? Normalize karne se "ek phone ke bas bade numbers hain" wali baat hat jaati hai, sirf scores ka pattern bachta hai.
Cosine similarity. cos θ = 116 134 98 = 15544 98 ≈ 124.68 98 ≈ 0.786 .
Angle. θ = arccos ( 0.786 ) ≈ 38. 2 ∘ .
Verify: 0.786 ∈ ( − 1 , 1 ) ✓; acute aur kaafi similar, forecast se match karta hai. Recommender systems items compare karne ke liye literally yahi karte hain — ek inner product se geometry. Dekho Dot Product .
Worked example Ex 9 (Cell I): decide karo ki
⟨ u , v ⟩ = u 1 v 1 − u 2 v 2 on R 2 ek inner product hai ya nahi
Forecast: yeh symmetric aur linear lagta hai — tempting hai ki haan bol do. Lekin commit karne se pehle har axiom check karo.
Symmetry. u 1 v 1 − u 2 v 2 = v 1 u 1 − v 2 u 2 ✓.
Yeh step kyun? Multiplication commute karta hai, toh u , v swap karne se kuch nahi badalta.
Slot 1 mein linearity. ⟨ c u + w , v ⟩ = c ( u 1 v 1 − u 2 v 2 ) + ( w 1 v 1 − w 2 v 2 ) ✓.
Yeh step kyun? Har term pehle vector ke components mein linear hai.
Positive-definiteness — trap. v = ( 0 , 1 ) test karo: ⟨( 0 , 1 ) , ( 0 , 1 )⟩ = 0 − 1 = − 1 < 0 .
Yeh step kyun? Axiom 3 maangta hai ⟨ v , v ⟩ ≥ 0 ; yahan yeh negative hai, toh length imaginary hoti.
Verify: ⟨( 0 , 1 ) , ( 0 , 1 )⟩ = − 1 < 0 ✓ (failure real hai). Inner product nahi hai — positive-definiteness fail hoti hai. Yeh woh single axiom hai jo exam twists mein sabse zyada toodi jaati hai.
Recall Saare cells par quick self-test
cos θ ka sign jab ⟨ u , v ⟩ < 0 ho ::: negative → obtuse angle (Cell B).
0 aur kisi vector ke beech angle ::: undefined — division by zero (Cell D).
Kya ⟨ u , v ⟩ = 3 u 1 v 1 + 2 u 2 v 2 ke under axes orthogonal rehte hain ::: haan, lekin off-axis right angles bend ho jaate hain (Cell E).
Cauchy–Schwarz ko equality kya banata hai ::: dono vectors scalar multiples hote hain (parallel/anti-parallel) (Cell G).
Kaunsa axiom u 1 v 1 − u 2 v 2 ko kill karta hai ::: positive-definiteness (Cell I).
Mnemonic Inner-product number padhna
Sign angle batata hai, size closeness batata hai: positive → acute, zero → orthogonal, negative → obtuse; aur ∣ ⟨ u , v ⟩ ∣ kabhi ∥ u ∥∥ v ∥ se zyada nahi ho sakta.