Kazaam the wizard lives in the kingdom of Liars and Knights. He is planning a grand illusion for the King's golden jubilee, in which he will make hundreds of people appear to turn into gold.
Kazaam plans to lay out markers on the parade ground for the people in the illusion to stand on. For the illusion to work, the markers must be laid out in a perfectly square grid, with an even number of rows and columns. Every marker must have a liar or knight standing on it, arranged such that they each can say that every person standing next to them in the same row or the same column is of the opposite persuasion (i.e. every knight can say that all adjacent markers have a liar standing on it, and vice versa).
The last detail required for Kazaam's spell to work is that at least 37% of the people in the illusion must be knights. What is the minimum number of rows and columns needed to accommodate this ratio of knights to liars, keeping in mind Kazaam wants at least 100 people in the illusion?
I haven't found a solution that isn't more than a little over 1/3... The only solution I found was a 4/4 grid.
KLLK
LLKL
LKLL
KLLK
The two rules to remember when creating where liars and knights could be (in order to fulfil the "Opposite" condition) are:
Knights must be around all liars
Liars must be not be around all knights
One possible solution for an "at least 1/3 must be knights" would be to take any sized grid (not divisible by 3) and repeat KLLKLLKLL so on going across first then down. (to do divisible by 3, just repeat when starting a new row)
I don't know how to "improve" this to 37% though
|
Posted by Gamer
on 2003-06-24 09:35:37 |