Program logic bugs vs input/environmental errors

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 8 00:35:25 PDT 2014


On 10/07/2014 07:49 PM, Timon Gehr wrote:
> On 10/08/2014 12:10 AM, Nick Sabalausky wrote:
>> Ex: A lot of people have trouble understanding that getting "heads" in a
>> coinflip many times in a row does *not* increase the likelihood of the
>> next flip being "tails". And there's a very understandable reason why
>> that's difficult to grasp.
>
> What is this reason? It would be really spooky if the probability was
> actually increased in this way. You could win at 'heads or tails' by
> flipping a coin really many times until you got a sufficiently long run
> of 'tails', then going to another room and betting that the next flip
> will be 'heads', and if people didn't intuitively understand that, some
> would actually try to apply this trick. (Do they?)
>

I have actually met a lot of people who instinctively believe that 
getting "tails" many times in a row means that "heads" becomes more and 
more inevitable. Obviously they're wrong about that, but I think I *do* 
understand how they get tripped up:

What people *do* intuitively understand is that the overall number of 
"heads" and "tails" are likely to be similar. Moreover, statistically 
speaking, the more coin tosses there are, the more the overall past 
results tend to converge towards 50%/50%. (Which is pretty much what's 
implied by "uniform random distribution".) This much is pretty easy for 
people to intuitively understand, even if they don't know the 
mathematical details.

As a result, people's mental models will usually involve some general 
notion of "There's a natural tendency for the 'heads' and 'tails' to 
even out" Unfortunately, that summary is...well...partly truth but also 
partly inaccurate.

So they take that kinda-shaky and not-entirely-accurate (but still 
*partially* true) mental summary and are then faced with the coin toss 
problem: "You've gotten 'tails' 10,000 times in a row." "Wow, really? 
That many?" So then the questionable mental model kicks in: "...natural 
tendency to even out..." The inevitable result? "Wow, I must be overdue 
for a heads!" Fallacious certainly, but also common and somewhat 
understandable.

Another aspect that can mix people up:

If you keep flipping the coin, over and over and over, it *is* very 
likely that at *some* point you'll get a "heads". That much *is* true 
and surprises nobody. Unfortunately, as true as it is, it's *not* 
relevant to individual tosses: They're individual likelihoods *always* 
stay the same: 50%. So we seemingly have a situation where something 
("very, very likely to get a heads") is true of the whole *without* 
being true of *any* of the individual parts. While that does occur, it 
isn't exactly a super-common thing in normal everyday life, so it can be 
unintuitive for people.

And another confusion:

Suppose we rephrase it like this: "If you keep tossing a coin, how 
likely are you to get 10,000 'tails' in a row AND then get ANOTHER 
'tails'?" Not very freaking likely, of course: 1 in 2^10,001. But 
*after* those first 10,000 'tails' have already occurred, the answer 
changes completely.

What? Seriously? Math that totally changes based on "when"?!? But 2+2 is 
*always* 4!! All of a sudden, here we have a math where your location on 
the timeline is *crucially* important[1], and that's gotta trip up some 
of the people who (like everyone) started out with math just being 
arithmetic.

[1] Or at least time *appears* to be crucially important, depending on 
your perspective: We could easily say that "time" is nothing more than 
an irrelevant detail of the hypothetical scenario and the *real* 
mathematics is just one scenario of "I have 10,001 samples of 50% 
probability" versus a completely different scenario of "I have 10,000 
samples of 100% probability and 1 sample of 50% probability". Of course, 
deciding which of those problems is the one we're actually looking at 
involves considering where you are on the timeline.

>
> That said, it's just: When you first randomly choose the door, you would
> intuitively rather bet that you guessed wrong. The show master is simply
> proposing to tell you behind which of the other doors the car is in case
> you indeed guessed wrong.
>
> There's not more to it.
>

Hmm, yea, an interesting way to look at it.



More information about the Digitalmars-d mailing list