0

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()


enter image description here

enter image description here

enter image description here


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

  1. We can see that there seems to be a bifurcation occurring, what is the value of delta where this bifurcation occurs?
  2. What are the analytical expressions for the curves that the trends are following in both cases?
em1971
  • 306
  • 1
    A question worth asking yourself: if you lose $10%$ one day, do you have to gain exactly $10%$, more than $10%$, or less than $10%$ the next day to be back where you were? – Dave Mar 12 '24 at 11:43
  • This is really the same as your previous question. Researching the lognormal distribution here on CV will disclose many answers, some of which you might find helpful. – whuber Mar 13 '24 at 12:02

0 Answers0