Last active
October 25, 2018 03:27
-
-
Save usptact/94b26d20fea8afe19058f9f76b4d0896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Game of Ur | |
// | |
var roll = function() { | |
return flip() + flip() + flip() + flip(); | |
} | |
var game = function() { | |
var n = sample(RandomInteger({n: 20})); | |
var s = sum(repeat(n, roll)) | |
condition(s === 13); | |
return n | |
} | |
var dist = Infer(game); | |
viz(dist); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment