Saturday, January 19, 2008

Key Coding

Here are two -

Represent 1 as a summation of repetitive decimals containing either 0 or seven.
Hint : One of them is Bar [0.777777] -- where Bar means the sequence 777777 is repeated indefinitely.

Here is another :

Suppose you have n keys on a circular key chain and wish to put a colored sleeve on each key so that it is identifiable by its color alone, without reference to its shape. For some n this can be done with fewer than n colors. For example, if you have 4 keys then you can place the colors on the keys as follows:

Red
Red Green
Blue

The top key is the red key that is across from the blue key; and the leftmost key is the red key that is adjacent to a blue one; the other two are identifiable by their colors.
An identification scheme must work even if the key chain is flipped over, so one cannot use the words right and left. Let f(n) be the least number of colors necessary so that each key on a chain of n keys can be uniquely identified as explained above. Then f(1) = 1, f(2) = 2,
and f(3) = 3. What is f(123)?