News for hackers. Stuff that matters.
Re:Shortest bit sequence that's never been sent over the Int... by zwischenzug on Thursday April 19, 2018 @03:17AM (#16873968)
You've answered a different question:

How likely are the substrings "11" and "10" to appear in binary strings of length 3?

rather than:

Is the sequence of '111' as equally likely to appear as '010' given that 1s and 0s are equally likely to appear?

Re:Shortest bit sequence that's never been sent over the Int... by zwischenzug on Thursday April 19, 2018 @03:18AM (#16873969)
Reminds me of a question an old tutor used to ask potential thesis candidates:

If I throw two dice, what's the probability I throw at least one six?

Re:Shortest bit sequence that's never been sent over the Int... by pure-awesome on Thursday April 19, 2018 @03:23AM (#16873987)
Am I being stupid, or is the answer 11/36? I.e., slightly less than 1/3?

Out of 36 possible throws of a pair of dice, 10 of them have a single six and 1 more has both sixes.

Re:Shortest bit sequence that's never been sent over the Int... by tomsmeding on Thursday April 19, 2018 @03:45AM (#16874076)
Seems correct. The probability of at least one 6 is one minus the probability that both aren't a 6, which is 5/6 * 5/6 = 25/36; so the result is (36-25)/36 = 11/36.
Re:Shortest bit sequence that's never been sent over the Int... by rtkwe on Thursday April 19, 2018 @10:14AM (#16876022)
Why wouldn't it just be the probability of either rolling at least one 6 which would be 1/6 + 1/6 = 1/3? Genuinely curious, I was never super good at probability calculations.

edit: clarification of problem.

Re:Shortest bit sequence that's never been sent over the Int... by Retric on Thursday April 19, 2018 @10:22AM (#16876099)
Picture two coins and 2 flips and count the H's there (2x2) = 4 options and ((2x2) x 1/2 x 2(flips)) = 4 Heads.

HH, HT, TH, TT

However, if you count the sequences with at least one H there are (4-1) = 3 with at least 1 H (HH, HT, HT) as the HH eats up 2 H's.

Now, Picture 3 sided dice, that's (3x3) = 9 options. You will see ((3x3) x 1/3 x 2(flips)) = 6 2's.

00, 01, 02, 10, 11, 12, 20, 21, 22

However if you count there are (6 - 1) = 5 sequences with at least one 2 you get 02, 12, 20, 21, 22 as the 22 eats up an extra 2.

Now, what do you think happens with an N sided dice? What if N is 6.

PS: This seems less clear as I added more info...

Re:Shortest bit sequence that's never been sent over the Int... by rtkwe on Thursday April 19, 2018 @10:51AM (#16876366)
Yeah doing a brute force count of the possibilities the (6,6) option is double counted by the 1/6 + 1/6 method as two distinct possibilities. Or that's what it looks like is happening. Been too long since my college combinatorics class.
Re:Shortest bit sequence that's never been sent over the Int... by pkaye on Thursday April 19, 2018 @12:53PM (#16877520)
Imagine doing that with 7 dice... 7/6 probability!
Re:Shortest bit sequence that's never been sent over the Int... by escherplex on Thursday April 19, 2018 @02:05PM (#16878362)
Which suggests the probability of the event not happening would be -1/6, which suggests the quasiprobability of the event not not happening. Obviously no ambiguity there. /s
Re:Shortest bit sequence that's never been sent over the Int... by oaisdjoaisjdoi on Thursday April 19, 2018 @10:28AM (#16876146)
Because those are just numbers that work. The only way to roll a 2 (for example) is to roll 2 1's - which is obviously 1/36, not 1/3.
Re:Shortest bit sequence that's never been sent over the Int... by rtkwe on Thursday April 19, 2018 @10:48AM (#16876345)
Sorry the problem was probability of rolling at least one 6 not of rolling a 6. Edited my original to make that clearer without the original post.
Re:Shortest bit sequence that's never been sent over the Int... by 0x0 on Thursday April 19, 2018 @11:05AM (#16876514)
Because you're not guaranteed to roll a 6, even if you roll 6 times: 1/6 + 1/6 + 1/6 + 1/6 + 1/6 + 1/6 = 6/6 = 100% chance? Nope. :)
Re:Shortest bit sequence that's never been sent over the Int... by zwischenzug on Thursday April 19, 2018 @04:28AM (#16874251)
Nope, you're being clever.
Re:Shortest bit sequence that's never been sent over the Int... by uryga on Thursday April 19, 2018 @05:41AM (#16874533)
could you explain? I got the same thing...
Re:Shortest bit sequence that's never been sent over the Int... by jwilk on Thursday April 19, 2018 @06:26AM (#16874686)
I think it was meant to be a direct answer to "Am I being stupid [...]?"
Re:Shortest bit sequence that's never been sent over the Int... by zwischenzug on Thursday April 19, 2018 @06:58PM (#16880901)
Yup... shows the value of HN votes...
Re:Shortest bit sequence that's never been sent over the Int... by emj on Thursday April 19, 2018 @03:58AM (#16874120)
Is the tutor fair and unbiased?
Re:Shortest bit sequence that's never been sent over the Int... by daveFNbuck on Thursday April 19, 2018 @11:14AM (#16876588)
I wrote a quick Python snippet to compute the probabilities for all sequences of length 3 over 20 flips:

  [(x, sum(1 for i in range(2**20) if x in '{:020b}'.format(i)) / 2.0**20) for x in map('{:03b}'.format, range(8))]
The output shows a 79% chance for "000" and a 91% chance for "010". "000" and "111" are actually the least likely substrings, with "010" and "101" in second place.

Furthermore, "001" has a 97% chance of occurring. It's pretty easy to see why "001" is so much more likely than the others. Unless your string perfectly alternates 0s and 1s, you're going to get repeating pairs. What happens after you get a "00"? If there's ever a 1 again, there were at least two 0s before it.

So you're almost guaranteed a "001" after "00", unless it's near the very end of the string. You only have a 50% chance of getting "000" from these though. A 1 completely resets the search for "000", but a 0 keeps the search alive for "001".

Re:Shortest bit sequence that's never been sent over the Int... by zwischenzug on Thursday April 19, 2018 @12:19PM (#16877164)
Again: that looks for whether that sequence is in each tested string, which is a different problem.

It tests if 'x' is 'in', rather than the number of times it is seen.

Re:Shortest bit sequence that's never been sent over the Int... by daveFNbuck on Thursday April 19, 2018 @08:57PM (#16881385)
But the question being tested is whether a given string is in the bits that have been transferred over the internet. The number of times it is seen is not what we're talking about here.
Re:Shortest bit sequence that's never been sent over the Int... by freyir on Thursday April 19, 2018 @03:54AM (#16874105)
Yes, but the sequence of bits that has been transmitted over the Internet is finite. That makes panic’s argument technically true.

Since we’re dealing with a sequence that’s zettabytes long, I’d guess it falls under the category of technically true but irrelevant.