Neural networks and deep learning are the buzzwords of the day. Here is a puzzle that shows the basic mechanics of a neural network.

We’re going to create a simple network that converts binary numbers to decimal numbers. Imagine a network with just two layers — an input layer consisting of three units and an output layer with seven units. Each unit in the first layer connects to each unit in the second, as shown in the figure below.

As you can see, there are 21 connections. Every unit in the input layer, at a given point in time, is either off or on, having a value of 0 or 1. Every connection from the input layer to the output layer has an associated weight that, in artificial neural networks, is a real number between 0 and 1. Just to be contrary, and to make the network a touch more similar to an actual neural network, let us allow the weight to be a real number between –1 and 1 (the negative sign signifying an inhibitory neuron). The product of the input’s value and the connection’s weight is conveyed to an output unit as shown below. The output unit adds up all the numbers it gets from its connections to obtain a single number, as shown in the figure below using arbitrary input values and connection weights for a single output unit. Based on this number, the output number decides what its state is going to be. If it is more than a certain threshold, the unit’s value becomes 1, and if not, then its value becomes 0. We can call a unit that has a value of 1 a “firing” or “activated” unit and a unit with a value of 0 a “quiescent” unit.

Our three input units from top to bottom can have the values 001, 010, 011, 100, 101, 110 or 111, which readers may recognize as the binary numbers from 1 through 7.

Now the question: Is it possible to adjust the connection weights and the thresholds of the seven output units such that every binary number input results in the firing of only one appropriate output unit, with all the others being quiescent? The position of the activated output unit should reflect the binary input value. Thus, if the original input is 001, the leftmost output unit (or bottommost when viewed on a phone, as shown in the top figure) alone should fire, whereas if the original input is 101, the output unit that is fifth from the left (or from the bottom on a phone) alone should fire, and so on.

If you think the above result is not possible, try to adjust the weights to get as close as you can. Can you think of a simple adjustment, using additional connections but not additional units, that can improve your answer?

As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.

Happy neuron-firing over the weekend!

]]>

This was not a very difficult puzzle, but I got correct answers only from the two people who solve every puzzle – Pratik Poddar and Suman Saraf – thank you and well done!

(a) Color the board like a chessboard, i.e. alternate black and whites. Notice that a bug on a white square can only travel to a black and vice versa. Since there are a total of 81 squares, there will be one more white square (or one more black square). Hence when the bugs move, there will correspondingly be at least one empty white square (or black square).

(b) Bugs can change places pairwise. One can leave only the bug in the centre square or the corner, which will be the only empty square.

Hope you all enjoyed the puzzle!

]]>

A person has 10 friends. Over several days he invites some of them to a dinner party so that the company never repeats itself i.e. the exactly the same set of people cannot repeat itself on any of the days. He may, however, not invite anyone on one of the days. For how many days can he continue to invite people without repetition?

As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.

Happy partying…and there will be a lot of it!

]]>

This puzzle can be solved using the concept of “invariants” and parity.

Note that for any numbers a and b (a > b), numbers a and b get replaced by c. If a and b are both odd or both even, then c will be even. If one of them is odd and the other is even, then c will be odd. Essentially, in all the cases, if (a+b) is odd, c will be odd; If (a+b) is even, then c will be even. Therefore, parity of a+b is an invariant.

For the final set of numbers to be zero (which is even parity), the sum of all the numbers must be even, i.e. 1, 2, 3, …., 1989 must add up to an even number, which is not the case. Hence we can never achieve zeros as the final state.

Hope you all enjoyed the puzzle!

]]>

Each square of a 9 x 9 board has a bug sitting on it. On a signal, each bug crawls onto one of the squares which shares a side with the one the bug was on. (a) Prove that one of the squares is now empty. (b) Can the bugs move so that there would be exactly one empty square?

As always, please send your answers as comments within the blog (preferred), or send an e-mail to alokgoyal_2001@yahoo.com. Please do share the puzzle with others if you like, and please also send puzzles that you have come across that you think I can share in this blog.

Happy bugging!

]]>

I am taking the liberty of copying the answer from Pratik – I find it to be very succinctly articulated.

]]>

There numbers 1, 2, 3, ….. , 1989 are written on a blackboard. It is permitted to erase any two of them and replace them with their difference. Can this operation be used to obtain a situation where all the numbers on the blackboard are zeros?

Happy zeroing in on the solution!

]]>

The answer is “Not Possible”. This is a simple application of graph theory. I am copying the answer directly from Vishal Poddar:

Lets consider 5 slots in each telephone. Every wire will occupy 2 slots.

Total slots 15*5=75.

Total wires require = 75/2 = 37.5 which is not an integer. Therefore not possible.

Hope you all enjoyed the puzzle!

]]>

The numbers from 1 to 64 have been placed in each square on a chessboard such that each number appears exactly once. Prove that there will be two squares sharing an edge whose numbers will differ by more than 4.

Happy Eid!

]]>

Here is the answer from Mahi, and I am also reproducing the answer from the original source.

6 + 66 + 666 …….

6 (1+11+111+1111…)

6(10-1/9 +100-1/9 + 1000-1/9 …..)

6/9 (10+100+1000……-100)

2/3(1(100 times) – 100)

2/3(1(98 times) followed by 010)

2({1(98 times) followed by 010} / 3)

2(037(32 times) followed by 03670)

Hope you all enjoyed the puzzle!

]]>

From square marked 1 to square marked 64, the maximum manhattan distance possible between the two squares is 14 and the maximum difference between any two numbers is 63. Since 63/14>4, there has to be at least one step where the jump is greater than 4. Hence proved.

Hope you all enjoyed the puzzle!