Add two 4-digit numbers using the steps we have written down. Make sure you follow the steps precisely; do not perform any action that is not explicitly mentioned. Are you able to obtain the correct result?
The World of Algorithms · Question 1 of 15
Add two 4-digit numbers using the steps we have written down.
Take the two 4-digit numbers 4738 and 2596.
Step 1: Write the numbers one below the other with the digits aligned from right to left.
Steps 2 to 4: Add the columns from right to left, one at a time, using the carry.
The working, column by column:
| Column | Digits | Carry in | Sum | Write | Carry out |
|---|---|---|---|---|---|
| units | 8 + 6 | 0 | 14 | 4 | 1 |
| tens | 3 + 9 | 1 | 13 | 3 | 1 |
| hundreds | 7 + 5 | 1 | 13 | 3 | 1 |
| thousands | 4 + 2 | 1 | 7 | 7 | 0 |
Step 2 (units): , which is more than 10, so write 4 and set carry to 1.
Step 3 (tens): , more than 10, so write 3 and set carry to 1.
Step 4 repeats Step 3 (hundreds): , write 3, carry 1.
Step 4 repeats Step 3 (thousands): , less than 10, write 7, carry 0. There are no more digits on the left.
Step 5: The carry is 0, so nothing more is written.
So , which is correct.
But the steps do not always work when followed literally. Step 2 and Step 3 only say what to do when the sum is less than 10 or more than 10. They say nothing about a sum of exactly 10. Try 3347 + 2729:
Units: , write 6, carry 1. Tens: , write 7, carry 0. Hundreds: . The sum is neither less than 10 nor more than 10, so the steps tell us neither what to write nor what carry to set. Following them precisely, we are stuck.
If we read "more than 10" as "10 or more" (as the text before the algorithm says: carry when the total is equal to or more than 10), we write 0, carry 1, and then thousands: , giving , which is correct.
Conclusion: For numbers where no column adds up to exactly 10, the steps give the correct result. To work for all numbers, the second case in Steps 2 and 3 should read "If the sum is 10 or more".
