Assume that multiplying a matrix \(G_1\) of dimension \(𝑝 × 𝑞\) with another…

PYQ GATE 2018

Assume that multiplying a matrix G1G_1 of dimension 𝑝×𝑞𝑝 × 𝑞 with another matrix G2G_2 of dimension 𝑞×𝑟𝑞 × 𝑟 requires 𝑝𝑞𝑟𝑝𝑞𝑟 scalar multiplications. Computing the product of n matrices G1G2G3…GnG_1G_2G_3…G_n can be done by parenthesizing in different ways. Define GiGi+1G_i G_{i+1} as an explicitly computed pair for a given paranthesization if they are directly multiplied. For example, in the matrix multiplication chain G1G2G3G4G5G6G_1G_2G_3G_4G_5G_6 using parenthesization (G1(G2G3))(G4(G5G6)),G2G3(G_1(G_2G_3))(G_4(G_5G_6)), G_2G_3 and G5G6G_5G_6 are the only explicitly computed pairs.

Consider a matrix multiplication chain F1F2F3F4F5F_1F_2F_3F_4F_5, where matrices F1,F2,F3,F4F_1, F_2, F_3, F_4 and F5F_5 are of dimensions 2×25,25×3,3×16,16×12×25, 25×3, 3×16, 16×1 and 1×10001×1000, respectively. In the parenthesization of F1F2F3F4F5F_1F_2F_3F_4F_5 that minimizes the total number of scalar multiplications, the explicitly computed pairs is/are

  1. A.

    F1F2F_1F_2 and F3F4F_3F_4 only

  2. B.

    F2F3F_2F_3 only

  3. C.

    F3F4F_3F_4 only

  4. D.

    F1F2F_1F_2 and F4F5F_4F_5 only

Attempted by 154 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…