Random price movement
Consider the following:
The price of an apple starts at 1 dollar. On each day, the price will change -10% or +10%, with equal probability. You buy this apple on day 1, and sell on day N. What is your probability of losing money at the end?
Suppose N = 2, then we have 4 possible outcomes with equal probability:
- 0.9 * 0.9 = 0.81
- 0.9 * 1.1 = 0.99
- 1.1 * 0.9 = 0.99
- 1.1 * 1.1 = 1.21
Thus the probability of losing money is 3/4.
Let's run an experiment with different delta values (like 10%) and steps (days).
import matplotlib.pyplot as plt
def main():
for delta in [0.01, 0.1, 0.2, 0.4, 0.5, 0.8]:
steps = list(range(1, 20))
p_lose = [find_p_lose(n, delta) for n in steps]
plt.figure(figsize=(5, 3))
plt.title(f"delta = {delta}")
plt.xlabel("number of steps (days)")
plt.ylabel("probability of losing")
plt.xticks(steps)
plt.tight_layout()
plt.plot(steps, p_lose)
plt.show()
def find_p_lose(steps, delta):
outcomes = find_outcomes(steps, delta)
p_lose = len([x for x in outcomes if x < 1]) / len(outcomes)
return p_lose
def find_outcomes(steps, delta):
if steps == 1:
return [1 - delta, 1 + delta]
outcomes = []
for a in [1 - delta, 1 + delta]:
for b in find_outcomes(steps - 1, delta):
outcomes.append(a * b)
return outcomes
print("First let's verify what we have at the beginning (2 steps, delta = 0.1)")
print("Outcomes", find_outcomes(2, 0.1))
print("p(lose)", find_p_lose(2, 0.1))
main()
Observations
Case 1: delta in [0.01, 0.1]
p(lose) oscillates
- It is always 0.5 for odd number of steps.
- You are always more likely to lose money for even number of steps, with the probability decreasing as number of steps increases, and it follows a nice curve.
Case 2: delta in [0.2, 0.4, 0.5, 0.8]
p(lose) increases while oscillating
Questions
- We can see that there seems to be a bifurcation occurring, what is the value of delta where this bifurcation occurs?
- What are the analytical expressions for the curves that the trends are following in both cases?


