Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. 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?
  2. 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.
  3.  
  4.  
  5.  
  6.  
  7. 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.
  8. We can compute this probability and work backwaards from there.
  9.  
  10. two directions and three ants.
  11.  
  12. p(clockwise) = (1/2)^3
  13. p(counter clockwise) = (1/2)^3
  14. p(same direction) = (1/2)^3 + (1/2)^3 = (1/4)
  15.  
  16. the probability of collision is therefore the probability of the ants NOT moving in the same direction:
  17.  
  18. p(collision) = 1 - p(same direction) = 1 - 1/4 = 3/4
  19.  
  20.  
  21.  
  22.  
  23.  
  24. // they do not collide only if:
  25. // clockwise, clockwise, clockwise or
  26. // anticlockwise, anticlockwise, anticlockwise
  27.  
  28. // since the probability of not colliding is 2 / (2 * 2 * 2)
  29. // then the probability of colliding is 1 - 2 / (2 ^ 3)
  30.  
  31. // the generalized solution for non-collision is 1 - 2 / (2 ^ n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement