← ProjectsAn experiment in chance

Rainy Day in Monte Carlo.

Draw a shape. Let it rain. Watch an answer emerge.

Raining
1 × 1 unit squareCircle · 0.200 units high
Why this works Chance, with enough patience.

The rain measures the shape.

Every point in the square has the same chance of catching a drop. A shape covering a quarter of the floor will catch about a quarter of the rain. Count enough drops, and their ratio becomes an estimate of the area.

Area ≈ drops inside / total drops landed

The floor is one square unit. Our circle has radius 0.5, so its reference area is π / 4, about 0.7854. The estimate wanders as drops arrive. More samples usually bring it closer; any particular drop can move it further away.

Volume and depth tell different stories.

Each drop brings 0.00002 cubic units of water. Depth is collected volume divided by the compartment’s floor area. A smaller compartment catches less rain, but has less space to fill. Both depths tend to rise at the same rate.

The water calculation uses geometric area; the estimate above uses only drop counts. The first compartment to reach the rim stops the rain. Only the portion of the final drop that fits is retained. Raise the walls and resume to keep collecting.

This is a sampling experiment with animated water, not a fluid simulation. Drawing is limited to one simple outline; extremely thin shapes are rejected. Curved walls are rendered as fine polygons, while the circle’s measurement uses its exact radius. More on Monte Carlo sampling ↗