TL;DR: A stand-alone HTML file contains an interactive app that implements Richard McElreath’s demonstration of Bayesian updating using “globe tossing”. A 12 MB video walkthrough is available here.
In one of his inspired lectures, Richard McElreath illustrates Bayesian updating by means of “globe tossing”. Suppose you wish to know what proportion of the earth’s surface is covered in water, and you only have access to a globe and a blindfold. One way to learn the proportion is to pick random locations on the globe, and every time assess whether or not that location is covered in water. As the samples accumulate, your knowledge about the proportion of interest will be increasingly precise. Of course we need to start with a prior distribution; for a proportion, the most convenient choice is a beta distribution. Each sample results in an update to the distribution, and the posterior distribution after n samples becomes the prior distribution for sample n +1.
McElreath’s demonstration can be easily turned into an interactive app. Only a few prompts were needed for ChatGPT Pro to produce this stand-alone HTML file that contains the app. And it is awesome. Behold a screenshot of the sampling process:
I am not going to go over all of the options (again, a video walk-through is here), but it it clear that samples can be drawn one at a time or in groups; questions can be asked about the entire planet (i.e., the proportion covered in water) or about continents (e.g., as in the screenshot, a size comparison between Europe and Africa); the globe can be rotated, and you can zoom in or out; also, each individual sample is associated with a picture of the actual location, accessible through Google Earth. For instance, the last sample from the screenshot above turns out to be from a field somewhere in Romania:
Of course, the app also presents the associated statistical inference on the proportion of interest. For the size comparison between Africa and Europe, we obain the following output:
The app also contains explanations and in-class exercises. Maybe it can be improved further — if you have any ideas, you can simply download the HTML file and feed it to your own LLM together with your suggestions for improvement. This way, apps such as these can be tailored to your own taste. I end by stressing, as I have done before, that when it comes to visualizing mathematics and statistics, AI offers existing new opportunities that can great benefit our students. You can check out the ChatGPT app here!
Eric-Jan Wagenmakers
Eric-Jan (EJ) Wagenmakers is professor at the Psychological Methods Group at the University of Amsterdam.






