Suppose we have ai,bi,ci∈{0,1,…,9} and A=a2a1a0,B=b2b1b0,C=c1c0. 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)=−((b2,b1,b0,0)−(a2,a1,a0))=−(b2,d1=(b1−a2),d0=(b0−a1),−a0)
−((b2,d1,d0,−a0)+(b2,d1,d0,−a0,0))=−(b2,e2=(b2+d1),e1=(d1+d0),e0=(d0−a0),−a0)
−((b2,e2,e1,e0,−a0)−(c1,c0,0,0))=−(b2,(e2−c1),(e1−c0),e0,−a0)
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