15 Puzzle

On the picture, you can see the famous “15 Puzzle”. The rules are simple – you can slide any of the 15 squares to the empty spot if it neighbors with it. The question is: if the squares with numbers 14 and 15 are exchanged, can you solve the puzzle, i.e. can you bring it to the state shown on the picture?

No, you can’t. In order to see this, at each moment count the number of pairs of little squares, which are wrongly ordered. For example, if the numbers on the first row are 7, 2, 12 and 5 in this order, then 7 and 2, 7 and 5, and 12 and 5 are wrongly ordered. Notice that after every move you make, the number of wrongly ordered pairs changes with an odd number – ± 3 or ± 1. If you want to go from the state in which squares 14 and 15 are exchanged to the solved state on the picture, you must make an even number of moves and therefore you would change the number wrongly ordered pairs by an even number. However, the number of wrongly ordered squares in the starting state is 1, whereas in the ending state is 0, which yields a contradiction.

Three Voting Prisoners

Each night one of three prisoners has steak for dinner, while the other two have fish tacos. Also every night, each of the three prisoners votes for one of the following two options:

  1. All of us have had steak at least once.
  2. Don’t know yet.

If a majority go with option 2, nothing happens that night. If a majority go with option 1, then they are set free if they are right and executed if they are wrong. The distribution of votes is kept secret, so it is unknown what each of the others voted. Also, it is known that every prisoner eventually will get a steak.

The three prisoners can have a brief strategy meeting and after that, they are not allowed to communicate.  What should the prisoners’ strategy be?

The prisoner who gets a steak the first night should always vote 2, whereas the other two prisoners should vote 2 until the night they get a steak, and 1 every night after.

Source:

Puzzling StackExchange

Digital Scale

You have 10 unlimited piles of balls and one digital scale. All balls in a pile have the same weight, which is an integer between 1 and 9 grams. How many measurements do you need in order to find the weight of the balls in every pile?

You need only one measurement – take 1 ball from pile 1, 10 balls from pile 2, 100 balls from pile 3, etc., and measure their total weight. The first digit of the number shown on the scale determines the weight of the balls in the 10th pile, the second digit determines the weight of the balls in the 9th pile and so on.

Wine and Water

You have two 1 liter mugs – one of them halfway filled with water and the other one halfway filled with wine. You pour 300ml water from the first mug into the second one, stir it well, then pour 300ml of the mix from the second mug back to the first one. Now, do you have more water in the first mug than you have wine in the second one?

If you have X ml water in the first mug, then in the second mug you have 500-X ml water and X ml wine. Therefore you have exactly as much water in the first mug as you have wine in the second one.

Non-Negative

You have a rectangular grid and arbitrary real numbers in its cells. You are allowed repeatedly to multiply the elements in any row or any column by -1. Prove that you can make all row sums and all column sums non-negative simultaneously.

If there is any row or column in the grid with a negative sum, multiply it by -1. Since on every step the total sum of the numbers in the grid increases, we will be able to do this procedure only finitely many times. In the end, all row sums and column sums will be non-negative.