04-22-2013 09:46 AM
I think Norbert got that part wrong where he said the chance didn't change if you added an 11th toss. When you have a case of getting 10 in a row in 11 throws, it basically gives you a mulligan on the first throw if it happens to turn up wrong. So 50% of the time you have a 1/512 chance (like you said, you need just 9 more), and 50% of the time you have a 1/1024 chance to get all 10. I don't remember all the rules of working probability calculations. But I'm going to guess the end result is 1.5 out of 1024 are your chances with 11 throws. (Someone with a stronger math/probability background can correct me).
@Edjsch wrote:
. This is why I thought that the chance of getting 10 heads in a row in an infinite number of tosses averages out to 50%.
The fact that the simulation shows about 40% rather than 50% is rather subtle. I don't think anyone would intuitively predict this. Don't you agree?
The chances of getting 10 heads in a rows sometime within an infinite number of tosses has to be close to 100%. 1024 tosses in a row is nowhere near an infinite number of tosses. I could never intuitively predict the chances of 10 heads in a row in a set of 1024 tosses to know whether it would be 40%, 50%, or 60% or some other number.
For fun, rerun your simulations and keep multiplying the number of tosses by 10 each time and see what your chances are of getting at least one run of at least 10 heads.
Another thing that might be interesting is to do 1024 tosses, then find out how many stretches of consectutive heads there are. Do a histogram of 1 head, 2 heads in a row, 3 heads in a row. See what is the most common number of heads in a row. Then keep repeating that simulation to see how it changes.
04-22-2013 10:24 AM
RavensFan,
Thanks. You are correct when you said, "The chances of getting 10 heads in a rows sometime within an infinite number of tosses has to be close to 100%."
I misspoke when I said, "This is why I thought that the chance of getting 10 heads in a row in an infinite number of tosses averages out to 50%." What I meant to say (and I said it several times in my posts) is this:
"In a large number of tosses (I thought) there should be 10 heads in a row approximately every [the # of tosses / 1024] times with a 50% probability." (That would make it [the # of tosses / 2048] times, wouldn't it?) In other words, in every 1024 tosses there should be a 50% probability of seeing 10 heads in a row. Our simulations, however, shows about 40%. This is what I'm trying to grasp. I need to mull over what you said previously some more.
Ed
04-23-2013 01:30 PM
Don_Phillips,
I finally had a chance to look at and run your code. Thanks so much. IT PROVES MY ASSUMPTION/THEORY to be correct!!
Notice that your "Tosses/10s" indicator shows 1032. The first time I ran it was for 1.6 million tosses and got 1022.8. Every time I run it the results ("Tosses/10s") are close to 1024 (usually not quite as close as my first run of 1023).
Again, this proves my assertion and theory that in a large number of tosses there will be 10 or more heads in a row approximately every [# of tosses / 1024] times" (i.e., # of tosses / 2^N). (Forget the 50% probability. That was a latter incorrect assumption and is proven wrong by your "New HTs.vi".) We all agree that getting 10 heads in a row has a probability of 1 in 1024. From what I remember of my course in Probability and Statistics (way) back in college, I reasoned that this is equivalent to the probability of 10 (or more) heads occurring in a row in a huge number of tosses. Maybe some of this also comes from my knowledge of sampling theory. Think of it as a repeating pattern in the "noise" of a huge number of samples (tosses).
Be that as it may, your vi was just what I (and everyone else) was trying to code to prove my assertion. BTW, it also proves to my co-worker that after any number of heads in a row, the very next toss is still 50-50, which we all also agree on. (We all know that when dealing with disbelievers, they will not believe/trust the code; they will say it was either coded wrongly or deliberately mis-coded to prove the theory. But in this case I can honestly say that I DIDN'T CODE IT. You did!)
Thanks again all. (Anyone else care to weigh in?)
Ed
04-24-2013 09:50 AM
Don,
Your program, New HTs.vi, I think proves my point. See my previous post. But I'd like to reply to your 04-18-2013 01:40 PM post, which I thought about some more. You said:
>> So you would be saying in four coin tosses you would expect 2 heads in a row 1/4 of the time (%25).
No, I'm not quite saying that. I'm saying, to be more mathematically precise, that as the number of coin tosses approaches infinity, the number of times there are 2 heads in a row approaches 1/4 of the time (25%).
Look at it this way: When tossing a coin twice, the possible outcomes are 00, 01, 10, and 11. So 11 comes out 1 in 4 tosses, or 25% of the time. I think we all agree on this. Later you showed 4 tosses and listed the 16 4-bit binary numbers from 0000 to 1111 and said:
>>16 possible combinations but 8 chances to have two or more in a row = %50.
But that's not quite the same. Think of it like this: Say you string together groups of 2 tosses as follows, with each having 4 possible outcomes:
1:[00, 01, 10, 11], 2:[00, 01, 10, 11], 3:[00, 01, 10, 11], 4:[00, 01, 10, 11], 5:[00, 01, 10, 11], 6:[00, 01, 10, 11], and so on.
In this illustration it's obvious that 11 will come out 25% of the time. No?
Ed
04-24-2013 10:31 AM - edited 04-24-2013 10:37 AM
I'm going to disagree. It doesn't account for the sequence of heads that jump across the subsets.
Let's say you have a group of 8 tosses. 10 11 00 01. Heads came up twice in a row exactly once.
Now you have another 8 tosses that are identical. 10 11 00 01. Heads came up twice in a row exactly once.
But across those 16 tosses 10 11 00 01 10 11 00 01. Two heads came up in a row exactly 3 times.
04-24-2013 11:10 AM
RavensFan,
You said >> But across those 16 tosses 10 11 00 01 10 11 00 01. Two heads came up in a row exactly 3 times.
Yes, for that exact outcome. But I think what you are missing is that the exact same outcome would probably NOT come out in a row. If they did, it would also be 1/4 the time. In my illustration I was trying to show the 4 possible outcomes, but they are NOT the actual outcomes. I know this is a little hard to fathom, but...
In any event, did you try Don_Phillips' program? It does show that 10 heads in a row does indeed come out every [# tosses / 1024] times. Run it (let it run for a few million tosses) and see.
Ed
04-24-2013 12:51 PM
Edjsch wrote:In any event, did you try Don_Phillips' program? It does show that 10 heads in a row does indeed come out every [# tosses / 1024] times. Run it (let it run for a few million tosses) and see.
Are you looking for a streak of 10 heads from a single coin or are you looking for 10 coins to all flip heads? This is a difference.
If you are looking for the 10 coins to all be heads, then Don's code is what you are looking for.
If you are looking for a streak from 1 coin, then it is flawed. Don's code counts 10 flips as a single flip. So the math will be wrong. What I found with my code is that you will get a streak of 10 or more every ~2048 tosses.
04-24-2013 01:07 PM - edited 04-24-2013 01:10 PM
@Edjsch wrote:
RavensFan,
You said >> But across those 16 tosses 10 11 00 01 10 11 00 01. Two heads came up in a row exactly 3 times.
Yes, for that exact outcome. But I think what you are missing is that the exact same outcome would probably NOT come out in a row. If they did, it would also be 1/4 the time. In my illustration I was trying to show the 4 possible outcomes, but they are NOT the actual outcomes. I know this is a little hard to fathom, but...
In any event, did you try Don_Phillips' program? It does show that 10 heads in a row does indeed come out every [# tosses / 1024] times. Run it (let it run for a few million tosses) and see.
Ed
For ease of making an example, I duplicated the next 8 to be just like the first 8. Of course that is probably not going to happen. But it does show that the chances of 2 heads in a can happen more often when you look at a longer stretch of tosses, as opposed to summing up the occurrences in each subset of tosses. If it makes you happier, I'll rewrite it as
10 11 00 01 10 01 10 01. Still a single case of 2 consecutive heads in each group of 8 tosses. But 3 cases of consecutive heads when looking at all 16 tosses as a series.
I did look at Don Phillip's program. And it looks good, as long as you are analyzing it based on the way it was written. The first thing he does is come up with a single group of 10 tosses, multiple times. And the chances for any specific group of 10 to be all heads is about 1 in 1024 like you expect. He also throws the coin one more time in the case that 10 have come up in a row, and that is a head 50% of the time like you'd expect. Never does he truly analyze a long stretch of tosses. He is only looking at groups of 10 or 11.
The chances of 10 in a row continually increase the longer you make your sequence.
If he had 20 tosses in a row such as 10010 11111 11111 01000. Neither group had 10 Heads in a row. His tally for that would be 0 out of 2. But the sequence did have an occurrence of 10 heads in a row. He doesn't ever look at longer sequences, so he would not have detected that. If he had, he could have had a tally showing that the 11th toss after 10 turned out to be a tails. (In a slightly different example, it could have been a heads.)
Don Phillip's program pretty much proves two things.
1. Within a group of 10 tosses, all heads occurs about 1/1024 of the time.
2. If you have a group of 10 tosses, the 11th toss being a head occurs about 50% of the time.
No where does he prove/disprove/test the theory that for the probability you will have a run of 10 heads in a row in any longer stretch of runs such as 1024 in a row. That is a completely different test. Again, apples vs. orange.
Here is another question. Suppose you have 12 tosses, all heads. 11111 11111 11. How many times did 10 heads in a row occur there? Once, twice, three times? Depending on how you answer that question can affect out you count things and thus affects the calculation of probability.
04-24-2013 01:29 PM - edited 04-24-2013 01:33 PM
crossrulz,
Yes, I am looking for a streak of 10 heads (or more) from a single coin. Nowhere did it mention that I'm throwing 10 or 1024 coins, or some such number, at once.
But what you say, "What I found with my code is that you will get a streak of 10 or more every ~2048 tosses" seems to disagree with RavensFan's post after yours. He is indicating that counting the transitions from one streak to the next adds to the possibility of increasing the streak (which is true in that narrow sense). So from his reasoning it should be more likely than every ~2048 tosses. He seems to think it will be more frequent than 1/1024.
Anyway, my code was different than Don's code, as I think was everyone else's. We were trying to count 10 or more heads in a row, and restart the count when a tail came up. We all seem to come up with about 40%. I still can't figure out where that number comes from. I think it should be a binary (i.e., power of 2, i.e., 2^N) number.
Can you post your code in LV8.5? Thanks.
Ed
04-24-2013 02:00 PM
@Edjsch wrote:
crossrulz,
Yes, I am looking for a streak of 10 heads (or more) from a single coin. Nowhere did it mention that I'm throwing 10 or 1024 coins, or some such number, at once.
But what you say, "What I found with my code is that you will get a streak of 10 or more every ~2048 tosses" seems to disagree with RavensFan's post after yours. He is indicating that counting the transitions from one streak to the next adds to the possibility of increasing the streak (which is true in that narrow sense). So from his reasoning it should be more likely than every ~2048 tosses. He seems to think it will be more frequent than 1/1024.
Anyway, my code was different than Don's code, as I think was everyone else's. We were trying to count 10 or more heads in a row, and restart the count when a tail came up. We all seem to come up with about 40%. I still can't figure out where that number comes from. I think it should be a binary (i.e., power of 2, i.e., 2^N) number.
Can you post your code in LV8.5? Thanks.
Ed
Here's my code in 8.5.