Find a 10-digit number where the first digit is how many zeros in the number?, the second digit is how many 1s in the number etc. until the tenth digit which is how many 9s in the number.
here is my approach:
let n be the no of zeros.(we don't know exact position of those 'n' zeros yet)
1.write 'n' in 0th place.
digits : n ? ? ? ? ? ? ? ? ?
places: 0 1 2 3 4 5 6 7 8 9
2. now, we got new digit 'n'. write 1 in nth place.
digits: n ? ? ? ? 1 ? ? ? ?
places: 0 . . . . n . . . 9
3.we got digit 1 here, but we cant write 1 in 1's place.
but, we can write 1 in 2's place and 2 in 1's place.
digits : n 2 1 ? ? 1 ? ? ? ?
places: 0 1 2 . . n . . . 9
4.solve for n?
(no of occupied places+n)=10
places filled: {0,1,2,n}
n+4=10
so, n=6.
5.just, write 0's in remaining positions.
finally, solution is
digits : 6 2 1 0 0 0 1 0 0 0
places: 0 1 2 3 4 5 6 7 8 9
places: 0 1 2 3 4 5 6 7 8 9
0 comments:
Post a Comment