In [1]:
import sdm as sdmlib
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import clear_output
%matplotlib inline

In [3]:
bits = 1000
sample = 1000000
scanner_type = sdmlib.SDM_SCANNER_THREAD

In [5]:
v = []
for _ in xrange(sample):
    v.append(sdmlib.Bitstring.init_random(bits))

In [6]:
len(v)


Out[6]:
1000000

In [8]:
ref = v[0]

In [13]:
d = []
for bs in v:
    dist = ref.distance_to(bs)
    if dist > 0:
        d.append(dist)

In [14]:
d.sort()

In [17]:
d[:25], d[-25:]


Out[17]:
([422,
  423,
  425,
  429,
  430,
  430,
  432,
  432,
  432,
  432,
  433,
  433,
  433,
  433,
  433,
  434,
  434,
  435,
  435,
  435,
  435,
  435,
  436,
  436,
  436],
 [563,
  563,
  563,
  563,
  563,
  564,
  564,
  564,
  565,
  565,
  565,
  566,
  566,
  566,
  568,
  568,
  568,
  569,
  570,
  570,
  571,
  572,
  573,
  577,
  577])

In [ ]:


In [ ]:


In [ ]: