The GATE Grind

GATE 2011 CS (CS1) – Question 48

Algorithms · Dynamic Programming · 2 marks · Multiple choice

Matrices M₁,M₂,M₃,M₄ have dimensions p×q,q×r,r×s,s×t. With p=10,q=100,r=20,s=5,t=80, find minimum scalar multiplications.

  1. 248000
  2. 44000
  3. 19000
  4. 25000

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) 19000

Explanation

Pair costs are 20000,10000,8000. Triple minima are m₁₃=min(10000+5000,20000+1000)=15000 and m₂₄=min(8000+160000,10000+40000)=50000. Final splits cost 130000,44000,19000. The optimum ((M₁(M₂M₃))M₄) costs 10000+5000+4000=19000, C.

More Dynamic Programming questions

All Dynamic Programming questions →