The second approach requires more than 4 times as many multiplications! Therefore, the minimum number of multiplications required to compute ABC is 32000 by using our first approach. The total number of multiplications with this strategy is 60000+120000=180000 multiplications. We then calculate A(BC) producing a 20圆0 matrix requiring 20x100圆0=120000 multiplications.Ĭ). We first calculate BC producing a 100圆0 matrix requiring 100x10圆0=60000 multiplications.ī). The total number of multiplications with this strategy is 20000+12000=32000Ī). We then calculate (AB)C producing a 20圆0 matrix requiring 20x10圆0=12000 multiplications.Ĭ). We first calculate AB producing a 20x10 matrix requiring 20x100x10=20000 multiplications.ī). Below is an example illustrating how the different evaluation order can change the amount of work we need to do.Ī). We can parenthesize the expression ABC in two ways: A(BC) and (AB)C. Using this property, we can parenthesize the expression differently to minimize the number of multiplications required to evaluate the full expression. For example, given matrices A, B, and C, the following property holds: (AB)C = A(BC) Note that matrix multiplication is associative, and this isn't the only way to parenthesize the above expression. We can naively perform the multiplication from left to right which implies the following parenthesis for our expression from above: (((((((((AB)C)D)E)F)G)H)I)J)K. we want to know their product: ABCDEFGHIJK. Sometimes you have a long sequence of matrices to multiply together.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |