Sunday, October 30, 2016

2016/096) Consider the set of integers 1000,1001,1002,...1998,1999,20001000,1001,1002,...1998,1999,2000.

There are times when a pair of consecutive integers can be added without "carrying": 1213+12141213+1214 requires no carrying, whereas 1217+12181217+1218 does require carrying.

For how many pairs of consecutive integers is no carrying required when the two numbers are added?

Solution
Overflow shall not occur in the following cases
1) No digit is greater than 4 and next number digit  is < 5. The lower numbers are 1xxx number of numbers = 125
2) unit digit is 9 so next number unit digit is zetro and no other dight > 4. number of numbers = 25
3) unit and ten's digit is 9 so next number unit and tensdigit is zetro and no other dight > 4. number of numbers = 5
4) 1999 so next number 2000
this gives us 156 numbers

No comments: