On translating the expression given below into quadruple representation, how…

2019

On translating the expression given below into quadruple representation, how many operations are required?

\((i\ast j)+(e+f)\ast(a\ast b+c)\)

  1. A.

    5

  2. B.

    6

  3. C.

    3

  4. D.

    7

Attempted by 69 students.

Show answer & explanation

Correct answer: B

Answer: 6 operations. Explanation: break the expression into primitive binary operations and count them.

  1. Compute i * j -> t1

  2. Compute a * b -> t2

  3. Compute t2 + c -> t3

  4. Compute e + f -> t4

  5. Compute t4 * t3 -> t5

  6. Compute t1 + t5 -> t6 (final result)

Quadruple representation (op, arg1, arg2, result):

  • (*, i, j, t1)

  • (*, a, b, t2)

  • (+, t2, c, t3)

  • (+, e, f, t4)

  • (*, t4, t3, t5)

  • (+, t1, t5, t6)

Counting these quadruples shows there are six operations total.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor