# How Many Dice Rolls Until You Get a Repeat. A Probability Experiment in p5.js

How many times, on average, do you have to roll a dice until you get a repeated value? I saw this probability challenge on the Mind Your Decisions channel. I decided to test it experimentally. First, I repeated the experiment myself in two sets of 50. Then I created a diagram in the Wolfram Language to visualize the distribution. Finally, I made a p5.js sketch to roll the dice thousands of times.

Link to my Wolfram Notebook: https://www.wolframcloud.com/obj/620bf4df-077f-4ce8-8210-c06037f58f9b

The math behind this project come from this Mind Your Decisions challenge video and this Mind Your Decisions solution video.

# Evolving Creatures in p5.js

Simon’s latest independent coding project involved some biology lessons! He loves the channel Primer by Justin Helps and watched his evolution series many times, studying the rules for species’ survival and multiplication. This resulted in two interactive evolution simulations, in both of which Simon recreated the rules he learned. The first simulation doesn’t involve natural selection and is based on these two videos: Simulating Competition and Logistic Growth and Mutations and the First Replicators.

Full Screen interactive version: https://editor.p5js.org/simontiger/present/MK4b75542

Simon added natural selection in Part 2, based on Primer’s video Simulating Natural Selection (the code Simon wrote from scratch):

Full Screen interactive version: https://editor.p5js.org/simontiger/present/68WXliTza

# Tic-Tac-Tic-Tac-Toe-Toe in p5.js

Simon has programmed this game of Tic-Tac-Tic-Tac-Toe-Toe Game in p5.js from scratch. He and his sister have had hours of fun playing it (and she turned out to be better at this strategic game):

Play Simon’s game online at: https://editor.p5js.org/simontiger/present/k9NfaDmpi

# How Simon takes part in the Coding train live sessions

Every live session Daniel Shiffman mentions Simon several times, usually because Simon gives good feedback/ advice. On the other end, Simon is invigorated and jumping about the room. Sometimes resulting in serious bumps against the furniture.

# Galton Board in p5.js

Simon saw a prototype of this Galton Board in a video about maths toys (it works similarly to a sand timer in a see-through container). He created his digital simulation using p5.js online editor, free for everyone to enjoy:

https://editor.p5js.org/simontiger/sketches/h7p-wZCw8

# Simon’s Math Games in p5.js

Simon loves the Maths Is Fun website and has borrowed a couple of ideas for cool games from there. He wrote the code completely on his own, from scratch. Below is a video where he presents his Connect games:

I’ve gone Connect Crazy!
This project is inspired by MathsIsFun, which has a lot of variations on the classic game Connect Four, the code is entirely mine.
Classic Game of Connect Four: https://editor.p5js.org/simontiger/full/TISsTqZ8D
And then I’ve made Connect Three: https://editor.p5js.org/simontiger/full/c30Oqd4Qf
And Connect Five: https://editor.p5js.org/simontiger/full/I6Digth0A
Then I’ve also made a version called Drop, where if the bottom row fills up, the whole board drops down one row:
https://editor.p5js.org/simontiger/full/Ysu2yvh1x
https://editor.p5js.org/simontiger/full/gb3gVSd5K

Another game Simon built was Bulls and Cows (trying to guess a sequence of letters): https://editor.p5js.org/simontiger/full/3bC9j3501 Link to Simon’s code: https://editor.p5js.org/simontiger/sketches/3bC9j3501

Yet another one was a Reaction Time test! You can test your reaction time by clicking anywhere on the screen as soon as the circle changes color: https://editor.p5js.org/simontiger/full/Gzv094mgzM Link to Simon’s code: https://editor.p5js.org/simontiger/sketches/Gzv094mgzM

And last but not least, an unfinished project of building a Checkers game:

# Simon’s Random Number Generator

This one’s back from mid-October, forgot to post here.

Simon created a random number generator that generates a frequency, and then picks it back up. Then, it calculates the error between the generated frequency and the picked up frequency. This is one of my community contributions for a Coding Train challenge: https://thecodingtrain.com/CodingChallenges/151-ukulele-tuner.html

Link to the random number plots: https://www.wolframcloud.com/env/monajune0/ukalele%20tuner%20generated%20random%20number%20analysis.nb
Link to Daniel Shiffman’s live stream featured at the beginning of this vid: https://youtu.be/jKHgVdyC55M

# Make 24 with Teachable Machine in p5, ml5.

Simon has worked really hard for several days on his first machine learning community contribution! He has created this mini-series about building a game of Make 24 with Google’s Teachable Machine that he trained to recognise gestures as a game controller.

“It’s the first time I’m using ml5 from scratch! I’ve also built in a feature to enable the users to train their own models!”

Link to my ml5 project: https://editor.p5js.org/simontiger/full/McNY2_ay_
Code: https://editor.p5js.org/simontiger/sketches/McNY2_ay_

Link to my game of Make 24 without ml5/Teachable Machine: https://editor.p5js.org/simontiger/full/qH_ZSvup5
Code: https://editor.p5js.org/simontiger/sketches/qH_ZSvup5