Start from zero and do a random walk.

In [1]:
import matplotlib.pyplot as plt

x = [0]
y = [0]
c = [0]

import random

for ii in range(0, 500):
  x.append(x[-1] + random.uniform(-2, 2))
  y.append(y[-1] + random.uniform(-2, 2))
  c.append(x[-1] + y[-1])

plt.plot(x, color='r')
plt.plot(y, color='g')
plt.plot(c, color='b')
plt.show()

Just a cool visualization of a bunch of random walks starting from zero.

In [2]:
a = []
N = 100
for i in range(0, N):
    a.append([0])
import random

for ii in range(0, 500):
    for j in range(0, N):
        a[j].append(a[j][-1] + random.uniform(-2, 2))

for j in range(0, N):
    plt.plot(a[j], color='g')
plt.show()
In [ ]: