Verify distribution uniformity/Naive: Difference between revisions

Content added Content deleted
Line 973: Line 973:


=={{header|Julia}}==
=={{header|Julia}}==
<lang julia>using Printf
{{works with|Julia|0.6}}


<lang julia>function distcheck(f::Function, rep::Int=10000, Δ::Int=3)
function distcheck(f::Function, rep::Int=10000, Δ::Int=3)
smpl = f(rep)
smpl = f(rep)
counts = Dict(k => count(smpl .== k) for k in unique(smpl))
counts = Dict(k => count(smpl .== k) for k in unique(smpl))