I know that the algorithm for multiplying 2 matrices is defined as:
$$(AB)_{ij} = (\text{row }i\text{ of matrix }A) ⋅ (\text{column }j\text{ of matrix }B)$$
And I know that matrix multiplication is associative. So in the case of 3 matrices:
$$(A ⋅ B) ⋅ C = A ⋅ (B ⋅ C)$$
Is there an algorithm for matrix multiplication that can multiply 3 matrices simultaneously?
For example, could one evaluate the expression $ABC$ without first evaluating either of:
- $(AB) ⋅ C$
- $A ⋅ (BC)$
Additional questions
I am in high school, so I am not sure if this is the correct terminology, but I read somewhere about binary operations, where for instance, an operation such as normal multiplication takes 2 elements (such as 2 real numbers) and produces an output, and you can't multiply 3 numbers together simultaneously.
- Is matrix multiplication a binary operation, where you can't multiply 3 matrices simultaneously?
- Is $A ⋅ B ⋅ C$ defined as $(A⋅ B)⋅ C$ or $A⋅ (B⋅ C)$?
- Is the omission of the parentheses in $A⋅ B⋅ C$ (matrices) just a form of notation?
- What is the most precise way to interpret expressions of multiplication or addition (associative operations) with more than 3 variables - where there are no brackets, such as $A⋅B⋅C⋅D$ ?
There is a way to compute these matrices directly with notation involving summation. Assume the result of matrices to be $Y$ then: $$Y_{i,j}=\sum_{k_1=1}^n \sum_{k_2=1}^n A_{i,k_1}B_{k_1,k_2}C_{k_2,j}$$
This direct way is suitable opposed to the example in cited answer.Assuming $2×2$ matrix, you would need $4 × 2× 1=8$ additions and $4×2×2=16$ multiplications in the normal way of multiplying two matrices and then multiplying the resultant with other. --Referring to comment by @r.e.s. the method involves more arithmetic operations.