# Patterns in Randomness

**URL:** <https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491>\
**Category:** Share your Projects\
**Tags:** mathematics, technical\
**Created:** [March 7, 2026, 11:18pm UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491 "2026-03-07T23:18:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [March 7, 2026, 11:18pm UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/1 "2026-03-07T23:18:53Z")

</div>

Today I saw a Reel talking about the [Central Limit Theorem](https://en.wikipedia.org/wiki/Central_limit_theorem).

> In [probability theory](https://en.wikipedia.org/wiki/Probability_theory), the **central limit theorem** ( **CLT** ) states that, under appropriate conditions, the [distribution](https://en.wikipedia.org/wiki/Probability_distribution) of a normalized version of the sample mean converges to a [standard normal distribution](https://en.wikipedia.org/wiki/Normal_distribution#Standard_normal_distribution).

My project is a simple visualizer of this theory. A line graph is drawn, and several points are placed at the center. For every tick, each point can either move left, right, or stay on the line graph. After several ticks, a curve is drawn. You’ll notice that every time you run the project, the curve looks almost the same. The data is very predictable. Even though the points move at random, you still get almost the same result every time.

Common applications of the Central Limit Theorem include surveys, risk management, quality control predictions, and much more.

> **[Snap! Build Your Own Blocks](https://snap.berkeley.edu/snap/snap.html#present:Username=joecooldoo&ProjectName=Central%20Limit%20Theorem)**

Yellow line is the calculated bell curve for the random data.  
Red line is for perfect bell curve (not random).

If you click the stage before running the project or after the simulation runs, you can change some of the parameters.

- `Axis range`: Length of the line graph.
  - Example: a value of 10 makes the line graph 21 spaces long, -10 to 10

- `Movements per trial`: How many times each point can move left, right, or stay.
  - Example: a value of 4 could make a point randomly move `left, left, right, stay`, or `right, left, right, left`, or `stay, stay, stay, left`, etc.

- `Sample size`: How many points are placed on the graph.
  - Example: a value of 40 would place 40 points on the graph.

- `Animation time`: How long it takes for the movement animations to complete. Doesn’t affect calculations, just how they’re presented.

---

<div class="post-metadata">

**Author:** ![bh](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/bh/32/31580_2.png) [@bh](https://forum.snap.berkeley.edu/u/bh)\
**Post date:** [March 8, 2026, 6:53am UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/2 "2026-03-08T06:53:09Z")

</div>

Nice!

---

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [May 6, 2026, 5:20am UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/3 "2026-05-06T05:20:20Z")

</div>

I came back to work on this a little bit

- Added a perfect curve to demonstrate how far off the random data is
- New `animation time` slider in settings to speed up or slow down the movement of the dots

TODO:

- Calculate % accuracy

---

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [May 15, 2026, 7:31am UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/4 "2026-05-15T07:31:34Z")

</div>

# update

- added some animations
- added error data
- you can now export images (with transparent background) of a graph by downloading the costume inside the `Export` sprite

 ![graph](https://cdn.forum.snap.berkeley.edu/original/3X/0/9/094d64b815b9f22bda15c42b66158fc3adf42683.png)

---

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [May 15, 2026, 7:43am UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/5 "2026-05-15T07:43:42Z")

</div>

bug: safari sucks and does weird things  
i don’t feel like fixing it right now

 ![image](https://cdn.forum.snap.berkeley.edu/original/3X/e/1/e15e6882f2f697d71f84d3648033d617a2146fbf.jpeg)

---

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [May 16, 2026, 5:53pm UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/6 "2026-05-16T17:53:48Z")

</div>

i (think) i fixed this  
the stage capture would take a lower resolution snapshot on safari for some reason so i made it resize based on how big the snapshot is

---

<div class="post-metadata">

**Author:** ![joecooldoo](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/joecooldoo/32/46163_2.png) [@joecooldoo](https://forum.snap.berkeley.edu/u/joecooldoo)\
**Post date:** [May 16, 2026, 6:05pm UTC](https://forum.snap.berkeley.edu/t/patterns-in-randomness/21491/7 "2026-05-16T18:05:38Z")

</div>

also fixed some other bugs with animations and pen
