Here is a strategy for 2 people/hats:
- 0th writes same as the other number
- 1st writes opposite of the other number
strat2=: {: , [EMAIL PROTECTED]
load'strings'
allhats=: #~ #: [EMAIL PROTECTED]
match=: +./@:="1
show=: ('0';'-';'1';'x') rplc~"1 ":
show match /~ allhats 2 NB. nice pics with viewmat
0 0 1 1 0th writes
has 0 1 0 1 1st writes
0 0 x x x -
0 1 x x - x
1 0 x - x x
1 1 - x x x
(match strat2)"1 allhats 2
1 1 1 1
allhats 2
0 0
0 1
1 0
1 1
--- Raul Miller <[EMAIL PROTECTED]> wrote:
> On 6/5/07, Andrew Nikitin <[EMAIL PROTECTED]> wrote
> > Here is a puzzle for your enjoyment. I saw it recently and it was new to me.
> > I am not sure I would have solved it if I hadn't used J.
>
> If I understand your puzzle statement correctly, it's equivalent to
> Define strategy where
> setup=: *./@(= 1 (''$strategy)\. ])@:[EMAIL PROTECTED]
> setup 88
> must always return true. (I've changed the numeric range from 1..88
> to 0..79, but that doesn't change the nature of the problem.)
>
> It seems to me that any strategy that works for setup 88 should also
> work for setup 2.
>
> This becomes equivalent to the problem:
> a is 0 or 1,
> b is 0 or 1
> find a function of a and b such that a=f(b) OR b=f(a)
>
> In other words, a winning strategy should also deal with the cases:
> a b
> 0 0
> 0 1
> 1 0
> 1 1
>
> It seems to me that this has no good answer, since a and b
> vary independently -- knowing a tells you nothing about b, and
> knowing b tells you nothing about a.
>
> I suppose we might also include a "person index" as a parameter
> for this function. But, that doesn't give you any further information.
>
> Unless we introduce some new element into the problem (for example:
> I see nothing in the rules which prohibits people from inspecting
> all the hats beforehand, whereupon they could all agree to pick the
> number on the smallest valued hat -- but this presumes that there
> are only 88 hats, and I don't see that guaranteed, either), I don't think
> a win can be guaranteed..
>
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware
protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm