Henry Ernest Dudeney/Puzzles and Curious Problems/284 - Lamp Signalling/Solution

by : $284$

 * Lamp Signalling
 * Two spies on the opposite sides of a river devised a method for signalling by night.
 * They each put up a stand, like the diagram, and each had three lamps which could show either white, red or green.


 * Dudeney-Puzzles-and-Curious-Problems-284.png


 * They constructed a code in which every different signal meant a sentence.


 * Note that a single lamp on any one of the hooks could only mean the same thing,
 * that two lamps hung on the upper hooks $1$ and $2$ could not be distinguished from two on, for example, $4$ and $5$.
 * However, two red lamps on $1$ and $5$ could be distinguished from two on $1$ and $6$,
 * and two on $1$ and $2$ from two on $1$ and $3$.


 * Remembering the variations of colour as well as of position, what is the greatest number of signals that could be sent?

Solution

 * $471$.

Proof
With $3$ lamps all of one colour, we can make $15$ distinct messages for each colour.

Because there are $3$ colours, that makes $3 \times 15 = 45$ messages.

With $2$ of one colour and $1$ of another, we can make the same number: $15$ distinct messages.

Each of these admits $3$ variations of colour order, making $45$.

There are $6$ ways of choosing $1$ lamp of one colour and $2$ of another colour.

Hence there are $6 \times 45 = 270$ messages made with $3$ lamps of $2$ colours.

With $1$ lamp of each colour we can make $6 \times 15 = 90$ messages.

With $2$ lamps of one colour we can make $7$ messages.

Because there are $3$ colours, that makes $3 \times 7 = 21$ messages.

With $1$ lamp of one colour and $1$ lamp of another colour, we can get $14$ messages.

There are $6$ ways of choosing $1$ lamp of one colour and $1$ lamp of another colour.

Hence there are $6 \times 14 = 42$ messages made with $2$ lamps of $2$ colours.

With $1$ lamp only, you can make only $1$ message.

As there are $3$ colours, that makes $3$ more messages.

Hence the total:
 * $45 + 270 + 90 + 21 + 42 + 3 = 471$