Naked Science Forum
Non Life Sciences => Physics, Astronomy & Cosmology => Topic started by: cheryl j on 07/10/2013 02:31:55
-
You can move this to general science or somewhere. I just posted it here because physicists are good at math.
Anyway, I've been reading two books at the same time that have nothing to do with each other, totally different topics. But curiously, both authors used the same mathematical example to illustrate a point, but with different solutions.
The situation is this: You are playing a guessing game, where you have to guess which light will flash next, green or red, and it's random, but set up so that it flashes red 80% of the time and green 20% of the time, and you are aware of this.
A) Should you always guess red? Or B) should you answer red 80% of the time and green 20% ? One author said A will give you more correct answers, and another said B will.
-
A is correct, assuming that each trial is independent.
If not independent, then the answer may be different. So, say you have 10 trials and know that 8 are red and 2 are green. If the first 8 are red, then you would conclude the last 2 would be green.
However, with independent trials, on any given trial, you have an 80% chance of being right with a red guess and a 20% chance of being right with a green guess.
If you always answered red, you should be right 80% of the time.
If you randomly guessed red 50% of the time, and green 50% of the time, then, half of the time you'd have an 80% chance of being right, and half the time you'd have a 20% chance of being right half the time.
Your probability of being right then is: 0.5*.0.8 + 0.5*0.2 = 0.4 + 0.1 = 50% correct. Hmmm, that is interesting.
So, if you guessed 80/20, your probabilities would be: 0.8*0.8 + 0.2*0.2 = 0.64 + .04 = 0.68, or 68% correct.
Thus, the 100% Red with an 80% probability of being correct exceeds the 80/20 guess with a 64% probability of being correct.
-
You can move this to general science or somewhere. I just posted it here because physicists are good at math.
Anyway, I've been reading two books at the same time that have nothing to do with each other, totally different topics. But curiously, both authors used the same mathematical example to illustrate a point, but with different solutions.
The situation is this: You are playing a guessing game, where you have to guess which light will flash next, green or red, and it's random, but set up so that it flashes red 80% of the time and green 20% of the time, and you are aware of this.
A) Should you always guess red? Or B) should you answer red 80% of the time and green 20% ? One author said A will give you more correct answers, and another said B will.
You should always guess red. The one who said otherwise is completely wrong.
-
My initial response to this is as red flashes 80% of the time by guessing red every time is going to mean you will be correct 80% of the time.
-
My initial response to this is as red flashes 80% of the time by guessing red every time is going to mean you will be correct 80% of the time.
That's correct.
-
If one had been told the flashes were a random sequence of reds and greens and nothing else other than that the long time average was four times as many reds as greens if one saw a sequence of eight reds one would be tempted to guess the next one would be green.
this would be wrong if what you have been told was correct your best bet would still be red.
-
My initial response to this is as red flashes 80% of the time by guessing red every time is going to mean you will be correct 80% of the time.
Yep, if the next flash is independent of past flashes, it's got an 80% chance of flashing red. In light of this, it would be best to guess red. Since each flash is completely independent of the history, you can make this came argument for each flash--always pick red.
You will never get 100% correct by doing this, but if you start guessing green 20% of the time, while you do have a chance of getting 100% correct, you will on average do worse than all-red.
-
Think about this as you would think about the lottery. If you're smart then you'll play the same number every time you play. That way the odds of you winning in your life time will be greater than if you changed the number each time. A similar thing is going on here.
-
If the lottery is truly random, then it shouldn't make any difference if you choose the same number or not.
The biggest difference in a lottery is that you are best off choosing a number that nobody else has chosen. Why share a pot 5 ways when you can get the whole thing yourself?
Thus, if a bunch of people restrict their lottery choices to numbers between 1-12 & 1-31, then they may have a greater probability of sharing the pot, and thus receiving a smaller pot.
As I calculated above, if you always guess red, you'll have an overall 80% chance of being right.
If you guess randomly 50/50, then you'll have an overall 50% chance of being right,
And if you guess 80% of the time red, and 20% of the time green, you'll have an overall 68% chance of being right.
The only difference is if the trials aren't independent. Then your odds may change slightly. This what some people get with "counting cards" when playing blackjack. Simply considering the 10,J,Q,K, or 16 cards out of 52 cards, one gets a probability that these cards will come up (4:13). However, based on the history of a deck, the probability of those cards can change significantly. Likewise, if you're wishing for an ace, the probability on a full deck would be 1:13, but if half the deck was played without any aces showing up, then the new probability is 1:6.5, or much better odds.
-
If the lottery is truly random, then it shouldn't make any difference if you choose the same number or not.
Not if you're only playing once. I'm referring to playing continuosly. There's a difference.
Here's a way to see this experimentally. Take a coin and flip it 100 times and record the value of each flip on a piece of paper. Each time you flip the coin, call either heads or tails each time. Right that down too and then record if you won or loss each time.
At the end of the 100 flips determine how many times you called it correctly. Now determine how many heads came up. Which number is greater?
-
I tried Pmb's experiment 10 times on a computer. The results are as follows:
Nr Heads Nr Right?
52 52
56 50
53 44
57 53
46 46
51 55
51 59
46 56
53 60
53 45
Average: 51.800 52.000
Std Dev: 3.6147 5.6960
From these results, there is almost no difference in the two methods (0.4%).
The difference is far less than a standard deviation, so the difference is not significant.
Is this experiment some sort of quantum-mechanical effect?
- The observer calling out the expected value changes the actual value?
- Or isn't a computer considered an observer?
- Or is the computer's pseudo-random number generator biased?
-
Here's a way to see this experimentally. Take a coin and flip it 100 times and record the value of each flip on a piece of paper. Each time you flip the coin, call either heads or tails each time. Right that down too and then record if you won or loss each time.
At the end of the 100 flips determine how many times you called it correctly. Now determine how many heads came up. Which number is greater?
Oh, Evan beat me by a couple of minutes [:(]
Sorry, I'd rather do this electronically, than with a coin.
So, I whipped out a quick program using the random number generator.
1,000,000,000 "flips".
4 paradigms.
- Count Heads / Tails (same as if had guessed heads or tails).
- Every flip, make a new random guess.
- Start with heads. If it is "right", then guess the same the next time. If it is "wrong", then make the opposite guess the next time. (This is the same as guessing the next flip will be the same as the last flip)
- If you're correct, try the opposite for the next flip. (turns out to give the exact opposite results as the previous trial)
All results came between 49.998% & 50.002%
Of course there were some minor differences between different methods which I'm attributing to flaws in the pseudo-random number generator being used by the system.
That is a point for lotteries though. You may be able to "beat the odds" if it has a computer generated random number generator, but assuming the spinning balls that are frequently used by lotteries actually give true random numbers, then it isn't so easy to beat the odds.
Note, by flipping a real coin, it is also possible that one doesn't get it completely randomized between flips, so the probability of the next flip may be dependent on the last state.
-
- If you're correct, try the opposite for the next flip. (turns out to give the exact opposite results as the previous trial)
This part makes this an entirely different problem though.
-
Here's a way to see this experimentally. Take a coin and flip it 100 times and record the value of each flip on a piece of paper. Each time you flip the coin, call either heads or tails each time. Right that down too and then record if you won or loss each time.
At the end of the 100 flips determine how many times you called it correctly. Now determine how many heads came up. Which number is greater?
Oh, Evan beat me by a couple of minutes [:(]
Sorry, I'd rather do this electronically, than with a coin.
So, I whipped out a quick program using the random number generator.
1,000,000,000 "flips".
4 paradigms.
- Count Heads / Tails (same as if had guessed heads or tails).
- Every flip, make a new random guess.
- Start with heads. If it is "right", then guess the same the next time. If it is "wrong", then make the opposite guess the next time. (This is the same as guessing the next flip will be the same as the last flip)
- If you're correct, try the opposite for the next flip. (turns out to give the exact opposite results as the previous trial)
All results came between 49.998% & 50.002%
Of course there were some minor differences between different methods which I'm attributing to flaws in the pseudo-random number generator being used by the system.
That is a point for lotteries though. You may be able to "beat the odds" if it has a computer generated random number generator, but assuming the spinning balls that are frequently used by lotteries actually give true random numbers, then it isn't so easy to beat the odds.
Note, by flipping a real coin, it is also possible that one doesn't get it completely randomized between flips, so the probability of the next flip may be dependent on the last state.
If I'm doing my calculations right, the results of 1,000,000 flips should have a standard deviation of 500 heads off from the mean value of 500,000 heads. This would put it at 49.95% heads and 50.05% heads within 1 standard deviation. In other words, it's likely that 49.998% to 50.002% guessed correctly is just statistical fluctuation, not an issue with the RNG used.
-
If I'm doing my calculations right, the results of 1,000,000 flips should have a standard deviation of 500 heads off from the mean value of 500,000 heads. This would put it at 49.95% heads and 50.05% heads within 1 standard deviation. In other words, it's likely that 49.998% to 50.002% guessed correctly is just statistical fluctuation, not an issue with the RNG used.
I think you're right.
I changed my seed a few times, and the results jumped around quite a bit, and of course, some would win with one seed, and then loose with the next.
So much for getting rich flipping a fair (http://en.wikipedia.org/wiki/Fair_coin) coin [xx(]
-
You can get rich by flipping a coin if (a) you double the stake every time you lose and (b) you stop as soon as you win. That's the problem with capitalism: the guy with the most money to start with, can go on doubling until the other guy can't afford to play. And the problem with gambling is that the little guy thinks he can win.