[PyAR2] Programming Challenge III

Greg Lindstrom gslindstrom at gmail.com
Mon Nov 17 16:58:44 CET 2008


Here's one I have not done before.

At work, we have door locks with 5 buttons, 1, 2, 3, 4 and 5.  To open the
door you must press the buttons in the correct order.  I would like to see a
program that will generate a random sequence for combinations (I believe my
mathematical friends would say permutations because order matters)
satisfying the following conditions:

All of the buttons must be pressed to open the door.
1 or 2 of the buttons may be pressed simultaneously (example: 1 and 3
together, then 2, then 4 and 5 together).

Extra credit: How many permutations are there using the above criteria?

Good Luck,
--greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/mailman/private/pyar2/attachments/20081117/b62b20b7/attachment.htm>


More information about the PyAR2 mailing list