Flip a weighted coin

Yea, but you can do that with the Distributions example too:

julia> coins = Bernoulli.([0.2, 0.5, 0.7]) # 3 coins with different weights
3-element Array{Bernoulli{Float64},1}:
 Bernoulli{Float64}(p=0.2)
 Bernoulli{Float64}(p=0.5)
 Bernoulli{Float64}(p=0.7)

julia> rand.(coins) # flip the set of coins
3-element BitArray{1}:
 0
 1
 1
7 Likes