Problems
You are investigating a cave. The cave has
When in a room, you can identify what room you are in and see how many passages it connects to,
but you cannot distinguish the passages. You want to estimate the number of passages that exist in the cave.
You are allowed to do up to
- be magically teleported to a room of your choice, or
- walk through a random passage connected to the room you are in, taking you to the room at the other end of that passage.
When you decide to walk through a passage, you are unable to choose which one, because they are all alike. A passage is chosen for you uniformly at random.
You begin the investigation in an arbitrary room. Estimate the number of passages between rooms
in the cave with at most
If
To pass a test set, your solution must be correct for at least 90% of the test cases in that set.