Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- There are three ants on different vertices of a triangle. What is the probability of collision (between any two or all of them) if they start walking on the sides of the triangle?
- Assume that each ant randomly picks a direction, with either direction being equally likely to be chosen, and that they walk at the same speed.
- Solution: The ants will collide if any of them are moving towards each other. The only way they wont collide is if they are all moving in the same direction.
- We can compute this probability and work backwaards from there.
- two directions and three ants.
- p(clockwise) = (1/2)^3
- p(counter clockwise) = (1/2)^3
- p(same direction) = (1/2)^3 + (1/2)^3 = (1/4)
- the probability of collision is therefore the probability of the ants NOT moving in the same direction:
- p(collision) = 1 - p(same direction) = 1 - 1/4 = 3/4
- // they do not collide only if:
- // clockwise, clockwise, clockwise or
- // anticlockwise, anticlockwise, anticlockwise
- // since the probability of not colliding is 2 / (2 * 2 * 2)
- // then the probability of colliding is 1 - 2 / (2 ^ 3)
- // the generalized solution for non-collision is 1 - 2 / (2 ^ n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement