There are $8$ doors from left to right, and initially, there is a monkey behind each door. Each time a boy can choose to open a door and mark the monkey(s) he saw. After marking the monkey(s), he closes the door and each monkey will have $1/2$ probability to move to the left adjacent door and $1/2$ probability to move to the right adjacent door (if the monkey is at door $1$, then it move to door $2$ with probability $1$ because there is no door on the left; same for the monkey at door $8$). What is the smallest number of times of opening the doors that guarantees the boy to mark all $8$ monkeys? What is the corresponding strategy?
Someone proposes that this is similar to the situation that there is only one monkey behind one of $8$ doors and we want to use least number of steps to find it out. For reference, see Find a bug under 6 tiles. However, I cannot see the relation between them, can anyone give a hint on it?