Re NJA Sloane remark about coin tossing mechanism, etc... Arggh. Regard the entire blasted experiment, coin, coin-tosser, actresses, bishops, and all, as a black box which returns a boolean every time you ask it to. I allow you to assume each black box output is identically and independently distributed from every other. OK? So now I want to test whether said box is an "ideal fair coin toss" or not, I want the test to be efficient, and I want it to tell the truth, meaning always with correctness probability >= 1-K (for user-specified K). I can't believe all this jive feedback. 1. It is not a matter of opinion whether black box is an ideal fair coin. No opinion whatever is involved. 2. No physics is involved. No physical assumption re involved. This is a pure computational question. 3. Any statement that "here is some test involving N tosses for some particular N, and here is a way to compute its confidence value" is not an adequate answer. Then saying "oh, and by the way, you could run my test again with a different N" is not an adequate answer. Then saying "oh, and you could do that for some infinite sequence of different choices of N" still is not an adequate answer. 4. No testing for pseudorandom patterns like HTHTHT... is needed. Your test can be based solely on the head and tails counts so far, intentionally forgetting all other information, as you go. Due to the i.i.d. assumption, that forgetting cannot hurt you. 5. If you disagree with any of 1,2,3,4 you are just wrong. -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)