Skip to content

Instantly share code, notes, and snippets.

@seekshreyas
Created November 13, 2013 08:14
Show Gist options
  • Select an option

  • Save seekshreyas/7445479 to your computer and use it in GitHub Desktop.

Select an option

Save seekshreyas/7445479 to your computer and use it in GitHub Desktop.
Probability problem
var probability = function(a,b, num_games){
if (a === num_games) return 1;
if (b === num_games) return 0;
return 0.5*probability(a+1, b, num_games) + 0.5*probability(a,b+1, num_games)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment