If I throw two dice, what's the probability I throw at least one six?
Out of 36 possible throws of a pair of dice, 10 of them have a single six and 1 more has both sixes.
edit: clarification of problem.
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...
[(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".
It tests if 'x' is 'in', rather than the number of times it is seen.
Since we’re dealing with a sequence that’s zettabytes long, I’d guess it falls under the category of technically true but irrelevant.
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?