From 7c7a1baa674eef288dd1bf74a8e1ac078b877741 Mon Sep 17 00:00:00 2001 From: David Preiss <davepreiss@gmail.com> Date: Thu, 2 Mar 2023 22:46:20 +0000 Subject: [PATCH] Update week3/random_walker.py, week3/README.MD --- week3/README.MD | 2 +- week3/random_walker.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/week3/README.MD b/week3/README.MD index 353d386..2751a4d 100644 --- a/week3/README.MD +++ b/week3/README.MD @@ -4,4 +4,4 @@ Code is [here](random_walker.py). - + diff --git a/week3/random_walker.py b/week3/random_walker.py index 24e797b..c2f38fd 100644 --- a/week3/random_walker.py +++ b/week3/random_walker.py @@ -22,7 +22,6 @@ def build_LFSR(seed, bits_needed=1000): walker_states = np.zeros((10, 1000)) # create our seeds by grabbing a 16 bit number from the LSB of the current time in us -# cheating and just adding a fixed delay to get different seeds seeds = [] for i in range(10): delay = .1 @@ -41,7 +40,7 @@ timestep = np.array(range(1000)) import matplotlib.pyplot as plt plt.plot(walker_states.T) # transpose it so we can plot it -# for the 3 sigma lines, we will plot the sqrt of the timestep and divide the result by 1.5 to plot above and below the mean (0) +# for the 3 sigma lines, we will multiply the sqrt of the timestep and divide the result by 1.5 to plot above and below the mean (0) plt.plot(timestep, 1.5 * np.sqrt(timestep), color='black', alpha = 0.25) plt.plot(timestep, -1.5 * np.sqrt(timestep), color='black', alpha = 0.25) plt.show() -- GitLab