malachaifrazier / bernoulli-montecarlo
Given a random process with only two possible outcomes and known chances of either outcome, what is the best way to predict the outcome? Perhaps obviously, the best method is simply always to predict the more probable outcome. But what about other methods, such as making a random guess each time according to the same probabilities of either outcome? In other words, if outcome "A" happens 60% of the time, then how often am I correct if I guess "A" only 60% of the time (and outcome "B" 40% of the time)? The answer is not 60%; indeed, it is less. Analytically, if Prob(outcome="A") = p, and you guess "A" only p*100% of the time, then you'll be correct only (p^2 + (1-p)^2) * 100% of the time. For any p other than 0.5, this method is less accurate than simply choosing "A" every time. This simple fact is demonstrated by this mini-monte carlo simulation.
About this discovery
Public repository record indexed from GitHub. Explore verified star velocity metrics, source code repositories, and curated developer tool directories across the GitHubRepo ecosystem.
More from malachaifrazier
malachaifrazier/GIFcountdownTimer
Countdown Timer for Emails
malachaifrazier/email-tester
Public repository.
malachaifrazier/rails_admin
RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data