lundi 26 octobre 2020

How to provide students with a mystery function in Python

I'm teaching a discrete math course in which I've incorporated a programming component. We have been using Python Notebooks through Jupyter.

We're coming up on a section in probability theory, and I would like to provide them with a "mystery random variable:" I want students to be able to sample the random variable without knowing how it is defined.

I don't know the best way to implement this, and was hoping someone could provide a suggestion. Here are the features that I want:

  • I define one or several random variables (preferably in Python),
  • The students should be able to sample from the random variable in a Python notebook (so they can do experimentation with it), but
  • the students should not be able to see the code that defines the random variable.



Aucun commentaire:

Enregistrer un commentaire