Question

In: Computer Science

A chain of four matrices A1, A2, A3 and A4, with order 3 X 4, 4...

A chain of four matrices A1, A2, A3 and A4, with order 3 X 4, 4 X 2, 2 X 8 and 8 X 7 respectively. Deduce m[1, 4] to find best possible minimum number of multiplication

Solutions

Expert Solution

Method used For multiple matrix multiplication is MATRIX CHAIN MULTIPLICATION (MCM)

As we know matrix multiplication means multiplying all matrix according to their order and get a resultant matrix with desired order . Matrix can be multiplied only by A x B when no.of columns of A = no. of rows of B.

Challenge is to reduce no of multiplications to obtain the answer

Now there are 5

ways to multiply 4 different matrices using different parenthesis i.e

1.((AB)C)D

2.(A(BC))D

3. (AB)(CD)

4. A((BC)D)

5. A(B(CD))

Now calculate no. of multiplications in each case and find minimal of all .

To multiply two matrices of order mxn and nxp we need m*n*p no. of multiplications .

Case 1.

((A1A2)A3)A4

1. Multiply first A1 and A2 so total no.of multiplication will be 3*4*2 =24 resulting in 3x2 matrix

2. Now multiply resultant of step 1 with A3 in 3*2*8=48 resulting in 3x8 matrix

3 . At last Multiply it by A4 in 3*8*7=168

so total no. of multiplication are 24+48+168=240

Case 2

(A(BC))D

1. Multiply first A2 and A3 so total no.of multiplication will be 4*2*8 =64 resulting in 4x8 matrix

2. Now multiply resultant of step 1 with A1 in 3*4*8=96 resulting in 3x8 matrix

3 . At last Multiply it by A4 in 3*8*7=168

so total no. of multiplication are 64+96+168=328

Case 3 .

(AB)(CD)

1. Multiply first A1 and A2 so total no.of multiplication will be 3*4*2 =24 resulting in 3x2 matrix

2. Now multiply A3 and A4of in 2*8*7=112 resulting in 2x7 matrix

3 . Now multiply both resultant of step 1 and 2 with each other in 3*2*7=42

so total no. of multiplication are 24+112+42=178

Now similarly do this for Case 4 and Case 5 and then take minimum of all the multiplication

Once you do you will find that best possible solution is

Optimal Parenthesization is : ((AB)(CD))

Optimal Cost is : 178

Case 2 result in minimum no. of multiplication to multiply A1 A2 A3 A4 forming m[1,4]

Thank You


Related Solutions

covert the schema into 3NF. TableC (a1,a2,a3,a4,a5) functionally dependencies: a1 --> {a2,a3,a5} a4 --> {a1,a2,a3,a5} a3...
covert the schema into 3NF. TableC (a1,a2,a3,a4,a5) functionally dependencies: a1 --> {a2,a3,a5} a4 --> {a1,a2,a3,a5} a3 -->{a5} Answer: Relation1: Relation2:
For the arithmetic progression a1, a2, a3 .......... if a4/a7 = 2/3. Find a6/a8 ?
For the arithmetic progression a1, a2, a3 .......... if a4/a7 = 2/3. Find a6/a8 ?
Consider the following eight examples: A1 = (4,20), A2 = (4,10), A3 = (16,8), A4 =...
Consider the following eight examples: A1 = (4,20), A2 = (4,10), A3 = (16,8), A4 = (10,16), A5 = (14,10), A6 = (12,8), A7 = (2,4), A8 = (8,18) The distance function is Euclidian distance. Use single-link, complete-link agglomerative clustering, and centroid techniques to cluster these examples. Show your calculations and draw the dendrograms for each technique.
Find an arithmetic code for a symbol p4p4p3 for the source alphabet {a1, a2, a3, a4,...
Find an arithmetic code for a symbol p4p4p3 for the source alphabet {a1, a2, a3, a4, a5}, with symbol probabilities p1 = 0.11, p2 = 0.05, p3 = 0.10, p4 = 0.70, and p5 = 0.04. Show the work please.
Let's say there is a group of five receptors (A1,A2,A3,A4,A5) that are expressed in various types...
Let's say there is a group of five receptors (A1,A2,A3,A4,A5) that are expressed in various types of tissues on the human body. But the A1 receptor, is the only family expressed in 1 type of cell. How does the A1 receptor but not the other A receptors are expressed on the cell?
Let A = {a1, a2, a3, . . . , an} be a nonempty set of...
Let A = {a1, a2, a3, . . . , an} be a nonempty set of n distinct natural numbers. Prove that there exists a nonempty subset of A for which the sum of its elements is divisible by n.
Let A0.A1,A2,A3,A4 devide a unit circle (circle of radius one) into five equal parts. Prove that...
Let A0.A1,A2,A3,A4 devide a unit circle (circle of radius one) into five equal parts. Prove that the chords A0 A1, A0 A2 satisfy: (A0 A1 * A0 A2)^2 = 5.
Store Monthly Profit Monthly Advertising expenditure A1 $13,593.02 $1,710.00 A2 $23,896.73 $1,983.00 A3 $9,932.64 $952.00 A4...
Store Monthly Profit Monthly Advertising expenditure A1 $13,593.02 $1,710.00 A2 $23,896.73 $1,983.00 A3 $9,932.64 $952.00 A4 $9,100.41 $1,009.00 A5 $15,220.08 $2,315.00 A6 $33,900.67 $2,197.00 A7 $6,935.36 $934.00 A8 $10,112.62 $2,375.00 A9 $9,155.14 $1,065.00 A10 $8,513.94 $812.00 A11 $7,933.25 $1,052.00 A12 $11,388.13 $2,234.00 A13 $26,299.72 $2,962.00 A14 $21,423.87 $1,699.00 A15 $21,430.21 $1,991.00 A16 $19,984.96 $2,181.00 A17 $11,575.09 $1,831.00 A18 $18,900.44 $1,819.00 A19 $21,815.24 $2,394.00 A20 $35,642.73 $2,296.00 If Crusty’s is considering spending $1750 on advertising what is the 95% prediction interval...
A four-bit binary number is represented as A3A2A1A0, where A3, A2, A1, and A0 represent the...
A four-bit binary number is represented as A3A2A1A0, where A3, A2, A1, and A0 represent the individual bits and A0 is equal to the LSB. Design a logic circuit that will produce a HIGH output whenever the binary number is greater than 0010 and less than 1000. how can I do this by using sum of product, not K map
For each of the following sequences find a functionansuch that the sequence is a1, a2, a3,...
For each of the following sequences find a functionansuch that the sequence is a1, a2, a3, . . .. You're looking for a closed form - in particular, your answer may NOT be a recurrence (it may not involveany otherai). Also, while in general it is acceptable to use a "by cases"/piecewise definition, for this task you must instead present a SINGLE function that works for all cases.(Hint: you may find it helpful to first look at the sequence of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT