Guest User

Untitled

a guest
Mar 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. lets say your robot is at 0(zero) position of X axis you robot either take only one step at a time.
  2. either left or right
  3. what will be probability that robot is at 0 position after 1000 steps.
  4.  
  5. brute force
  6. loop 0 to 1000
  7. math.random move left, move right
  8.  
  9. 50% chance move left, 50% move right
  10.  
  11. simulation
  12. method
  13. loop 0 to 1000
  14.  
  15. run method 1000, 1000000x then calculate stats
  16.  
  17. what is probability that robot is at 0 position after 4 steps
  18. after 1 step 0%
  19. robot at -1, 1 total possibilties=2
  20. after 2 steps
  21. robot at -2,0,0,2 total possibilties=4
  22. 50%
  23. after 3 steps
  24. robot at -3,-1,-1, 1, -1, 1, 1, 3 -> 0 probability total possibilties=8
  25. i
  26. after 4 steps
  27. robot at -4,-2, -2,0, -2,0,0,2, -2,0, 0,2, 0,2,0, 2,4 total possibilties=16
  28. 1 2 3 4 5 5 7
  29.  
  30.  
  31. Hint:
  32.  
  33. 1 0 4 0 6 0 4 0 1 step 4
  34. 0 1 0 3 0 3 0 1 0 step 3
  35. 0 0 1 0 2 0 1 0 0 step 2
  36. 0 0 0 1 0 1 0 0 0 step 1 ->
  37. 0 0 0 0 1 0 0 0 0 step 0 ->
  38. -4 -3 -2 -1 0 1 2 3 4
  39. 0 1 2 (2 steps) 3 4 (4 steps)
  40. 100 0 50 0 50?
  41. combinatorics, stats, math
  42.  
  43. combinatorics - google - math cool question - assume that
  44. - how to use computer science/
Add Comment
Please, Sign In to add comment