Enigma 1699

[What happened to 1698? It was boring, that’s what happened.]

Spoiler for New Scientist Enigma 1699:

I woke up one morning last summer near the time of the solstice, and noticed that the clock in the darkened bedroom indicated a time either between 3.40 and 3.45am or between 8.15 and 8.20am – I couldn’t tell which.

When I mentioned this to my eccentric uncle, he produced a defunct clock, which he had altered by making the minute and hour hands identical. He then arranged the hands to a particular setting which corresponded to my bedroom dilemma, and told me that it would be impossible to distinguish, by appearance alone, which of two particular times was being shown by the clock.

Assume that at noon both hands on my uncle’s clock point exactly to the 12 marker. Tell me, to the nearest second, what is the difference (less than 4 hours 40 minutes) between the two times which could have been indicated by my uncle’s clock?

One of the hands, call it hand A, is between the 3 and the 4 while the other, B, is between the 8 and the 9. We don’t know which is the hour hand. Let be the position of hand A as a number between 0 and 60 (so 0 means pointing to 12, 15 means pointing to 3, 30 means pointing to 6, and so on); likewise let be the position of hand B.

If A is the hour hand then it is fraction b/60 of the way between 3 and 4; that is, = 15 + (b/60)*5. Likewise if B is the hour hand then = 40 + (a/60)*5. Or more simply, = 15 + b/12 and = 40 + a/12. Solving these we get a = 2640/143 = 18.4615385 = 18 + 27.69/60 and b = 5940/143 = 41.5384615 = 41 + 32.31/60. So the two possible times are 8:18:27.69 and 3:41:32.31 which differ by 4:36:55 to the nearest second.

Which is kind of boring too.


Enigma 1697

Spoiler for New Scientist Enigma 1697:

I have before me a number, which when written in binary is palindromic and has n digits. If I told you the value of n, and you wrote a list of all the possible palindromic binary numbers of length n, your list would have n numbers in it.

If your list was in ascending numeric order, and I told you the difference between my number and the next higher number in the list, you would be able to identify my number.

What is my number, in decimal form?

I found this one way easier than most Enigmas, though there’s an ambiguity. Are leading zeroes allowed? That is, is 0110 a palindromic binary number for purposes of this puzzle?

Probably not, but we can solve it either way.

If we allow leading zeroes, then there are 2m m-bit (I assume “digit” above means bit) binary numbers, which means there are 2m 2m-bit palindromic binary numbers (obtained by taking each m-bit number and concatenating it with its reversal) and 2m+1 (2m+1)-bit palindromic binary numbers (obtained by taking each m-bit number and concatenating it with either a 0 or a 1 and its reversal). So we’re looking for n = 2m such that 2m = 2m (obviously not 2m+1 = (2m+1)). That’s easy: n = 4. We can just write down the four palindromes — 0000, 0110, 1001, 1111 — then convert to decimal and find the differences or, what the heck, just find them in binary (binary subtraction, it’s good for your brain): 110, 11, and 110. The second difference is unique so the answer is 0110. In decimal, 6.

If we do not allow leading zeroes, then we throw out half the palindromic numbers (each one that begin and ends with 0 has a counterpart that begins and ends with 1, and vice versa) so there are 2m-1 2m-bit palindromic binary numbers and 2m (2m+1)-bit palindromic binary numbers. So we’re looking for n = 2m such that 2m-1 = 2m. This time n = 8. And again it’s easy to write down the palindromes — 10000001, 10011001, 10100101, 10111101, 11000011, 11011011, 11100111, and 11111111 — and get their binary differences — 11000,  1100, 11000, 110, 11000, 1100, 11000. The unique one is 110 so the answer is 10111101 binary or, in decimal, 189.