j000 / frog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Frog Problem

https://www.youtube.com/watch?v=ZLTyX4zL2Fc

  1. When the frog jumps it randomly chooses from the possible landing places.

  2. The frog keeps jumping until it crosses the river.

  3. What is the expected number of jumps for different river widths?


This simulations does exactly that. Jumps to random position until it reaches other river bank. Then calculate average numer of jumps. Data is printed every 1000th iteration.

About


Languages

Language:Perl 100.0%