UGC-NET Jan 2017 · Asymptotic Analysis & Recurrences

MCQ · 2 marks · Problem PROG-DIVC-0042

The minimum number of scalar multiplication required, for parenthesization of a matrix-chain product whose sequence of dimensions for four matrices is $< 5,10,3,12,5> $ is
  1. A
    $630$
  2. B
    $580$
  3. C
    $480$
  4. D
    $405$

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solution\[\boxed{m[i,j]=\min_{i\le k<j}\big(m[i,k]+m[k+1,j]+p_{i-1}p_kp_j\big)}\]Dimensions \(p=\langle5,10,3,12,5\rangle\). Chains of 2: \(m[1,2]=150,\ m[2,3]=360,\ m[3,4]=180\). Chains of 3:\[m[1,3]=\min(0+360+600,\ 150+0+180)=330,\]\[m[2,4]=\min(0+180+150,\ 360+0+600)=330.\]Full chain:\[m[1,4]=\min(0+330+250,\ 150+180+75,\ 330+0+300)=\min(580,405,630)=405.\]The best split is \((A_1A_2)(A_3A_4)\).Answer: D

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com