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)\)
- A.
5
- B.
6
- C.
3
- 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.
Compute i * j -> t1
Compute a * b -> t2
Compute t2 + c -> t3
Compute e + f -> t4
Compute t4 * t3 -> t5
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.