Quantum Computing, Finance, Refinitiv.
function solving it: def random_walk(initial_value, steps, probabilities=[0.5, 0.5]): walk = [initial_value] random_walk_probabilities= np.random.random(steps - 1) random_walk= [-1] * (steps - 1) for ix, probability in enumerate(random_walk_probabilities): if probability > 0.5: random_walk[ix] = 1