A person wrote down all numbers from 1 to 999 inclusive. How many times was the digit 8 written? I'm not sure how to approach this one... Should I group these into 100's and add up... Or is there a more simple approach to this? Thanks!
P.S: Wasn't sure what the tag was for this one. Sorry.
Start with all the numbers that end in 8.
Their digits look like _ _ 8, and there are 10 choices for each of the other digits. Hence, there are 100 8s in the one's place.
Similarly, for the 10s place: _ 8 _, there are 10 choices for each again, and there are 100 8s in the 10s place.
Finally, using the same technique there are again 100 8s in the 100s place, for a total of 300 8s written down.
Note that this will work for any digit except 0, since we (usually) don't write down leading 0s.