https://editor.p5js.org/weberwong/full/-bFi-TUSD
There’s a thought experiment called the Infinite Monkey Theroem, which is basically the idea that given enough time a monkey randomly typing in a keyboard could recreate a Shakespeare work.
“The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, including the complete works of William Shakespeare. In fact, the monkey would almost surely type every possible finite text an infinite number of times. The theorem can be generalized to state that any sequence of events that has a non-zero probability of happening will almost certainly occur an infinite number of times, given an infinite amount of time or a universe that is infinite in size.”
I wanted to simulate how long this would take, but given shakespeare would be too long I decided to just do it on the paragraph above.
I basically just used a random function on relevant characters for each character, then let it move onto the next character if it got it correctly and recorded how many it took