My understanding of the problem

本帖於 2009-09-12 14:59:37 時間, 由普通用戶 康MM 編輯

1. The bum drinks during day and moves during night. The police searches during the day. If the cellar searched by the police happened to be the one where the bum is drinking, the bum is caught.

2. The bum has to move every night. The police can search any cellar he wants.

3. The bum leaves one extra empty bottle at the cellar each day. The police can count the number of empty bottles when searching a cellar.

Under such assumptions, it is not hard to come up with a solution that works (if time is not an issue, which is the case for most bums and polices).

One important parameter is the parity of the bum, i.e., if we color the cellars into red and black, is the bum at a red cellar or black cellar at day 1? If we know this, we can simply do a search from left to right. If we don't know the parity, we can assume one and sweep one pass, if our guess was correct then we have found the bum. If during the pass we didn't catch the bum, then we know the parity now and a second pass will do.

The above solution did not count bottles at all, and therefore lost some information. The problem is actually quite interesting and I tend to let more people try it before giving my analysis.

請您先登陸,再發跟帖!