What happens if we do not include the fifth step in the algorithm above? Give examples where the algorithm will work correctly and where it will fail to work.
The World of Algorithms · Question 5 of 15
What happens if we do not include the fifth step in the algorithm above?
Step 5 writes the final carry. Without it, a carry of 1 coming out of the leftmost column would simply be lost, and the answer would be short by one digit.
The algorithm still works whenever the leftmost column adds up to less than 10, so the final carry is 0. For example, : units , tens , hundreds , final carry 0, giving 688. This is correct, and Step 5 was not needed.
The algorithm fails whenever the leftmost column produces a carry. For example, : units , carry 0; tens , write 6, carry 1; hundreds , write 1, carry 1. Without Step 5 the bottom row reads 168, but the correct sum is 1168. Similarly, would give 2 instead of 12, and would give 1000 instead of 11000.
So without Step 5 the algorithm is correct only when the sum has the same number of digits as the longer number.
