Skip to content

Instantly share code, notes, and snippets.

View iamed2's full-sized avatar

Eric Davies iamed2

  • Beacon Biosignals
  • Winnipeg, MB, Canada
View GitHub Profile
@iamed2
iamed2 / odds.jl
Created November 1, 2021 16:27
Calculate the experimental odds of snake eyes if you're told "at least one of them is a one"
function tally(n=100)
snake_eyes = 0
any_ones = 0
for i in 1:n
rolls = (dice_roll(), dice_roll())
if 1 in rolls # tests at least one of them is a one
any_ones += 1
if rolls[1] == rolls[2] # tests both are one