I am new to python and one of the problems I am working on is to plot 500 pairs of successive random numbers. I have a formula that generates the numbers seen below:
x-axis
>>> a=128
>>> c=0
>>> m=509
>>> n=500
>>> seed = 10
>>> for i in range (1,n):
new_seed=(a*seed+c)%m
seed = new_seed
print new_seed
y-axis
>>> a=269
>>> c=0
>>> m=2048
>>> n=500
>>> seed = 10
>>> for i in range (1,n):
new_seed=(a*seed+c)%m
seed = new_seed
print new_seed
What I am wondering now is how I can turn these results into an array or list. I have attempted to put plt.plot(new_seed) in the loop statement but that did not work when I tried to plot. Any ideas?
I used import matplotlib.pyplot as plt
Thanks in advance for the help!!