Skip to content

Instantly share code, notes, and snippets.

@mattmazzola
Created November 23, 2020 03:53
Show Gist options
  • Save mattmazzola/51bfb030eb656a1bdb50095fd9541ee1 to your computer and use it in GitHub Desktop.
Save mattmazzola/51bfb030eb656a1bdb50095fd9541ee1 to your computer and use it in GitHub Desktop.
Compute player outcome
const [playerProbability, questionProbability] = ratingSystem.getPlayerProbabilities(player.rating, question.rating)
const expectedOutcome = playerProbability > 0.5 ? 1 : 0
const playerOutcome = Math.random() < playerProbability ? 1 : 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment