Solutions to Iftach Nachman's Riddles

Back to the riddles.

1. The hard part is the first question. You ask person A:

 "Is B more likely to lie than C ?"

   If he says yes - B is not the unpredictable
   If he says no  - C is not the unpredictable

   (this is easily verifiable by looking at all options)

   From here it is trivial:

   You can now ask the person who is not the unpredictable "Is the sun shining?"
   and figure whether he is the liar or the truth teller.

   With the last question you can ask him about one of the others
   (e.g. "Is he the unpredictable?"). Of course you should invert his answer if
   you found that he is the liar.


2. At the bottom, you bundle the exposed edges in groups of sizes 1 , 2, ... , 15.
   (120 is the exact sum of that). Lets call those groups b1 ... b15 (for "bottom 1"...)
   , and mark each wire with its group's name.
 

   Go to the top, and find out which wire end belongs to which group, by circuit
   tests using the battery and light bulb.
   For example:

        -  an end belonging to group b1 does not close a circuit with any other end

 -  an end belonging to group b2 closes a circuit with only one other end,
          (which is also a member of group b2)

 -  an end belonging to group b3 closes a circuit with only two other ends,
           (which are also members of group b3)

 ...

   Now, connect the wire ends at the top as follows:
  - group t1 : one wire from each of the groups {b1,b2,...,b15}
  - group t2 : one wire from each of the groups { b2,...,b15}
  .
  .
  .
  - group t15 : one wire from the group b15

   Name the wires at the top according to their two groups (e.g. "t3-b7" ...). The combination of "b" and "t" labels gives each wire a unique name.

   Go back to the bottom. Open all the bundles you formed, and repeat the
   circuit tests you did at the top, to complete the labeling for each wire.


3. The answer is 4. Note that the professor did not ask himself.
It's easy to see the nine possible answers are 0 ... 8 (since 8 is the max number).
Let's call the people by the number of hands they shook.
0 must be the spouse of 8, since all the others shook 8's hand, and so their number is >= 1
Similarly, 1 must be the spouse of 7, if you keep going by the same logic.
2 is with 6, 3 is with 5, and 4 is with 4.
Since the professor didn't ask himself, he got 9 different answers, so he and his wife must be the 4,4 couple.


4. All squares of natural numbers. i.e. bulbs number 1, 4, 9, 16, 25, ..., 100
   Why?
   Bulb N is toggled by dwarf M if M is a factor of N.
   Now, factors go in pairs (M and K are a pair if M*K = N)
   If N is a square, one of its pairs is M*M = N.

   This means N has an odd number of divisors, so it is toggled an odd number of times,
   so it ends up on.
   All the rest are toggled an even number of times, so they end up off.


5. No.
   Assume you can tile a square with N kites.

   1. Each kite has one internal angle > 180`. Lets call it the "big angle"
   2. The sum of angles in a quadrangle is 360`
   3. Each kite's big angle has to lie inside the square, and not on it's boundary.
   4. Only one big angle can participate in each junction (since a junction sums
      up to 360`)

   from 3,4 => There are N internal junctions inside the square, composed of
   internal angles of kites. These junctions sum to 360*N degrees.

   But (from 2) the are only 360*N degrees of kite angles in total
   => No kite can lie on the perimeter of the square.


6. No.

   This comes from the combination of 2 facts:

   I. The process is reversible (You can get from the final placement to the initial
      one, by performing all jumps backwards from the end).

   II. You cannot get from the initial square to a smaller square.
       To see why, draw a grid such that frogs are initially standing on the
       corners of one of the grid's squares. Each jump always lands on one of the
       grid's vertices.

   I. implies that if you can get from a small square to a big one, you can also
   get from a big one to a small one. II. says this is impossible
 


7. The prisoners assign a leader. They decide on the following protocol:

For a non-leader: the first time you arrive at the room when the light is
off - switch it on; In all other cases - do nothing
For the leader: each time you arrive at the room and the light is on -
switch it off, and add one to your counting

When the leader arrives at the room and reached 99 in his counting - he
tells the guard, and they go free.


What is the expected time until release of this protocol?
This, of course, depends on the distribution from which the guard draws
prisoners randomly each day. Let's assume it is uniform.
Let's define two types of events:

Event A: a non-leader prisoner switches the light on
Event B: the leader switches the light off

We require that a sequence of 99X2 events occur in alternating order: A B A
B ...
The total expected time is the sum of expected times for each of these 198
events.
A and B are events of success in a series of Bernoulli trials.
P(A) changes each time: 99/100 , 98/100 , 97/100 , ... , 1/100
P(B) is always 1/100
The expected time until success in a Bernoulli experiment with success
probability P is 1/P

So:

E(T) = E(t_A1) + E(t_B1) + E(t_A2) + E(t_B2) + ...
= 100/99 + 100/1 + 100/98 + 100/1 + ... + 100/1 + 100/1
= 100*(99 + 1/1 + 1/2 + ... + 1/99) =~ 100*(99+5) = 100*104 days =~
28.5 years

And so, they have a fair chance of getting out within their life time...