Multiplying a matrix and a matrix requires pqr multiplications.
AB requires multiplications.
BC requiresmultiplications.
CD requiresmultiplications.
Product of AB and C requiresmultiplications.
Product of A and BC requiresmultiplications.
Product of BC and D requiresmultiplications.
Product of B and CD requires multiplications.
Product of AB and CD requires role="math" localid="1668665662254" multiplications.
Product of ABC and D requires multiplications.
Product of A and BCD requiresmultiplications.
Combining this information, we can determine the number of multiplications required for each matrix product (Note: The product in the most inner set of brackets occur first, then the product in the outer set of brackets and then the remaining two products):
(AB)C)D requires multiplications.
(AB)(CD) requires multiplications.
(A(BC))D requires multiplications.
A((BC)D) requires multiplications.
A(B(CD)) requires multiplications.
Thus A((BC)D) requires the least number of multiplications.