The RHP hidden command is a bit of a chocolate teapot. You cannot hide multi line text which contains hard line returns. The only way is to separately hide each line! also you cannot have any apostrophes in the hidden text. Anthem's post failed on the second random trap. (I told Russ about this years ago)
Originally posted by Anthem
A solution:
sonhouse - You do not know what the bias is. If you try to figure it out experimentally (e.g. by flipping the coin a bunch of times), you can only approximate the bias and thus cannot assure that the toss is completely fair.
Originally posted by AnthemWouldn't that depend on just how biased the coin is? Suppose one half of the coin is made of aluminum and the other of lead, could be like it was cut in two across the diameter and one half aluminum and the other half lead and then soldered together or the front face lead halfway through and aluminum on the other half. There would be a large bias that could be easily detected and noticed in a smaller number of flips.
A solution: [hidden] If I am understanding his post correctly, AThousandYoung got the solution that I was thinking of. In more detail: You each flip the coin once. If one person gets heads and the other gets tails the one who got heads wins. Repeat until someone wins. Palynka's solution also works. [/hidden]
sonhouse - You do not know what the bias is. If ...[text shortened]... es), you can only approximate the bias and thus cannot assure that the toss is completely fair.
If instead there was just a small dot of lead on one face and all aluminum elsewhere, the bias would be a lot harder to detect. Then the probability of a coin toss being random gets closer to one. Randomness=1, totally biased=0.
Originally posted by sonhouseAs long as the bias is not such that it is ALWAYS heads or tails then it works and it doesn't depend on anything else. If the bias such such that it is ALWAYS heads or tails then there isn't any possibility to use it as a random number generator.
Wouldn't that depend on just how biased the coin is? Suppose one half of the coin is made of aluminum and the other of lead, could be like it was cut in two across the diameter and one half aluminum and the other half lead and then soldered together or the front face lead halfway through and aluminum on the other half. There would be a large bias that could ...[text shortened]... the probability of a coin toss being random gets closer to one. Randomness=1, totally biased=0.
Originally posted by iamatigerOriginal!
How about:
Flip the coin once, then flip it as many times as you need until it comes up with something different. The number of consecutive identical throws is your score.
Then the other person plays, he wins if he beats your score. Throw again if you are equal.
Also, thanks for the hidden text pointers. I actually messed up the multi-line thing too, but fixed it with an edit.
Originally posted by iamatigerThat could be tedious if it took 300 flips to make a dif. Of course that would come close to the always heads or tails thing. So lets make it 20 flips. Still a chronologic challenge. The other person maybe has to do 30 so time would certainly add up. Of course if you were two prisoners....
How about:
Flip the coin once, then flip it as many times as you need until it comes up with something different. The number of consecutive identical throws is your score.
Then the other person plays, he wins if he beats your score. Throw again if you are equal.
How would you quantify bias? If it flips heads, tails 50/50 there is no bias. But how many flips would it take to figure out a 49/51 bias? 1 part in 50 off from random.
All of the possible methods take ages if the coins are very biased because you hardly ever get the "other" face so it is more and more like using a coin with two heads. A 49/51 coin will be very fast to declare a winner using any method.
As for determining bias, you will never be absolutely sure your coin is biased (you could just be very lucky with your tosses), so how many throws it takes depends on what level of certainty you want that the coin is biased. You will also need to define an unbiased coin (i.e. is a coin that comes up with heads between 49.99% and 50.01% unbiased enough?), as with n trials you are extremely unlikely to get exactly the same number of heads and tails, even with a fair coin.
I agree that iamtiger's solution looks the least economical so far. I'm feeling lazy to do the calculation, but it seems like it would always be worse (require more throws) than ATY's method (if we used the same random number generator sequence, that is).
Still, I think it's interesting that it's a less obvious method that also works.
Originally posted by Anthem
You and your roommate are trying to decide who gets the last piece of pizza. You decide to flip a coin to choose who gets the slice, but the only coin you have is biased (that is, there is a x% chance of the coin coming up heads on each flip where x is between 0 and 100, but is not 50).
How can you use the results of flipping this coin to fairly decide who gets the slice?
Originally posted by JS357Here is a solution I found, and take no credit for. If you are interested.
[hidden]Test of hidden[/hidden]
Way down below because I don't trust hidden.
Originally posted by JS357That way works too, and I agree my way takes most throws.
Here is a solution I found, and take no credit for. If you are interested.
Way down below because I don't trust hidden.
[b][hidden]One player chooses HT the other TH, flip till HT or TH occurs and stop, the person who chooses the one that occurs wins.[/hidden][/b]
Originally posted by iamatigerMy solution would be for each player to flip until he gets "heads" and the person to do it in less flips wins.
That way works too, and I agree my way takes most throws.
This doesn't work very well if the bias is extreme, but it's still perfectly fair. I don't think any solution is ideal if the bias is extreme though.
Originally posted by JS357This is no different than having one player call the first toss while it's in the air, and doesn't work at all if the players know what the bias on the coin is.
Here is a solution I found, and take no credit for. If you are interested.
Way down below because I don't trust hidden.
[b][hidden]One player chooses HT the other TH, flip till HT or TH occurs and stop, the person who chooses the one that occurs wins.[/hidden][/b]
*edit* nevermind, I see what you mean: have each trial be a pair of flips, and throw out trials where the two flips match. I was thinking you meant start tossing the coin until the result changes.