Teaching Statistics in the Age of ChatGPT

One of my favorite websites to use while teaching statistics is Seeing Theory, by Brown University. It is a wonderful website, because it allows people to “see” statistics.

Visualize concepts in statistics, to use the technically correct term, but you see what I mean.

One of the many reasons I like this website is because it presents a fun, interactive way to “get” what statistics is all about. It is one thing to talk about flipping a coin, it is quite another to actually flip a coin 1000 times. Or roll a dice, or understand what a probability distribution is, or to (finally!) “get” what the Central Limit Theorem is trying to get at (beware, though – every time you think you’ve “got” the CLT it has a way of revealing an additional layer of intrigue).

This past summer, as I’ve mentioned before, I was teaching school-going students courses in economics, statistics and public policy. I have made use of Seeing Theory in the past, but with the advent of ChatGPT (and especially ChatGPT4), I figured it might be a good time to not just show “cool” visualizations, but also actually try and build them.

And so we did! As we covered a topic, I would ask my students to “build” a working demo using ChatGPT (or Bard). I would nudge and prompt the students to well, write better prompts, and if necessary, step in and write the prompts myself on occasion. But for the most part, the work was done by the students, and we were able to get simple working demos of some stats concepts out of the door.

The “whoa, this is so cool!” moments were worth it in and of themselves, but it is my ardent hope that the students understood the concepts a little bit better for having seen the visualizations.

A great example is the Monty Hall problem. Run a simple Google search for it, if you haven’t come across it before. In my experience, some students tend to not “get” the explanation the first time around. Until this summer, I would get around this problem by asking them “what if it was a million doors instead?”, or if all else failed, by actually “playing” the game using three cards from a deck of cards.

But this time, we built a demo of the problem! So also for Chebyshev’s inequality, the expected value upon rolling a pair of dice and a simple way to visualize what regression does. The demos won’t satisfy professors of statistics or professional coders, for you could add so much more – but for young students who were trying to internalize the key concepts in statistics, it was pure magic.

And the meta lesson, of course, was that they should try and do this for everything! Why stop at stats? Build working demos for concepts in math, in physics, in geography. And if you know even a little bit of coding, try and build even better demos – both I and my students were relatively unfamiliar with coding in general, so we stuck with simple HTML.

But with AI’s new coding capabilities, it is clear that teaching (and learning) can become much better than was the case thus far. If you wish to disagree with me about the word “better”, I look forward to the argument, and you may well end up having more than a couple of points. But the classes were certainly more interactive – and at least along that one dimension, they were certainly better.

I hope to do much more of this in the months and years to come, but for the moment, do try out some of these demos, and let me know how they could be made better.

Thank you!

Meet the MIT Banana Lounge

Yup, really. There’s a place in MIT where you can lounge around and eat bananas. A lot of bananas.

https://twitter.com/iaincheeseman/status/1513467068351451137

How many is a lot, you ask? 280,000 bananas in this academic year alone. This is a project run by the Undergraduate Association at MIT, and they also place pianos around campus for folks to give it a try, and for those of us who prefer a more sedate outlook towards life, they also have a hammocks team, who are doing exactly what you hope they would.

The bananas are for free, by the way. If you happen to be on the MIT campus, you can drop in and chomp away to your heart’s content, courtesy an MIT alum who’s also been known to, um, do other stuff besides.

Cool stuff, right?


The reason I bring this up is because I and a student at GIPE were chatting the other day about questions that her juniors were asking her. And the question was about how they didn’t have “enough R projects” to do. (R, for the uninitiated, is a software that econ nerds like to freak out over.)

I’m always a little befuddled when students say they don’t have projects to work on, or are looking for datasets to work on. The lazy answer to give to queries such as this is something along the lines of Kaggle, or Google’s Dataset Search. There’s hundreds of such data sources available online for free, and they’re one simple Google search away, so that’s one reason for my befuddlement.

But the primary source of my befuddlement is the fact that students in possession of a software looking for a dataset is very much a case of the cart being put in front of the horse! Software is a tool that helps you in the work you’re doing. But the approach that most students take is that they have the chops to use the software, and they don’t know what work to do.


You could always try and see if you can get an alumni to buy bananas, and forecast demand for bananas!

Trend! Seasonality! Forecasting! For bananas consumed on campus.


I ask you: which is a cooler story to tell? A story in which you say that you downloaded a dataset from the internet and did some modeling with it…

OR

A story in which you say that you and a bunch of your friends got together and convinced your college to give a room to stock bananas, convinced an alumni member to sponsor these bananas, figured out the logistics to procure, transport and store these bananas, and used a tool called R (or Python, or SAS or SPSS or whatever) to forecast demand?

The second option teaches you project management, the art of pitching a proposal, teamwork, logistics and coding. And so much more besides! It builds a story that works for the team, the institute, the community, and you use a statistical software the way it was meant to be used: as a tool that makes your life easier.

I know which story gets my vote.


You could build shared calendars, YouTube playlists using Google Sheets, demos for sampling using Google Sheets, or anything else that takes your fancy. Use Statsguru to analyze cricket stats using Python, automate the creation of book recommendation websites, or well, give bananas away for free.

But datasets for projects?

You’re limited by your imagination alone.

About Teaching Python to Students of Economics

This is a bit of a rushed post, my apologies. I hope to come back to this post and do a better job, but for the moment a placeholder post and a request:

Read the whole thread (including the responses). We (and by we I mean not just all of us at the Gokhale Institute, but higher education in economics in India) should be building out more courses of this nature.

If anybody is already doing this, please do get in touch. I would love to learn more about how to try and start something like this for my university.

Tech: Links for 12th November, 2019

I have used some of these resources partially, and none of these completely. More as a bookmark to come back to for me (and maybe for you), these are five free resources to help you learn how to code.

  1. Grasshopper by Google.
    ..
    ..
  2. The Odin Project, fully open source.
    ..
    ..
  3. Lectures from Harvard University on Computer Science.
    ..
    ..
  4. edX courses on coding.
    ..
    ..
  5. … and finally, Khan Academy on coding.

Tech: Links for 3rd September, 2019

  1. “But analog storage takes up a lot of room. So sending the bulk of human knowledge to space will require a lot of compression. To do this, Spivack tapped Bruce Ha, a scientist who developed a technique for engraving high-resolution, nano-scale images into nickel. Ha uses lasers to etch an image into glass and then deposits nickel, atom by atom, in a layer on top. The images in the resulting nickel film look holographic and can be viewed using a microscope capable of 1000x magnification—a technology that has been available for hundreds of years.”
    ..
    ..
    Tardigrades on the moon.
    ..
    ..
  2. For folks who ask how to go about learning R. Start here.
    ..
    ..
  3. As I have mentioned earlier, I have the app, Peak. I don’t know how much of an impact it has on my mental performance, but I enjoy the routine(s) and am slowly getting better at all the games. They celebrate their fifth anniversary today.
    ..
    ..
  4. “When he saw the gilded letters of the Trump hotel, he gave a gleeful chuckle. “Out of all the American Presidents, he is the only one whose speeches I can understand directly, without translation,” he remarked. “There are no big words or complicated grammar. Everything he says is reduced to the simplest possible formulation.””
    ..
    ..
    If I could have, I would have excerpted the entire article. An interview with Cixin Liu.
    ..
    ..
  5. Teachable.com – of course I would be interested, wouldn’t I?