Multiply the Matrices
Problem
[[4,2,5,7,6],[3,1,4,5,9],[2,3,6,8,4],[5,7,1,2,1]]*[[8,3],[4,1],[6,5],[2,7],[9,6]]
Solution
Identify the dimensions of the matrices. The first matrix is 4×5 and the second is 5×2 The resulting matrix will be 4×2
Calculate the elements of the first row by taking the dot product of the first row of the left matrix with the columns of the right matrix.
(R_1,1)=(4×8)+(2×4)+(5×6)+(7×2)+(6×9)=32+8+30+14+54=138
(R_1,2)=(4×3)+(2×1)+(5×5)+(7×7)+(6×6)=12+2+25+49+36=124
Calculate the elements of the second row.
(R_2,1)=(3×8)+(1×4)+(4×6)+(5×2)+(9×9)=24+4+24+10+81=143
(R_2,2)=(3×3)+(1×1)+(4×5)+(5×7)+(9×6)=9+1+20+35+54=119
Calculate the elements of the third row.
(R_3,1)=(2×8)+(3×4)+(6×6)+(8×2)+(4×9)=16+12+36+16+36=116
(R_3,2)=(2×3)+(3×1)+(6×5)+(8×7)+(4×6)=6+3+30+56+24=119
Calculate the elements of the fourth row.
(R_4,1)=(5×8)+(7×4)+(1×6)+(2×2)+(1×9)=40+28+6+4+9=87
(R_4,2)=(5×3)+(7×1)+(1×5)+(2×7)+(1×6)=15+7+5+14+6=47
Final Answer
[[4,2,5,7,6],[3,1,4,5,9],[2,3,6,8,4],[5,7,1,2,1]]*[[8,3],[4,1],[6,5],[2,7],[9,6]]=[[138,124],[143,119],[116,119],[87,47]]
Want more problems? Check here!