Built something? We create video reels & spotlights for GitHub projects.Promote your project →
Catalog / malachaifrazier / bernoulli-montecarlo
Public GitHub Catalog Discovered Sep 26, 2026

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.

View repository on GitHub ↗ View creator profile Browse directory

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.

#7543203GitHub System ID
malachaifrazierOrganization / User
PublicVisibility
ActiveCatalog Status

More from malachaifrazier

↗

malachaifrazier/rails_admin

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data

Discovered
FOR MAINTAINERS

Built something? Put it in front of millions of developers.

We make a short reel about your project and post it across YouTube, Instagram, Threads, and X. Send a link, we do the rest.

SPONSORED Sponsored Partner