This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The names of 100 prisoners are placed in 100 wooden boxes, one name to a box, and the boxes are | |
lined up on a table in a room. One by one, the prisoners are led into the room; each may look | |
in at most 50 boxes, but must leave the room exactly as he found it and is permitted no further | |
communication with the others. | |
The prisoners have a chance to plot their strategy in advance, and they are going to need it, | |
because unless every single prisoner finds his own name all will subsequently be executed. | |
Find a strategy for them which which has probability of success exceeding 30%. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Bjorn Edstrom 2014 <be@bjrn.se> | |
# weather break... | |
import sys | |
""" | |
peg game. board representation: |