# Challenges 3

## Statistical design challenges

1. Shipibo random walk
1. Drawing a path is done with the “pen” block. To explore where the path can go, the algorithm can “look ahead”. We do that by memorizing the current x and y position, then lifting the “pen”, and then moving forward. If it senses the color it is looking for, it knows to go no further. If not, it goes back to the old x and y position, lowers the pen, and moves to the new position.

Launch the Software!

2. Change the script by letting the hand “bounce” from the black line (changing direction).
3. Now you are ready to simulate the Shipibo design:

Launch the Software!

Notice that the hand gets “stuck.” Help the hand! For example you can track the number of times it gets stuck and use a random place to restart.

2. Shipibo fractal curve
1. Not all complexity is due to random action. Fractals are one way to create deterministic complexity. Fractal curves can be created by recursive line replacement, in which each line that composes a figure is replaced by a smaller version of the whole. Try experimenting with the example here:

Launch the Shipibo fractal Software!

3. Kuna percolation
1. Percolation describes the flow of water in soil, fire in a forest, etc. It is a “parallel search” because the water attempts to find many different paths at the same time. One way to simulate that is a “back track” that recalls an earlier point and begins branching from there.

Launch the Software!

4. Endara Crow simulation
1. The famous thief of magical realism has removed the lovely spheres from Endara Crow’s painting. Help us get them back!

Launch the Software!

5. Histograms
1. Let's use our beads to make a histogram so we can compare uniform and gaussian distribution.

Uniform distribution: Launch the Software!

Gaussian distribution: Launch the Software!

2. A “heat map” uses color to indicate quantity. Can you get the histogram to use colored beads like a heat map?