Thursday, April 3, 2014

different digits in a digital clock

The other day I was in the bus and there was a digital 12-hour clock in the middle, it was 3:21. I noticed all of the digits were different, when it changed into 3:22 I wondered: how many times a day are the digits in this type of clock different?
It is a really simple calculation to do:
For hours with 1 digit in the hour space (1–9): there are 9 possible values for the hour. It has 2 spaces for the minutes; in the first one there are 6 possibilities (0-5) in which one is repeated in the hour space. Then, in the second space, there are 10 possibilities (0-9) that can occur, but 2 cannot be used because they are repeated in the other two numbers.
                So: 9*5*8 = 360
For hours with 2 digits in the hour space (10-12): 11 cannot be used. There are 2 possible hours (10 and 12) and in the first value of the minutes there are 2 values that cannot be used, and in the second minutes value there are 3 values that were used before.
                So: 2*4*7 = 56
360 +56 = 416 à every 12 hours
There are 2 12 hour periods every day, 2*416 = 832

There you go: a digital 12-hour clock has all different digits 832 times a day.