bd x2 + (bc+ad) x + ac
Let this polynomial be represented by Ax2 + Bx + C.
Thus A = bd, B=bc+ad, C = ac.
You are given the values of a,b,c,d and your task is to calculate the values of A,B,C. The constraint is that you can carry out only three multiplications.
solution
A = bd
B=bc+ad
C = ac.
There are 4 multiplications
However if we convert B = (a+b)(c+d) – bd – ac = (a+b)(c+d)
– A – C we have 3 multiplications
No comments:
Post a Comment