GATE CSE 2018 Q41: Explicitly computed pairs in optimal matrix chain parenthesization of five matrices
- Algorithms
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topic: Algorithm design techniques: greedy, dynamic programming and divide-and-conquer
Question
Assume that multiplying a matrix of dimension with another matrix of dimension requires scalar multiplications. Computing the product of matrices can be done by parenthesizing in different ways. Define as an explicitly computed pair for a given paranthesization if they are directly multiplied. For example, in the matrix multiplication chain using parenthesization , and are the only explicitly computed pairs.
Consider a matrix multiplication chain , where matrices and are of dimensions , , , and , respectively. In the parenthesization of that minimizes the total number of scalar multiplications, the explicitly computed pairs is/are
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: C (official GATE 2018 final answer key)
Concept used: Matrix chain multiplication dynamic programming: the optimal split points determine which adjacent pairs are multiplied directly.
First step: Notice that has a column dimension of 1, so collapsing down to a matrix before multiplying by is cheap; run the DP (or compare candidate splits) for .
Full step-by-step solution
Loading…
Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.
More questions on Algorithm design techniques: greedy, dynamic programming and divide-and-conquer
Every PYQ on this topic →Share this question
Source: official GATE 2018 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs