code: def percentOverlap(x1, x2, numColumns):
      
    nonZeroX1 = np.count_nonzero(x1)
    nonZeroX2 = np.count_nonzero(x2)
    sparseCols = min(nonZeroX1, nonZeroX2)  
    # transform input vector specifying columns into binary vector
    binX1 = np.zeros(numColumns, dtype="uint32")
    binX2 = np.zeros(numColumns, dtype="uint32")
    for i in range(sparseCols):
      binX1[x1[i]] = 1
      binX2[x2[i]] = 1
    return float(np.dot(binX1, binX2))/float(sparseCols)
docs: Calculates the percentage of overlap between two SDRs
    
    @param x1 (array) SDR
    @param x2 (array) SDR  
    @return percentageOverlap (float) percentage overlap between x1 and x2