View Problem: Multiplying Nines
The trick lies in writing a number with K 9's (i.e. 999...9 occurring K times) as 10K-1. So, the numbers A and B can be written as A = 10N-1 and B = 10M-1.
A x B = (10N-1) x (10M-1) = 10N+M - 10N - 10M + 1
Without loss of generality, let N >= M. Let us now try to compute the above result:
The trick lies in writing a number with K 9's (i.e. 999...9 occurring K times) as 10K-1. So, the numbers A and B can be written as A = 10N-1 and B = 10M-1.
A x B = (10N-1) x (10M-1) = 10N+M - 10N - 10M + 1
Without loss of generality, let N >= M. Let us now try to compute the above result:
10000...0000 // N+M 0's
- 1000..000 // N 0's
- 100..00 // M 0's
+ 1
-------------------------------------------------------------
[(M-1) 9's] [1 8] [(N-M-1) 9's] [1 9] [(M-1) 0's] [1 1]
-------------------------------------------------------------
The answer can obtained by making simple observations while performing the subtractions and addition as shown above.
This comment has been removed by the author.
ReplyDeleteWOW! This is mind BLOWING!
ReplyDelete