Пример #1
0
def test_outcome_length():
    outcomes = ['000', '011', '101', '110']
    pmf = [1 / 4] * 4
    d = Distribution(outcomes, pmf)
    d = d.marginal([0, 2])
    assert d.outcome_length() == 2
    assert d.outcome_length(masked=True) == 3
Пример #2
0
def test_outcome_length():
    outcomes = ['000', '011', '101', '110']
    pmf = [1/4]*4
    d = Distribution(outcomes, pmf)
    d = d.marginal([0, 2])
    assert_equal(d.outcome_length(), 2)
    assert_equal(d.outcome_length(masked=True), 3)
Пример #3
0
def test_coalesce():
    outcomes = ['000', '011', '101', '110']
    pmf = [1 / 4] * 4
    d = Distribution(outcomes, pmf)
    d = d.coalesce([[0, 1], [2]])
    assert d.outcome_length() == 2
Пример #4
0
def test_coalesce():
    outcomes = ['000', '011', '101', '110']
    pmf = [1/4]*4
    d = Distribution(outcomes, pmf)
    d = d.coalesce([[0, 1], [2]])
    assert_equal(d.outcome_length(), 2)