Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

# DSA - Grand Test -Q14

Warning: count(): Parameter must be an array or an object that implements Countable in /home/customer/www/thegatebook.in/public_html/qa/qa-include/qa-theme-base.php on line 177

Dimensions $\dpi{100} p_0,p_1,...,p_n$ corresponding to matrix sequence $\dpi{100} A_1,A_2,...,A_n$ where $\dpi{100} A_i$ has dimension $\dpi{100} p_{i-1}\times p_i$. Given a chain of four matrices $\dpi{100} A_1,A_2,A_3$ and $\dpi{100} A_4$, with $\dpi{100} p_0 = 5, p_1 = 4,p_2=6,p_3=2$ and $\dpi{100} p_4 = 7$. The minimum number of scaler multiplications required to find the product $\dpi{100} A_1,A_2,A_3,A_4$ using the basic matrix multiplication method is ______

reshown Sep 10, 2020

+1 vote

basically at best you can do is you need 2 in all the multiplications

$A_{5\times 4}$ $B_{4\times 6}$ $C_{6\times 2}$ $D_{2\times 7}$

club BC first

A(BC)D

number of scalar multiplications =$4\times 6\times 2$  ------(i)

You will get $A_{5\times 4}BC_{4\times 2}D_{2\times 7}$

multiply A with BC

you will need $5\times4 \times2$ scalar multiplications ---------(ii)

You will get

$ABC_{5\times 2}D_{2\times 7}$

you will need $5\times 2\times 7$ scalar multiplication ----------(iii)

to get $ABCD_{5\times 7}$

Number of scalar multiplications (add (i),(ii) and (iii)

=${\color{Golden} 158}$

answered Sep 26, 2020 by (11,240 points)
selected Sep 26, 2020