Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created April 2, 2020 15:00
Show Gist options
  • Save johnmyleswhite/f85773742173bfb1ea6251d5c378ad3f to your computer and use it in GitHub Desktop.
Save johnmyleswhite/f85773742173bfb1ea6251d5c378ad3f to your computer and use it in GitHub Desktop.
function prob(n)
s = 0
for _ in 1:n
x_i = rand(UInt)
s += Int(Float64(x_i) === Float64(x_i + 1))
end
s, n
end
prob(1_000_000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment