could anyone plz explain this method more clearly?

Dark Mode

1,508 views

1 vote

The question is incomplete

The given dimensions are <5, 10, 3, 12, 5>

now we have 4 matrices

1st matrix size 5X10

2nd matrix size 10X3

3rd matrix 3X12

4th matrix 12X 5

let the matrices be A ,B,C and D since we have to parenthesize the matrix chain following cases are possible

Case 1:

(A*B)*(C*D)

Case 2:

(A*(B*C))*D

case 3:

A*(B*(C*D))

case 4:

A*((B*C)*D)

case 5:

((A*B)*C)*D

we have to evaluate each case find the case with minimum scalar multiplications

Case 1:

first we multiply first and second matrices so total number of scalar multiplications are 5*10*3=150

the resultant matrix size is 5X3 let it be T1

then by multiplying C and D matrices total number of scalar multiplications possible are 3*12*5=180

the resultant matrix size is 3X5 let it be T2

finally by multiplying T1 and T2 the total number of scalar multiplications possible are 5*3*5=75

hence total number of scalar multiplications possible are 150+180+75=405

similarly evaluate all the cases and the case with minimum number of scalar multiplications will be the answer

The given dimensions are <5, 10, 3, 12, 5>

now we have 4 matrices

1st matrix size 5X10

2nd matrix size 10X3

3rd matrix 3X12

4th matrix 12X 5

let the matrices be A ,B,C and D since we have to parenthesize the matrix chain following cases are possible

Case 1:

(A*B)*(C*D)

Case 2:

(A*(B*C))*D

case 3:

A*(B*(C*D))

case 4:

A*((B*C)*D)

case 5:

((A*B)*C)*D

we have to evaluate each case find the case with minimum scalar multiplications

Case 1:

first we multiply first and second matrices so total number of scalar multiplications are 5*10*3=150

the resultant matrix size is 5X3 let it be T1

then by multiplying C and D matrices total number of scalar multiplications possible are 3*12*5=180

the resultant matrix size is 3X5 let it be T2

finally by multiplying T1 and T2 the total number of scalar multiplications possible are 5*3*5=75

hence total number of scalar multiplications possible are 150+180+75=405

similarly evaluate all the cases and the case with minimum number of scalar multiplications will be the answer

0 votes

The given dimensions are <5, 10, 3, 12, 5>

now we have 4 matrices

1st matrix size 5X10

2nd matrix size 10X3

3rd matrix 3X12

4th matrix 12X 5

let the matrices be A ,B,C and D since we have to parenthesize the matrix chain following cases are possible

Case 1:

(A*B)*(C*D)

Case 2:

(A*(B*C))*D

case 3:

A*(B*(C*D))

case 4:

A*((B*C)*D)

case 5:

((A*B)*C)*D

we have to evaluate each case find the case with minimum scalar multiplications

Case 1:

first we multiply first and second matrices so total number of scalar multiplications are 5*10*3=150

the resultant matrix size is 5X3 let it be T1

then by multiplying C and D matrices total number of scalar multiplications possible are 3*12*5=180

the resultant matrix size is 3X5 let it be T2

finally by multiplying T1 and T2 the total number of scalar multiplications possible are 5*3*5=75

hence total number of scalar multiplications possible are 150+180+75=405

similarly evaluate all the cases and the case with minimum number of scalar multiplications will be the answer