π Hadamard Product
β
Definition
If (x,yβRn), then the Hadamard product (element-wise product) is defined as:
[xβy]
π Correction/Addition:
The Hadamard product multiplies corresponding elements of the vectors (element-wise multiplication).
β
Example
xxβyβ=[12β],y=[45β]=[12β]β[45β]=[1Γ42Γ5β]=[410β]β
β Condition
π Correct (clarified):
We cannot apply the Hadamard product if vectors have different dimensions.
x1β=β1234ββ,x2β=β15300ββββ
π Dimensions are different β Not defined
π Dot Product
β
Definition
If ( x,yβRn ), then the dot product is:
xTy
π Addition:
- The result is a scalar (single number)
- It is also called the inner product
Example 1
x=[12β],y=[45β]ββ
xTy=[1β2β]
xTy=1Γ4+2Γ5=14
Example 2
[1β2β3β4β7β9β]β110000ββΒ βΉ=1Γ1+2Γ1+3Γ0+4Γ0+7Γ0+9Γ0=3ββ
π Matrix Multiplication
β οΈ Important Rule (Added)
π Matrix multiplication is only possible when:
(columnsΒ ofΒ A)=(rowsΒ ofΒ B)
AΒ (4Γ5)
π Improved Explanation:
C=AB
Each element is:
cijβ=(rowΒ iΒ ofΒ A)β
(columnΒ jΒ ofΒ B)
π Addition:
Each entry is a dot product of a row and a column.
π Practice Problems
β
Practice 1 (Correct)
[12β][5β6β][510β612β]
π Addition:
This is called an outer product.
β Practice 2 (Checked & Corrected Explanation)
[12β34β01β]β510β213β001β311ββ=[814β511β01β611β]
π Addition:
Each entry is computed using row Γ column dot product.
β
Practice 3 (Correct)
β123ββ[5β6β]β51015β61218ββ
π Addition:
Another example of an outer product.
β Final Summary (Added for Study)
πΉ Hadamard Product
- Element-wise multiplication
- Same dimensions required
- Output: vector
πΉ Dot Product
- Multiply + sum
- Output: scalar
- Requires same dimension
πΉ Matrix Multiplication
- Row Γ Column
- Inner dimensions must match
- Output size:
(mΓn)(nΓp)=(mΓp)