News for hackers. Stuff that matters.
Re:A previously unnoticed property of prime numbers by ghshephard on Monday March 14, 2016 @11:08AM (#11283240)
What's interesting, is that if you reword this slightly, and ask, "If you flip coins until you get either a head followed by a tail, or a head followed by a head, how many flips on average are required before you get a Head, followed by a Tail, versus a Head, followed by a Head" - the answers are 3 and 3 respectively.

But worded, "If you flip coins until you get a Head followed by a Tail, or flip coins until you get a Head followed by a Head, the answer reverts back to 4 and 6."

Very counterintuitive.

Re:A previously unnoticed property of prime numbers by knughit on Monday March 14, 2016 @11:42AM (#11283459)
Explain the difference?

Are you saying that HH causes an early failure for HT , instead of a potentially longer success HHHT? If so , it is poorly worded, to be ambiguous about how to count failures. (In the 4-6 variation, there are no failures)

Re:A previously unnoticed property of prime numbers by SixSigma on Monday March 14, 2016 @12:14PM (#11283664)

  flip coins
    if HT or HH
      stop
vs

  flip coins
    if HT
      stop

  flip coins
    if HH
      stop
two different scenarios
Re:A previously unnoticed property of prime numbers by ghshephard on Monday March 14, 2016 @11:52AM (#11283537)
I'm saying that if you just keep flipping coins (So, no Bob/Alice situation), and stop whenever you hit HH or HT, that the average number of flips to get to HH is 3, and the average number of flips to get to HT is 3.

But, if you are focussing on a particular scenario that you will flip coins until you get to HT, the average number of flips will be 4, and if you flip coins until you get to HH, the average number of flips will be 6.

I just find that really hard to grasp intuitively.

Re:A previously unnoticed property of prime numbers by ifdefdebug on Monday March 14, 2016 @03:05PM (#11284772)
"and stop whenever you hit HH or HT" is equivalent to say "whenever you hit H, flip one more then stop". Average to hit H is obviously 2, plus one is 3, so you are right, but IMO it's not that counter-intuitive.
Re:A previously unnoticed property of prime numbers by mikeash on Monday March 14, 2016 @02:43PM (#11284626)
Do I understand your first scenario correctly, that if for example you flip TTHH, you stop there, count that as "took four flips to get to HH," count nothing for HT, and then start over?

Seems like you're just taking a biased sample, which cancels out the differences. To take an extreme example, imagine one candidate is HHHHHHHHHH and the other candidate is any other sequence of ten flips. In the "try until you get either one" scenario, the average number of flips for either one will be 10. Testing them independently, the average number of flips for the second one will be slightly over 10, and for HHHHHHHHHH it'll be huge.

Re:A previously unnoticed property of prime numbers by zipppy on Monday March 14, 2016 @01:22PM (#11284068)
I don't think that's true. I think that the average number of flips before _stopping_ might be 3, but it doesn't become more likely to get HT simply because you're also looking for HH (or vice versa).
Re:A previously unnoticed property of prime numbers by ghshephard on Monday March 14, 2016 @06:42PM (#11286100)
It turns out that the average number of flips to get HH and HT is 3 - someone else on the thread described it well - on average, the number of flips to get to a "H" will be 2, and then you will always stop on the next flip - 50% at flip 3 with a HT, and 50% at flip 3 with a HH. Explained that way, it makes sense that the average number of flips is 3.

But, I still find it strange that if you are flipping with one particular scenario in mind, HT or HH, that the average number of flips goes from 3 to 4 or 6, even if I can reason it out with a bit of thinking.