a problem to solve

mensanator at aol.com mensanator at aol.com
Fri Mar 24 19:05:50 EST 2006


Michael Tobis wrote:
> Yeah,  I misread the question, but the gist of my query remains.
>
> > The odds are 100% if there is at least one solution.
>
> Let's not get too philosophical. My question was whether there was an a
> priori reason for believing that there is a solution.
>
> > You want permutations with replacement, so there are 8**4 = 4096
>
> Agreed. My mistake.
>
> >> These will turn on 15 lights in each set of 20, of which the number of
> >> possibilities is C(15,20)**4 = 57779667567968256L
>
> > No, there are only 8 possible patterns on each panel.
> > Not every possible 15 lamp pattern is realized
>
> Right, but that is exactly my point. This is the number of possible
> selections of 15 out of 20 made four times. Any attempt will be a
> member of that space. Then the probability of hitting a solution at
> random is the ratio of solutions to that space.
>
> So I think my chance of success on a sinlge selection, assuming random
> design of the switch banks, is correct: 1.9e-05 My error gave me the
> wrong multiplier. It's 4096 rather than 1820. So now I'm goinq with a
> 7.79% chance of randomly setting up the problem to yield a solution.

Ok, random settings didn't make any sense since the problem
was already set up.

>
> Still seems somwhat unlikely that there would be a solution unless the
> problem were set up in advance.

It would be easy to set up an answer. Then work backwards
to create 7 bad settings for each switch, although I'm not sure
how you would ensure not accidently creating another solution.

Would be simple enough to verify, though. With only 4096
permutations, it only takes seconds to find the solution(s).

> (homework? a puzzle book?), I am just
> wondering where the puzzle came from.

The OP mentioned it came from a puzzle game That made me
think there was likely at least one solution.

>
> Was there more than one solution?

No, there is exactly one solution where Y has 20 1's.

Second best has only 16 1's, of which there are 8 solutions.
For example:
16  11011011111111110011 3 4 5 5
where the numbers are popcount, Y (in binary) and the four
switch settings.


> 
> mt




More information about the Python-list mailing list