import time
import math
conjunto = [0.397,0.993,0.674,0.426,0.46,0.189,0.112,0.37,0.909,0.172
		   ,0.832,0.371,0.688,0.054,0.224,0.753,0.191,0.314,0.764,0.516
		   ,0.966,0.729,0.055,0.022,0.99,0.73,0.589,0.731,0.999,0.439
		   ,0.0472,0.067,0.499,0.742,0.786,0.797,0.347,0.742,0.303,0.393
		   ,0.797,0.189,0.494,0.674,0.393,0.292,0.426,0.213,0.718,0.268
		   ,0.101,0.977,0.235,0.898,0.461,0.876,0.057,0.472,0.933,0.123
		   ,0.696,0.843,0.178,0.641,0.011,0.707,0.819,0.641,0.056,0.945
		   ,0.966,0.562,0.775,0.674,0.977,0.562,0.303,0.944,0.415,0.527
		   ,0.404,0.549,0.792,0.84,0.246,0.562,0.404,0.281,0.819,0.459
		   ,0.603,0.992,0.252,0.19,0.881,0.84,0.64,0.663,0.444,0.652]
m        = int(math.sqrt(float(len(conjunto))))
n0       = 0
n1       = 0
co       = 0
matriz   = []

for i in conjunto:
	if   i > 0.5:
		matriz.append(1)
		n1 +=1
	elif i < 0.5:
		matriz.append(0)
		n0+=1

##CORRIDAS OBSERVADAS  CONTEO MAL
for j in matriz:
	if j == 0 and matriz[j+1] == 1 or j == 1 and matriz[j+1] == 0:
		co+=1
		print "corridas"+str(co) +" = "+str(j)




print matriz
print "n  = %i \nn0 = %i \nn1 = %i\nm  = %i \nCo = %i "%(len(conjunto),n1,n0,m,co)