Exemple #1
0
def test_rand(i):
    outcomes = ['00', '01', '10', '11']
    pmf = [1/4]*4
    d = Distribution(outcomes, pmf)
    assert d.rand() in outcomes
Exemple #2
0
def test_rand():
    outcomes = ['00', '01', '10', '11']
    pmf = [1/4]*4
    d = Distribution(outcomes, pmf)
    for _ in range(10):
        yield assert_true, d.rand() in outcomes
Exemple #3
0
def test_rand():
    outcomes = ['00', '01', '10', '11']
    pmf = [1 / 4] * 4
    d = Distribution(outcomes, pmf)
    for _ in range(10):
        yield assert_true, d.rand() in outcomes