Saturday, 17 September 2016

mathematics - Place 4x12 detainees on a 7x7 grid of cells


You are a prison captain and you have got 4 groups of detainees, let's call them Red, Blue, Green and Yellow. You have got 12 of each. The prison is a square grid 7x7 cells. You need to place the 48 detainees into the 49 cells (so 1 cell will remain empty). The catch is that you can't place two detainees of the same colour into adjacent cells (not even corner adjacent, i.e. ones that touch by their corners), as that way they would organize a riot and escape.


Can you do it? If so, how? If no, why?





Note that for instance for 4 detainees per group on a 4x4 grid it's easy:


R B R B
G Y G Y
R B R B
G Y G Y

It's also doable for 2 detainees per group on a 3x3 grid:


R G B
Y - Y

R G B

Answer



There is a solution:



cell layout

A computer program finds 48 solutions. The solution above can have 4! = 24 permutations of the four colours and each solution can be reflected.



No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...