Random walks: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 21: Line 21:
<input type="button" value="run" onClick="run()">
<input type="button" value="run" onClick="run()">
<input type="button" value="clear" onClick="clearturtle()">
<input type="button" value="clear" onClick="clearturtle()">
<input type="text" value="" id="output">
<br />
Average square length of the walks:<input type="text" value="" id="output">
</form>
</form>
</html>
</html>
Line 44: Line 45:
     t.home();
     t.home();
   }
   }
   $('output').value = sumdist.toFixed(3);
   $('output').value = (sumdist/nr).toFixed(3);
   brd.unsuspendUpdate();
   brd.unsuspendUpdate();
}
}

Revision as of 18:27, 26 May 2009

Number of random walks:

Average square length of the walks:

Source code

<jsxgraph width="600" height="600">
</jsxgraph>

External links

  • []