The Gateway to Computer Science Excellence
0 votes
40 views
Let B1, B2, B3, B4, B5 be five matrices of dimensions 15 x 20, 20 x 17, 17 x 22, 22 x 16, 16 x 23 respectively. The minimum number of scalar multiplications required to find the product B1 B2 B3 B4 B5 using the Matrix Chain Multiplication method _____
in Algorithms by Junior (571 points) | 40 views
0

@mitesh kumar,

what is the problem your facing while solving it?

0
It takes me 20 min to solve  I have done by tabular method is there any other approach to solve such type of problem?
0

@mitesh kumar

i hope there is no another method...

1 Answer

0 votes
B1             B2               B3              B4                B5                            B1B2             B3B4            B5                             B1B2B3B4        B5

                                                                                                ==>      say C1            say C2                          ==>           say C3

15X20       20X17        17X22        22X16         16X23                      15X17            17X16             16X23                    15X16        16X23

              B1B2B3B4B5

==>

             15X23

Now ,

No of multiplications in B1 * B2 (C1) = 15*20*17 = 5100

No of multiplications in B3 * B4 (C2) = 17*22*16 = 5984

No of multiplications in C1 * C2 (C3) = 15*17*16 = 4080

No of multiplications in C3* B5 = 15*16*23 = 5520

Total no of multiplications = 20684
by Junior (549 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,297 answers
198,262 comments
104,977 users