Simulating the stock market

The applet below allows for investigating the probability the stock market will go up on any given day via simulation. The plot in the top left corner shows the probability associated with each outcome. In this case, the market has a 50-50 chance of going up on any given day. When the Simulate button is clicked, outcomes over n days are simulated. The results of the simulations are shown in the plot below the top plot. If the Animate option is checked, the display will show each outcome dropping into the second plot. To stop an animation uncheck the Animate option. The individual outcomes are shown in the text field to the far right of the applet. The center plot shows the cumulative proportion of times that the market went up in red. The green line in the plot reflects the true probability of the market going up. As the experiment is conducted more and more times, the cumulative proportion should converge to the true value. Things to try with the applet:

  • Run the simulation 10 times (n = 10). How close is the cumulative proportion to the true value? Click the Reset button to the clear the results, and then run the simulation 10 times again. How does the cumulative proportion compare to your previous value? Repeat this process a few more times and continue to compare values of the cumulative proportion. What is the longest run of days that the stock market goes up or down? Does this seem unusual?
  • Run the simulation 1000 times (n = 1000). How close is the cumulative proportion to the true value? Click the Reset button to the clear the results, and then run the simulation 1000 times again. How does the cumulative proportion compare to your previous value? Repeat this process a few more times and continue to compare values of the cumulative proportion. What is the longest run of days that the stock market goes up or down? Does this seem unusual?