Skip to content

Instantly share code, notes, and snippets.

@brian-bot
Created July 20, 2016 21:08
Show Gist options
  • Save brian-bot/1019314e1138246446bb41f0e2f31729 to your computer and use it in GitHub Desktop.
Save brian-bot/1019314e1138246446bb41f0e2f31729 to your computer and use it in GitHub Desktop.
calculation for the probability of the NBA Draft lottery going as 'chalk'
## NBA DRAFT ODDS - CHANCES OF 'CHALK'
chancesInOrder <- c(250, 199, 156, 119, 88, 63, 43, 28, 17, 11, 8, 7, 6, 5)
conditionalProb <- 1
for(i in 1:3){
conditionalProb <- conditionalProb*chancesInOrder[i]/sum(chancesInOrder[i:length(chancesInOrder)])
}
conditionalProb
# > conditionalProb
# [1] 0.0187804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment