Or think of a clock. Subtracting X hours is always the same as adding (12-X) hours. Or any circle, turning counterclockwise X degrees is always the same as turning clockwise (360-X) degrees. The trick is being able to take the compliment digit-wise in order to replace a subtraction with an addition. In binary this is just flipping 0 to 1 and vice versa. In base 10 you just need to remember 5 pairs of digits to switch out with each other.
8467 - 4583 =
8467
+ 5416 (9's complement of 4583)
= 13883
+ 1 (10's complement)
= 13884
- 10000
= 3884
>> Direct subtraction with paper and pencil isn't much more difficult than direct addition anyway. If you want to do it in your head, I'd prefer a single-step method instead of having to remember the intermediate results.
This isn't really a technique for humans, but computers. You can implement add with carry pretty easily with a bunch of logic gates, but what about subtraction where you need to jump across several columns to borrow, keeping track across the entire minuend? Computers don't typically have those little tick marks beside each digit, or scrap paper. It is easy to set a "subtracting" flag though, and invert the subtrahend (1's compliment), and then feed the first carry-in of the ALU with the same signal as the subtract flag (add 1 for 2's complement). You could come up with your own complete subtraction logic, but it's definitely easier to use the same core addition with a tiny bit of extra to handle subtraction and then use a method like this.
> The ten's complement of 4583 is 5417
It looks like here you are calculating 9999 - 4583 = 5416 (an easy subtraction), then adding one.
> (the complement is the remainder to the next power of ten, in that case to 10000)
Is remainder a correct term here? It's confusing because if you divide 4583/10000, the remainder is 4583. Modulo of -4583 by 10000 is 5417 though.
> This is much easier to calculate than the direct subtraction.
This is not clear to me. Is it because when you calculate 9999-yyyy, you never need to borrow? Or when you calculate 10000-yyyy, you always make a simple borrow? In any case, I feel this still takes some practise because what was a single subtraction becomes two or more steps.
Direct subtraction with paper and pencil isn't much more difficult than direct addition anyway. If you want to do it in your head, I'd prefer a single-step method instead of having to remember the intermediate results.