Sandbox

This is the place for small apps that, for one reason or another, I don't think need their own website space. All information should be encapsulated in the accordion that the app lives in, please reach out if you have an interesting idea for this page!

/
Logistic Map (Bifurcation theory) ↓
Description ↓

The logistic map is a simple example of how chaos can form from very simple non-linear equations. While it is famous in physics for providing a qualitative map of the transition from order to chaos, its origins are rooted in biology. In the mid-1970s, biologist Robert May popularized this equation as a discrete-time model for animal populations. The variable x represents the population at a given time, scaled between 0 (extinction) and 1 (maximum carrying capacity). The equation x_n+1 = r * x_n * (1 - x_n) works through a simple feedback loop:

  • Growth (r * x_n): This represents the birth rate. When the population is small, it grows proportionally to how many individuals are already there.
  • Starvation (1 - x_n): This represents the "limiting factor," such as food scarcity or disease. As the population x approaches 1 (the environment's limit), this term approaches zero, slowing down or crashing the population.

May’s breakthrough was showing that a single, deterministic biological rule could lead to stable equilibriums, predictable cycles, or total, unpredictable chaos just by changing the growth rate.

Its relation to fluids is that it is a simple handy comparison with laminar and turbulent flows. The growth rate parameter r acts as a mathematical proxy for the Reynolds number. Just as increasing the Reynolds number pushes a fluid from a steady, predictable state toward total chaos, increasing r drives the map through distinct phases:

  • Steady State (r < 3): This represents laminar flow. No matter where the population starts, the system eventually settles into a single, stable value.
  • Periodic Oscillation (3 < r < 3.57): As r increases, the system undergoes "period-doubling." The value begins to bounce between two points, then four, then eight. In fluid terms, this is analogous to the onset of instabilities, like the rhythmic shedding of vortices in a von Karman vortex street.
  • Deterministic Chaos (r > 3.57): The system enters a regime of turbulence. The values appear random and never repeat, yet they are governed by a strictly deterministic equation, like the Navier-Stokes equations.

In the turbulent phase, two starting values, which we can consider some arbitrary initial fluid conditions that differ by even a microscopic amount, will eventually diverge into completely different paths. This sensitivity is exactly why predicting high-Reynolds number turbulent flows is so difficult. Small errors in the initial state can lead to vastly different results over time.

References ↓
Plinko (Central Limit Theorem) ↓
Description ↓

This simulation models a Plinko board, which nicely demonstrates the Central Limit Theorem. At every peg, a falling ball effectively flips a coin to decide whether to bounce left or right.

The bell curve emerges because of path combinatorics. There are far more ways for a ball to reach the center bins than the edges, ending up on the far side requires a rare "perfect streak" of turns in a single direction. In contrast, landing in the center can happen through many different left-right combinations.

This random process naturally results in a Gaussian distribution. You can use the Skew slider to rig the coin flip, shifting the probability to see how bias affects the final expected outcome of the distribution.

References ↓
Black-Scholes-Merton Model ↓
Expected Profit/Loss
$0.00
Current Stock Price:
Option Type
Strike Price:
Time to Expiration (Days):
Volatility (%):
Option Cost ($):
Description ↓

The Black-Scholes-Merton model is a Nobel Prize winning mathematical contribution used to determine the fair price of a financial option. At its core, the BSM model is a partial differential equation, specifically a diffusion equation. It models how the probability of an option's value diffuses through the market as it approaches expiration, linking it to the concept of geometric Brownian motion.

The model assumes that stock prices take a continuous "random walk" over time. By mapping this random spread, it calculates the probability that an option will cross its target threshold before the clock runs out. Some important concepts involved are:

  • Current Price versus Strike Price: Where the asset is currently valued versus the target threshold it needs to hit.
  • Time to Expiration: How much time is left before the contract expires.
  • Volatility: This acts exactly like thermal conductivity in a heat transfer problem. Higher volatility means the probability "heat" spreads out much faster and wider, which increases the theoretical value of the option. This can be thought of as how erratically a stock has behaved in the past.

By comparing the theoretical value generated by this diffusion model against the actual cost to buy the option, you can estimate your expected profit or loss. This is all a massive simplification of a topic that is still challenging to me, and it doesn't even touch on the "Greeks" or the advanced statistical option analyses out there. Please look at the references for a more comprehensive discussion, as this was just an exercise for me to further explore financial engineering.

References ↓