import random
numcrossed=[]
j=0
while j < 200:
i = 0
last=0
total=0
x=[]
y=[]
crossed=0
while i < 1000000:
ran= random.randint(0, 10)
if ran==last:
total=total
elif ran>last:
total=total+1
else:
total=total-1
if total==0:
x.append(i)
y.append(total)
crossed=crossed+1
i=i+1
last=ran
numcrossed.append(crossed)
j=j+1
If instead of random numbers the digits of pi are used. This is what the path of total counts looks like
file = open("pi1000000.txt", "r")
#3.14159265358979323846264338327950 pi2.txt
x = []
y = []
text=file.read()
pi = list(text)
total =0
i = 0
crossed=0
i=0
while i < len(pi):
if pi[i]>pi[i-1]:
#print(pi[i])
total=total+1
if pi[i]
Pi has a 0 total 657 times. Which is more than 51 out of 200 random million long sequences did in my tests. None of this means anything. Going up or down based on digits in a base ten number but i like these pattern sort of sequences.
E crosses 0 1725 times
sqrt2 crosses 0 1300 times
and with 2 million digits
The python code for visualisation is
import numpy as np
import matplotlib.pyplot as plt
plt.scatter(x, y, alpha=0.5, color='green')
plt.title('Sqrt 2 High Low Game')
plt.show()
No comments:
Post a Comment