9 ms·
If anyone wants to test it, someone wrote a short code that simulates doing that 100,000 times: https://www.techiedelight.com/generate-fair-results-biased-coin
by ChocMontePy 3y ago
If anyone wants to test it, someone wrote a short code that simulates doing that 100,000 times:
https://www.techiedelight.com/generate-fair-results-biased-coin/ https://www.techiedelight.com/generate-fair-results-biased-c...
The coin is biased to come up TAILS 80% of the time, but using Von Neumann's method in the program I got HEADS 50.035%, TAILS 49.965%.
- 098799 3y agoWhy would you test it? Probability of two heads: p*p Probability of two tails: (1-p)*(1-p) Probability of head followed by tails: p*(1-p) Probability of tails followed by heads: (1-p)*p It's not difficult to notice that if you remove the first two, the last two form a 50/50 distribution
- BurningFrog 3y agoYou're of course right, but maybe 1% of the population understands that, while 100% understands the practical test.
- voidfunc 3y agoSome of us suck at math.
- HideousKojima 3y agoAlso certain unintuitive things in math/statistics (like the Monty Hall problem) because a lot clearer when you write up a quick simulation.
- williamstein 3y agoMath is often much more fun and compelling for some people when you both theoretically prove something works and then also convince yourself of the same thing via a numerical experiment. I’m pretty good at math proofs (pure math PhD, wrote some books and papers), but I still love to do numerical experiments. It’s fun, and you also set yourself up to be able to easily ask different questions that may be very hard to answer theoretically.
- foobarian 3y agoFor me it's a case of, "see, what I do is powerful after all!" after a 5 minute analytical proof matches 3 hours of simulation work. :-)
- User23 3y agoSome of you might have just suffered from poor math education. I don't believe anyone capable of learning to program competently lacks the cognitive horsepower to do math competently with more or less equivalent ease. Many do however lack the training.
- Natsu 3y agoPart of the problem is that the basic statistical model simply neglects to differentiate between observing and doing, which changes the odds. This is very important when trying to reason about causality. When you observe an association like your thermometer shows a high number when it's warm out it's one thing, but when you set your thermometer to a high number you won't get any warmer. Whereas if you warm the room, your thermometer will rise. This symmetry breaking is captured by something called do calculus.
- bob88jg 3y agoWhy would you not - analytical solutions are the rare occurrences might as well approach everything with simulation...
- kqr 3y agoWhile I agree we should leave the correct answer to simulation, analytical approximations are often surprisingly close and have the benefit of being intuition-building.
- taway_6PplYu5 3y ago(preface with "in today's world")
- CuriouslyC 3y agoYou learn a lot more from generating an analytical solution than a simulation, so it's usually worth at least taking a stab at it analytically before jumping to monte carlo methods.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- sidkshatriya 3y agoThe thing about math is that you can do things in multiple ways. Theory is useful but so is experiment.
- toxik 3y agoI think about it this way p(th) = p(t) p(h) p(ht) = p(h) p(t) Hence p(th) = p(ht) regardless of coin imbalance as long as both events actually will happen. QED.
- aqme28 3y agoYeah this is simpler. You're just throwing away every pair that isn't a TH or HT
- someone7x 3y ago> Why would you test it Is this a wrong way to get a right answer?
- cantrevealname 3y ago> Why would you test it? I recall conversations on Usenet decades ago about the Monty Hall problem[1] in which people gave elementary proofs that probabilities don't change by opening a door. Even from mathematicians and statisticians. People were very insistent that the analytical solution was simple and obvious and that switching doors didn't change anything. The only thing that changed some people's minds was a program that simulated the Monty Hall problem. This was needed to get people to reconsider their proof when the claim was highly counterintuitive. [1] https://en.wikipedia.org/wiki/Monty_Hall_problem https://en.wikipedia.org/wiki/Monty_Hall_problem
- I_Am_Nous 3y agoThe Monty Hall Problem is a fun one because you can try to approach it from a purely analytical perspective and get one answer, while incorporating the whole situation (especially the fact that the final probability is not natural as they force the final decision into far fewer doors than originally present) and testing you can find a different answer entirely. I suppose this is an interesting corollary with discoveries made by deep theoretical mathematics. While something may seem possible because "the math checks out" it could be only theoretically possible as it relies on some unnatural value to "be" possible in the first place. Testing is where hopeful theories are smashed by reality until all that remains is the verifiable truth. Truly, why wouldn't we test?
- pmontra 3y agoThat's how it went when I was solving problems at the Statistics course at university. I modeled the problem perfectly, got the wrong result. Changed assumptions, got the wrong result. Checked the solution, its reasoning didn't make much sense anyway. Run a simulation, got an approximate result close to the correct solution.
- dotancohen 3y agoThis sounds like the classic "tweak the model until the results fit with our preexisting conclusion". Very common across all industries unfortunately.
- gorjusborg 3y ago> Probability of two heads: pp > Probability of two tails: (1-p)(1-p) > Probability of head followed by tails: p(1-p) > Probability of tails followed by heads: (1-p)p > > It's not difficult to notice that if you remove the first two, the last two form a 50/50 distribution Very nice way to illustrate why throwing out the duplicate sequences gets back to a 50/50 distribution.
- skrebbel 3y ago> It's not difficult to notice that Look I found the mathematician
- nofinator 3y agoIronically, this reminds me of a story (folk tale?) about Von Neumann himself. A colleague told him about the Two Trains Problem (https://mathworld.wolfram.com/TwoTrainsPuzzle.html https://mathworld.wolfram.com/TwoTrainsPuzzle.html), and Von Neumann replied with the correct answer. When his colleague said, "Ah! You figured out he trick!", Von Neumann replied, "What trick? I just summed up the distances in my head!"
- jszymborski 3y agoSome folks have more faith in their ability to derive proofs than write simulations and vice-versa.
- thih9 3y ago> Why would you test it? Why not? The fact that you can show something with a mathematical equation doesn’t make other demonstrations any less cool.
- fennecfoxy 3y agoBecause that's how science is done, theory then practical? Maybe it's just a meat space thing, but even if the math gives us the answer it still only feels "final" or "true" to me when we've actually tested something out.
- sporkland 3y agoPut another way p*(1-p) = (1-p)*p So the probability is the same. Whereas p doesn't equal (1-p) unless p=0.5
- chaorace 3y agoWow. As usual, Von Neumann makes it look easy
- dfxm12 3y agoYou should change your name to ChocMonteCarloPy :)