2. What is Matrix?
• What is Matrix?
– Novel, Movie??
– A Physical/Visual Construct?
• (like grid…, or students in prayer hall)
– Some geometric construct? (like rectangle, square??)
– CS Data Structure (like Two Dimensional Array??)
– Rows….Columns….Other definitions? ...
– Yes, these are all fine, but why do we need this?
• Addition, Subtraction – Oh, ok…. now, I see
• Multiplication – Hey ---- What the heck is this !!!
• Determinant, Inverse ---- ?$%#
• Rank, Eigen-Value, Eigen-Vector----------Bhaago!!
3. Why this kolaveri di?
• Root Cause
– No Surprise, Our education system
– Which divorces the description of mathematical ideas from their
historical context
– Not convinced?
• Google for Matrix Multiplication
• http://en.wikipedia.org/wiki/Matrix_multiplication#General_definition
• Do you still want to study matrices?
• Wrong Sequence
– First Matrix, then addition/subtraction then multiplication – THIS IS
WRONG
– First Matrix Multiplication, then add/subtract, then Matrix – THIS IS
RIGHT
• This presentation is an attempt towards correcting this injustice
done to simple and great idea of MATRIX
4. What is Matrix Multiplication?
• Software Engineer
– (for for for c[I,j] += a[I,k] * b[k,r] )
– One more successful program he wrote without
understanding a, b, c (or m, n, r) of it
• DSP Engineer -
– Convolution, Weighted Sum, FIR, Pipelining…
– Impressive terms , but why matrix?
• Mathematician – See Wikipedia…
• Super Market Clerk -??? –What is he doing here?
– In all probabilities, he was the one who invented
matrix multiplication and hence matrix!!!
5. Super Market – Birth Place of Matrix
Multiplication
• Let me explain…
– Suppose you buy 1 kg Sugar, ½ Liter Milk and 5
cakes of detergent soap.
– Let 1 Kg sugar = Rs. 61; 1 Liter Milk Rs. 40 and 1
cake of soap costs Rs. 25
6. Contd…
• How will you calculate the cost?
=> 1 * 61+ 0.5 *1 + 5 * 1
= (….blank cheque )
=> We can generalize it by applying famous [(price per
unit) * (no units formula)]
1 [sugar price] + 40 [milk price] + 25 [ cake price ]
That’s it!! Above expression is Matrix Multiplication
This [Multiply and Accumulate] “*+” is central concept
at matrix multiplication and hence at matrix
7. Contd…
• This operation reduces it’s two sequences to a
single number, or two vector operands to a scalar
quantity
• Let us see how….
– Split the above formula into two parts
– Price Per Unit (PPU) List = [61 40 25]
– Number Of Units = [1 ½ 5]
• If you want to calculate the bill, you will multiply
corresponding vectors, and add all the terms of
resulting vectors( here, we can consider the term
vector to mean lists)
8. Contd..
Total price
= + ( [61 40 25] .* [1 ½ 5] )
= + ( [61*1 40*1/2 25*5] )
= + ([61 20 125])
= 206
Note two operations here
1. Multiplication between corresponding elements of two
vectors of same size ( no of units * units price
operation). One thing it converts different infos like kg,
liter and 5 pieces to same unit price. This allows
addition to be possible
2. Addition of all elements belonging to same vector
9. Contd…
• These two operations together is called Matrix
Multiplications
+ ([61 40 25] .* [1 ½ 5])
[61 40 25] * [1 ½ 5] ; //note that .* becomes
just * now
This itself represented as
[1 ½ 5] * 61
40
25
10. This visual concept gives birth to idea
of
• A vector in horizontal orientation and another
in vertical.
• But it is just visualization. They could have
been elliptical and diagonal also.
• But, again why this circus? Why we could not
keep both horizontal.
• Answer is…
11. I too do not know
• However, some guesses
• To differentiate .* from * (not convincing enough)
• To keep in-line with addition, and subtraction
- Operands of +, - , .* are of same type
- Result will also be of same type
- But matrix multiplication yields scalar when two
vectors are multiplied. Probably, notation helps to
emphasize this fact that this is not straight multiplication
12. Contd…
• Let us explore further. Let us consider 5 people shopped
in the shop on a particular day. Using the notation
discussed earlier
1½5 61
213
457 40
983
324 25
19 16.5 25
Note that row elements are of different types (sugar milk and soap) where as column elements are of same type.
Keeping the same philosophy , since prices are of same type they better represented as columns. Note that adding a
given column appears natural. For example, if you observe sum row below, it shows total amount of sugar sold in a day.
Same is with Milik and Soap. However, adding all row elements of a row does not make any sense. What is Sugar + Milk
+ Soap? Sweet Washing System?.....Yucc!!! If we want to preserve this convention, price also should be column rather
than row.
13. Contd…
• Now, conventional matrix emerges, with rows
columns etc.,
• I will leave it to you to extend to other matrix
related ideas. (Ab tumhare havaale matrix
saathiyon )
• All the best!!