[PS] Catch the Fox
Consider five holes in a line. One of them is occupied by a fox. Each night, the fox moves to a neighboring hole, either to the left or to the right. Each morning, you get to inspect a hole of your choice. What strategy would ensure that the fox is eventually caught?
Subscribe to:
Post Comments (Atom)
1 comment:
We need to corner the fox. This can be solved in 7 steps as below.
Format :
Cx (y) - z1, z2, z3...
where
Cx - is check number 'x'
y - is the hole checked
z1, pz2.. - are holes in which the fox can be if he's NOT caught (in hole 'y' for the check Cx)
Steps :
#first check on hole 2. If fox is not caught, he only can be in holes 1, 3, 4, or 5
# Try corner fox to hole 1
C1 (2) - 1 3 4 5
# Fox cornered to hole '1' (or is to the right of hole '2')
C2 (2) - 3 4 5
# Corner the fox to the other end
C3 (3) - 2 4 5
# Corner the fox to hole '5'
C4 (4) - 1 3 5
# Fox either in hole 5, or not on this side. If not caught here, the only option the fox is left with is to move to hole '2'
C5 (4) - 2
# Catch the fox if he moves to hole '3'. If nto caught, the fox is in hole '1'
C6 (3) - 1
# Catch the fox!!
C7 (2) - N/A (there he is in hole 2)
Post a Comment