Monday, January 11, 2021

Using Lists in Scratch - Singe Die Frequencies

    Scratch is a descendent of the Logo programming language that was developed by Dr. Seymour Papert at the the Artificial Lab at MIT. Logo had elements of the LISP programming language popular at the Lab at that time. LISP is an acronym for LIStProcessing and used data structures called lists. 
   To illustrate the use of lists I've written a PDF document that uses lists to store the frequency of the results of throwing a single die a number of times. Assuming the die is a fair die, the frequency of each of the numbered faces, 1, 2, 3, 4, 5 and 6 should be equal for say 6 throws, 36 throws, and 216 throws. Here is the Scratch script.

   Below is a screenshot of the display produced by the above script for six rolls of a single die. Note that the program does not produce the theoretical values of the frequency of 1 for each of the six possibilities. Bit neither does six rolls of a real die.
   If you are a teacher or a students and would like a free copy of the PDF file that details the building of the script just email your request to
   A more advanced project that uses lists to record the frequency of the sum of a pair of dice for a repeated number of throws will be the topic of a future post.

No comments:

Post a Comment