'Calculates expected values for a contingency table.'

@classmethod
def _expected_values(cls, cont):

    n_all = sum(cont)
    bits = [(1 << i) for i in range(cls._n)]
    for i in range(len(cont)):
        (yield (_product((sum((cont[x] for x in range((2 ** cls._n)) if ((x & j) == (i & j)))) for j in bits)) / (n_all ** (cls._n - 1))))
