In [1]:
using Stochy
In [2]:
@pp flip()
Out[2]:
false
In [3]:
@pp flip()
Out[3]:
false
In [4]:
@pp function binomial()
    flip() + flip() + flip()
end
Out[4]:
binomial (generic function with 1 method)
In [5]:
@pp binomial()
Out[5]:
2
In [6]:
@pp binomial()
Out[6]:
2
In [7]:
@pp enum() do
    flip() + flip() + flip()
end
Out[7]:
Discrete({0,2,3,1}, [0.125,0.375,0.125,0.375])
In [8]:
@pp enum() do
    local a = flip(), b = flip(), c = flip()
    factor(a||b ? 0 : -2)
    a+b+c
end
Out[8]:
Discrete({0,2,3,1}, [0.0215823,0.478418,0.159473,0.340527])
In [ ]: