Page 126 - Touhpad Ai
P. 126

Multiplication of Matrices
              The product of two matrices A and B is defined if the number of columns of A is equal to the number of rows of B.
              Consider A = [a ], an m × n matrix and B = [b ] is an n x p matrix. Then the product of the matrices A and B is the matrix
                            ij
                                                     jk
                                                                                                  th
                                                                                    th
              C of order m × p. To get the (i, k)th element i.e c  of the matrix C, we take the i  row of A and k  column of B, multiply
                                                        ik
              them elementwise and take the sum of all these products. For example:
                                                      5 1         26 0
                                                 A =          B =      
                                                      23   2 2    13 4    2 3
                                                                            ×
                                                           ×
                                                                 equal                
                                                                             AB =     
                                                                                        2 3
                                                                                         ×
                                                                         Resultant Matrix, AB is
                                                                           of the order 2 x 3
              Take the first row of matrix A and first column of matrix B. Multiple the corresponding elements and then add them as
              shown. Repeat this step for all columns of B.
                          51         26 0  
               Step 1   A=        B =      
                           2 3        1  3  4 
                                                   11  ?  ? 
                       ⇒   (5 2 1 1) ⇒    11 ⇒          
                             × +×
                                                   ?  ?  ? 

                                       Resultant Matrix, AB getting filled

                          51         26 0  
               Step 2   A=        B =      
                           23          13 4 

                                                11 33 ?
                            × +×
                       ⇒  5 6 1 3 ⇒     33 ⇒         
                                                ?  ?  ? 
                          51       26 0  
               Step 3   A =      B =     
                           23       13  4 
                                               11 33 4
                               +×
                            ×
                       ⇒   5 0 14 ⇒     4 ⇒          
                                               ?  ?  ? 
              Take the second row of matrix A and first column of matrix B. Multiple the corresponding elements and then add them
              as shown. Repeat this step for all columns of B.
                          51    26 0   
               Step 4   A =      B=    
                           23    1  3  4 
                                               11 33 4
                       ⇒   2 2 + × ⇒    7 ⇒          
                            ×
                                3 1
                                               7  ?  ? 
                          51      26 0   
               Step 5   A  =      B =    
                           23      1  3  4 
                                                11 33 4
                                 3 3 ⇒
                            ×
                       ⇒   2 6 + ×       21 ⇒         
                                                7  21 ? 
                          51       26 0  
               Step 6   A =     B =      
                           23       1  3  4 
                                                 11 33  4                  11 33  4 
                            ×
                                 3 4 ⇒
                       ⇒   2 0 + ×       12 ⇒                Finally   AB =       
                                                 7  21 12                  7  21 12   2 3
                                                                                      ×
                 124    Touchpad Artificial Intelligence - XI
   121   122   123   124   125   126   127   128   129   130   131