1.1.1 · HinglishLinear Algebra Essentials

Scalars, vectors, matrices, and tensors definitions

1,489 words7 min readRead in English

1.1.1 · AI-ML › Linear Algebra Essentials


WHY karte hain care? (80/20)


WHAT hain ye? (rank ke hisaab se definitions)

Key organizing concept hai rank (a.k.a. order ya number of axes): ek element ko address karne ke liye kitne indices chahiye.

Figure — Scalars, vectors, matrices, and tensors definitions

HOW count karte hain elements? (scratch se derive karo)

Step 1 — Scalar. Kitne numbers? Bas ek. Ye step kyun? Rank 0 ka matlab hai koi bhi index kisi cheez pe range nahi karta.

Step 2 — Vector of length . Index run karta hai tak. Ye step kyun? Ek index, choices.

Step 3 — Matrix . rows mein se har ek ke liye, columns hain. Ye step kyun? Independent choices multiply hoti hain (fundamental counting principle).

Step 4 — Tensor . Generalize karo: har axis length ko multiply karo. Ye step kyun? Har index ek independent multiplicative factor contribute karta hai — bilkul nested loops ki tarah.


Transpose: ek rank-2 operation

Kyun: ye grid ko main diagonal ke across reflect karta hai. Ek vector (ek column) transpose hokar ek row ban jaata hai. Ek scalar apna khud ka transpose hota hai ().


Worked Examples


Common Mistakes (Steel-manned)


Flashcards

Rank- tensor ke ek element ko kitne indices address karte hain?
Exactly .
Ek scalar kis rank ka tensor hai?
Rank 0.
mein vector ki shape vs mein matrix ki shape?
Vector: , rank 1. Matrix: , rank 2.
tensor mein total elements ki sankhya?
.
kiske barabar hota hai?
(do indices swap karo).
64 RGB images ke batch ki shape?
, ek rank-4 tensor.
Ek matrix ek -vector kyun NAHI hai?
Alag rank (2 vs 1) aur shape; ye alag tarah se broadcast/multiply karte hain.
"Tensor rank/order" vs "matrix rank" — kya fark hai?
Order = axes ki sankhya; matrix rank = linearly independent rows/columns ki sankhya.
elements wale float32 tensor ki memory?
bytes.
Ek scalar ka transpose?
Scalar khud hi ().

Recall Feynman: 12-saal ke bachche ko samjhao

Numbers ke boxes imagine karo. Scalar ek sticky note pe ek number hai. Vector lockers ki ek single row hai — batao kaunsa locker (ek number) aur uski value mil jaati hai. Matrix lockers ki poori ek wall hai — aap row aur column batate ho (do numbers). Tensor bahut saari walls, floors, aur buildings wali ek giant building hai — aap numbers dete rehte ho jab tak ek akele locker ko point nahi kar lete. Jinhe aapko bolna padta hai ek value dhundne ke liye, woh "rank" hai. Saari sizes ko multiply karo aur pata chal jaata hai kitne lockers (numbers) total hain.


Connections

Concept Map

0 indices

1 index

2 indices

k indices

special case of

special case of

special case of

stores

stores

stores

stores

counting principle

determines

Rank = index count

Scalar

Vector

Matrix

Tensor

Loss value

Data example

Layer weights

Batch of images

Element count = product of axis lengths

Memory footprint