Using matrix multiplication method.
A is pxq and B is qxr then AB contains pqr no of multiplications.
if c is rxs then ((AB)C) no of multiplications=pqr+prs.
Using above statements find no of multiplications for two matrices.
Case I)
A1 =10x100,A2=100x5,A3=5x50.
((A1A2)A3) :first find A1A2(=P) no of muls=10*100*5=5000.//A1A2= P(assume)
then PA3 : P is 10x5 and A3 is 5x50
no of muls=10*5*50=2500.
Total no of multiplications=5000+2500=7500.
Case II)
(A1(A2A3)) :first A2A3(=Q) no of muls=100*5*50=25000.//A2A3=Q(assume)
(A1Q). Q is 100x50 and A1 is 10x100.
no of muls=10*100*50=50000.
Total no of multiplications=50000+25000=75000.
Compare both first one is 10 times faster than 2nd one.