what is the problem your facing while solving it?

The Gateway to Computer Science Excellence

0 votes

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 _____

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

==> 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

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,297 answers

198,262 comments

104,977 users