[Tutor] How to solve it ...

Gregor Lingl glingl@aon.at
Tue Feb 18 16:56:00 2003


Tim Peters schrieb:

>[Bob Gailer, to Gregor Lingl]
>  
>
>>Your original request was "Find the shortest complete code which
>>opens the door with certainty, regardless of the original position of
>>the four switches."
>>    
>>
>
>That appeared to be part of the translated problem statement.  Gregor's
>question was
>
>    How would you solve this with Python (- just for your amusement)?
>
>  
>
>>I submitted such a solution, but have had no comment back. Was I on the
>>right track? What did you think of my solution?
>>    
>>
>
>You got the same result as the Python program I posted, so I can testify
>that, right or wrong, they're on the same track <wink>.  Up to D1=P1
>equivalence (which you noted), there were no other codes of length <= 7 that
>solved the problem.  The interest isn't really in solving the problem,
>though, it's in *how* the problem gets solved.
>  
>
That's it!
BTW, I also had found a solution on paper, before I started to program it.
Maybe, I wasn't really sure, if I definitely had found the *shortest* 
solution.;-)
So I would also be interested in Bob's paper-solution.

You may find interesting remarks on this in the edu-sig - list, where I 
also posted the
problem (with a different question) :

http://mail.python.org/pipermail/edu-sig/2003-February/002720.html

My interest in the problem comes from thinking about how to treat it with my
students, 10th or 11th graders. Should I treat it as a mathematical or as
a programming problem? Hence I did this lock-simulation, which
may serve as a simple programming task as well as a tool for investigating
the structure of the problem. However,  up to now the thing already 
showed a lot
of interesting facets.

Thanks to all
Gregor




>  
>