from sys import argv from math import sqrt bigdata = eval(open("sle.dat").read()) size_code = int(argv[1]) size = 2**size_code perturb_code = int(argv[2]) perturb = 2**perturb_code eps_code = 3 print "size=%d, perturb=%d" % (size,perturb) def f(k): return sqrt(2.*k/3.)/(3.*size) lst = [] for trial in range(0,250): d = bigdata.get((size_code,perturb_code,eps_code,trial),-1) if d<0: continue lst.append(d) unsorted = list(lst) if lst: lst.sort() print "%d numbers, from %4.2f to %4.2f" % (len(lst),f(lst[0]),f(lst[-1])) for q in (0.1,0.25,0.5,0.75,0.9): quantile = lst[int(q*(len(lst)-1))] place = unsorted.index(quantile) print "%d%% %4.3f (%d) [%d]" % \ (int(0.5+100*q),f(quantile),quantile,place) else: print "no such data"