Suppose we have $a_i, b_i, c_i \in \{0, 1, \dots , 9\}$ and $A=a_2a_1a_0, B=b_2b_1b_0, C=c_1c_0$. We want to perform the following operations with the restriction that only one digit operation is allowed to perform during the intermediate result
$(1 - 10)(A - B.10) + C.100$
My approach
$-(B.10 - A) = -((b_2,b_1,b_0,0) - (a_2,a_1,a_0)) = -(b_2, d_1=(b_1-a_2), d_0=(b_0-a_1), -a_0)$
$-((b_2,d_1,d_0,-a_0) + (b_2,d_1,d_0,-a_0,0)) = -(b_2, e_2=(b_2+d_1), e_1=(d_1+d_0), e_0=(d_0-a_0), -a_0)$
$-((b_2,e_2,e_1,e_0,-a_0) - (c_1,c_0,0,0)) = -(b_2, (e_2-c_1), (e_1-c_0) , e_0, -a_0)$
After the above three steps now we can perform the borrow operation to obtain the correct result. But my above algorithms is not working correctly for example (1 - 10)(384 - 5780) + 6400
Where am I making mistake?
Answer
As a start,
I would first get rid of some of the
minus signs,
and write it as
(10-1)(10B-A)+100C.
The next step would be
10(10B-A)-(10B-A)+100C.
Then, find 10B-A
and get the combined digits.
Are you allowed to write the first part
as 9(10B_A)?
No comments:
Post a Comment