In [126]:
from Base_Question import make_num_grid,near_me_num,Meathead_Movers,colorful
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from IPython.display import Image
from IPython.display import HTML
from IPython.display import IFrame
In [2]:
grid1 = make_num_grid(100,100,50,50)
near1 = near_me_num(grid1,50)
i = 0
In [3]:
while len(near1[3]) > 0 and len(near1[2]) > 0:
near1 = near_me_num(grid1,50)
grid1 = Meathead_Movers(*near1)
print (len(near1[2]), len(near1[3]))
i+=1
if len(near1[2]) == len(near1[3]):
break
In [4]:
colorful(grid1)
In [5]:
print (i)
In [6]:
Loops = [5.5,25.5,32,40,65.25,58,61.75,81,117,94.5,96.25,139.2,163,145.5,132.25,223,166.75,215.75,308.25,151.25]
Size = np.arange(5,105,5)
In [7]:
plt.figure(figsize=(15,5))
plt.grid(True)
plt.plot(Size,Loops)
ax = plt.gca()
plt.title("Loops vs Size")
plt.xlabel("Size")
plt.ylabel("Loops")
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()
In [8]:
Image(url = 'http://ej.iop.org/images/1742-5468/2008/07/L07002/Full/8568503.jpg', width = 500, height = 500)
In [9]:
grid2 = make_num_grid(100,2,50,50)
near2 = near_me_num(grid2,50)
i = 0
In [10]:
while len(near2[3]) > 0 and len(near2[2]) > 0:
near2 = near_me_num(grid2,50)
grid2 = Meathead_Movers(*near2)
print (len(near2[2]), len(near2[3]))
i+=1
if len(near2[2]) == len(near2[3]):
break
In [11]:
colorful(grid2)
In [12]:
Image(url='http://complexity.stanford.edu/wp-content/uploads/2014/06/chicagodots_race_lines.jpg', height = 500,width = 500)
In [ ]: