Imagine a triangle of coins on a table so that the first row has one coin in it and the second row has two coins in it and so on. If you can only move one coin at a time, how many moves does it take to make the triangle point the other way?
For a triangle with two row it is one, for a triangle with three rows it is two, for a triangle with four rows it is three.
For a triangle with five rows is it four?
It takes 5 moves to make the triangle with 5 rows point the other way.
0 = a coin that has not been moved.
X = the old position of the moved coin
8 = the new position of the moved coin.
____8 0 0 0 8
_____0 0 0 0
____X 0 0 0 X
For triangle of any number of rows, the optimal number of moves can be achieved by moving the vertically symmetrical coins i.e. by moving same number of coins from bottom left and right, and remaining coins from the top.
For a triangle with an odd number of rows, the total moves require are :
(N2/4) - (N-4) Where N = 4, 6, 8, 10, ...
For a triangle with even number of rows, the total moves require are :
((N2-1)/4) - (N-4) Where N = 5, 7, 9, 11, ...
Kabarnya Liverpool memprediksi perburuan gelar Premier League musim depan. Untuk The Reds, pria berumur 39 tahun tersebut meyakini bahwa mereka bakalan fin...