• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Moderated Coin Flipper

...
Looking at the bigger picture, jsfisher was right: just to simulate the long-run behavior of coin flips, there was no reason to have used even a cryptographically secure PRNG, much less a TRNG. Furthermore, you have now experienced, first hand, the practical problems of using a TRNG, the reasons they are relatively rarely used in practice.


Thanks to you too for admitting that all those incessant and relentless CONCERNS previously harped upon endlessly and indefatigably were nothing but red herring all along.

Now that everyone has agreed that PRNG is a pretty good RNG then... Thanks y'all for admitting that your CONCERNS were all baseless.

QED!!!
 
Last edited:
No I won't.

I would be randomly removing 20 elements from a random set of elements... the remaining set of elements is still random.





No I did not... because a random set of elements is still a random set of elements when used no matter how many number of time if it is shuffled up every time it is used.





The above is wrong... because it is a SUBSET of random integers obtained from a set of random elements.





Not that red herring again... [imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw]





To nip at the gills all those CONCERNS red herrings that has been admitted to be a red herring all along.





Utterly wrong... randomly selecting from a random set of elements is as random as the set of elements.

Don't be so CONCERNED about the PRNG [imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw] anymore because it has already been admitted to be a red herring.


Well, that went about as well as expected.

Trying to reason with this guy is like trying to reason with Trump.
 
Last edited:
No I won't.

I would be randomly removing 20 elements from a random set of elements... the remaining set of elements is still random.

And since these removed elements were randomly chosen, it will just be a random coincidence that the resulting data set will have an equal number of "heads" and "tails," right?
 
Last edited:
And your PRNG solution works fine, and doesn't have that very tiny tails bias. I'd just go with that. It's clean and works. In my shop that's a win!


EXACTLY... :thumbsup:

So all that incessant CONCERN previously from the "we" was nothing but red herrings.

And when they started using spreadsheets and Bash shells and antiquated Basic... they SUDDENLY did not become SO CONCERNED anymore about PRNGs and now they are just as good or even better than TRNGs.

Concern red herring after another...
  • first not a true dynamics of a coin flip
  • next PRNGs are no good
  • next EDGE CASE ... EDGE CASE.... you are a liar for not doing it EXCALY AS COMMANDED
  • then TRNGs are biased
  • then unbiased TRNGs are not really still TRNGs because...

And now admissions after another that it is all nothing but [imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw][imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw][imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw]


I agree that the business about the edge case is a red herring, and I'm surprised that you've put so much effort into implementing it.

In all seriousness, I think you are focusing too much on the whole "true" random number generator thing. The pseudorandom number generator provided by the standard Javascript implementations is actually very good. Your attempts to introduce atmospheric noise data is problematic and not likely to produce a clean result. On the other hand, the PRNG function is well behaved and robust.

...
Looking at the bigger picture, jsfisher was right: just to simulate the long-run behavior of coin flips, there was no reason to have used even a cryptographically secure PRNG, much less a TRNG. Furthermore, you have now experienced, first hand, the practical problems of using a TRNG, the reasons they are relatively rarely used in practice.
 
I'm not an expert in random numbers, either generating them of validating them. But I don't think you're going to seriously change the randomness from whatever is now by taking out 20 bytes lower than 127.


It has already been admitted that the entire CONCERN harping on and slander hurling was nothing but red herrings all along.

So it is moot anyways, this infinitesimal bias of the TRNG data was just yet another red herring too. [imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw]

But I already added it to the Coin Flipper 4 app and I want to make sure there is no possible CONCERN about it.


But honestly, jt512's suggestion is easy to implement and solves the problem without messing with whatever the degree of randomness currently is.


I was told that a biased set will not result in an unbiased set whatever you do.

The thing is, none of the above has any relevance as to whether the draws are biased. A sequence with a random starting point drawn from a randomly permuted dataset is still biased if that dataset is biased. Your dataset is biased. Therefore, every random sequence you draw form it is biased.


So yet another red herring.

But...

If the file was 16,364 bytes instead of 16,384 bytes of random data obtained from a TRNG... would it be any less random?

No....

If I were to download by chance a file with 8192 bytes <= 127 and 8192 bytes > 127.... would it be any more random than a file of 8182 bytes <=127 and 8182 bytes >127?

No....

If you have a file of 16,384 bytes of atmospheric noise random data which happens to have 20 bytes more <=127 and you remove those 20 bytes.... is the remaining 13,364 byes not still a set of random bytes?

Yes it is....

  • If you have a jar filled with 51 black marbles and 50 white ones...
  • Then blindly withdraw 2 marbles... it is a random outcome... no?
  • If you remove one black marble... so now there are 50 black and 50 white
  • Then blindly withdraw 2 marbles... it is a random outcome... no?

Is the randomness of the 2nd withdrawal any less random than the first one??

Now consider this....
Black is black and white is white...

Does it matter if the marble is slightly less black than black or the white slightly less white than white???

If you delineate a cut off point and say to the right is white and to the left is black and you have 50 to the right and 50 to the left.

Does it matter what the spread of blackness is and what the spread of whiteness is???​


Now consider this....
If the random draw of the marbles in the jar is to represent a coin toss... say a black marble is heads and white is tails... and instead of flipping a coin you use the marbles to be the EQUIVALENT of a coin toss.

Would the toss of a real coin be any less or more random than selecting a marble from a jar of 50 whites and 50 blacks???​


So one binary random process is just as random as another.

So a PRNG or TRNG (with 8192 blacks and 8192 whites) or a TRNG (with 8182 blacks and 8182 whites) are all equally random and equally can be used to represent a coin toss.

No?
 
Last edited:
With that and shuffling you should get away with it.


I would not get away with it... it would be just as valid as if I downloaded a file of 16,364 bytes of 8182 <=127 and 8182 > 127 in the first place.

So it is not getting away with anything... it is a perfectly valid random file of machine acquired atmospheric noise random bytes.

No?
 
  • If you have a jar filled with 51 black marbles and 50 white ones...
  • Then blindly withdraw 2 marbles... it is a random outcome... no?
  • If you remove one black marble... so now there are 50 black and 50 white
  • Then blindly withdraw 2 marbles... it is a random outcome... no?

Is the randomness of the 2nd withdrawal any less random than the first one??
I wouldn't know how to assess the degree of randomness in each case but the probabilities of each outcome are affected.

If I take a jar with 50 white marbles and 50 black marbles and add 1 more black marble to the jar then:
* the probability that the next 2 marbles drawn are both black will increase from 0.24747 to 0.25248
* the probability that the next 2 marbles drawn are both white will decrease from 0.24747 to 0.24247
* the probability of drawing 1 white marble and 1 black marble decreases slightly from 0.50505 to 0.50495.

So one binary random process is just as random as another.
Not necessarily.

Sampling theory is not something I have studied to a great extent but purely random sampling is considered "more random" than stratified or cluster sampling.
 
Last edited:
It has already been admitted that the entire CONCERN harping on and slander hurling was nothing but red herrings all along.

So it is moot anyways, this infinitesimal bias of the TRNG data was just yet another red herring too. [imgw=50]http://www.internationalskeptics.com/forums/imagehosting/5128262c750038bf97.jpg[/imgw]

But I already added it to the Coin Flipper 4 app and I want to make sure there is no possible CONCERN about it.





I was told that a biased set will not result in an unbiased set whatever you do.




So yet another red herring.

But...

If the file was 16,364 bytes instead of 16,384 bytes of random data obtained from a TRNG... would it be any less random?

No....

If I were to download by chance a file with 8192 bytes <= 127 and 8192 bytes > 127.... would it be any more random than a file of 8182 bytes <=127 and 8182 bytes >127?

No....

If you have a file of 16,384 bytes of atmospheric noise random data which happens to have 20 bytes more <=127 and you remove those 20 bytes.... is the remaining 13,364 byes not still a set of random bytes?

Yes it is....

  • If you have a jar filled with 51 black marbles and 50 white ones...
  • Then blindly withdraw 2 marbles... it is a random outcome... no?
  • If you remove one black marble... so now there are 50 black and 50 white
  • Then blindly withdraw 2 marbles... it is a random outcome... no?

Is the randomness of the 2nd withdrawal any less random than the first one??

Now consider this....
Black is black and white is white...

Does it matter if the marble is slightly less black than black or the white slightly less white than white???

If you delineate a cut off point and say to the right is white and to the left is black and you have 50 to the right and 50 to the left.

Does it matter what the spread of blackness is and what the spread of whiteness is???​


Now consider this....
If the random draw of the marbles in the jar is to represent a coin toss... say a black marble is heads and white is tails... and instead of flipping a coin you use the marbles to be the EQUIVALENT of a coin toss.

Would the toss of a real coin be any less or more random than selecting a marble from a jar of 50 whites and 50 blacks???​


So one binary random process is just as random as another.

So a PRNG or TRNG (with 8192 blacks and 8192 whites) or a TRNG (with 8182 blacks and 8182 whites) are all equally random and equally can be used to represent a coin toss.

No?


Blindly, blindly, blindly. If you blindly, ie, randomly, remove a subset from a random set, the remaining set is still random. But you weren't talking about blindly removing values. You were talking about removing values to make the remaining set balanced between "heads" and "tails." That's systematically altering the set. The remaining set would no longer be a random sample. If that's hard to see, imagine that instead of just removing enough "tails" to make the remaining set balanced, you removed all the "tails." Would the remaining set still be a random sample? The difference between systematically removing a few select elements with a particular characteristic and removing all the elements with that characteristic is a matter of degree, not kind.

But it's a moot point. You defeated the purpose of using a TRNG when you hard coded the sequence, making it, instead of the universe from which the TRNG samples, the sample space.

Of course, explaining this to you is like explaining something to Trump. It only makes you dig in your heels. I bother only to put the argument on the record for others to see.

I look forward to your tirade of a response. Please be sure to include the following elements: bolded phrases, huge gifs, highlighting, multiple ellipses, arbitrary capitalization, and at least one form of the word "concern."
 
Last edited:
There is a new version of the TRNG in the Coin Flipper 4 app.

Due to the incessant CONCERNS about the TRUE Random data file having slightly more bytes >127 than those <=127... I now have removed those bytes and the file currently has exactly the same number of totally random bytes that are >127 as there are <=127.

This was clearly a very extremely insignificant gnat that had no effect on the results of the app even when running 500 (or 1000) x 10,000 flips... but nevertheless that gnat is now swatted.

Here are some results which as can be observed are not at all different from when the gnat was still alive.

[IMGW=500]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_00010.png[/IMGW]
[IMGW=500]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_00100.png[/IMGW]
[IMGW=500]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_01000.png[/IMGW]
[IMGW=500]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_10000.png[/IMGW]
[IMGW=500]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_10000B.png[/IMGW]
[IMGW=400]http://godisadeadbeatdad.com/CoinFlipperImages/TRNG_New_10000C.png[/IMGW]​
 
Last edited:
I wouldn't know how to assess the degree of randomness in each case but the probabilities of each outcome are affected.

If I take a jar with 50 white marbles and 50 black marbles and add 1 more black marble to the jar then:
* the probability that the next 2 marbles drawn are both black will increase from 0.24747 to 0.25248
* the probability that the next 2 marbles drawn are both white will decrease from 0.24747 to 0.24247
* the probability of drawing 1 white marble and 1 black marble decreases slightly from 0.50505 to 0.50495.


Of course the probability is now out of 101 not out of 100. But the 50,50 is better than 51,50 as far as being a 50-50 probability.

I agree.



Not necessarily.
Sampling theory is not something I have studied to a great extent but purely random sampling is considered "more random" than stratified or cluster sampling.


The only sampling I care about is on Saturday afternoons at Costco.:p

Yes... of course... but when you have 50 black marbles of all shades of black and call them all black... and the same for 50 whites with all shades of white... it does not matter what the shading is... so long as blacks are 50 and whites are 50.

No??

So when you draw 1 out of 50-B, 50-W jar... you will get a 50% probability of B or W.

If you are worried about clustering as in the marbles are all in one jar clustered together... then just throw the whole jar in the air and catch one in mid air.

Same as the probability of H or T.

So drawing a marble is an ANALOGUE for a coin toss.

And so with an RNG... it is a digital analogue for both the marble and coin.

No??

Anyways... the new TRNG in the Coin Flipper 4 app is working well... See some sample screenshots in the post above this one.... please give it a whirl.:thumbsup:
 
If I am understanding, you are still using a deterministic process.

The numbers in the look up table might have been randomly generated, but from the discussion, you have taken these numbers into a look up table and then use some pseudorandom number generator to pick what number is looked up to determine whether it's heads or tails.

That is still deterministic. If you recorded all the seed values from your cursor position, clock times, and whatever other inputs there were and inputted them, you'd get the same answer. That is not what a random process would give.

Also at best, you will recreate something that looks like the binomial distribution when you do multiple runs, and if you don't then you know that it is a problem with your simulation of a coin flip, and not the statistics, which have been well understood for over three centuries.
 
If I am understanding, you are still using a deterministic process.

The numbers in the look up table might have been randomly generated, but from the discussion, you have taken these numbers into a look up table and then use some pseudorandom number generator to pick what number is looked up to determine whether it's heads or tails.

That is still deterministic. If you recorded all the seed values from your cursor position, clock times, and whatever other inputs there were and inputted them, you'd get the same answer. That is not what a random process would give.

Also at best, you will recreate something that looks like the binomial distribution when you do multiple runs, and if you don't then you know that it is a problem with your simulation of a coin flip, and not the statistics, which have been well understood for over three centuries.


Fingerprints are deterministic... if one could only figure out the genes and lipids and peptides and amino-acids.

Deterministic by whom? Who is going to do the determining?

Not any human... so who?

In all seriousness, I think you are focusing too much on the whole "true" random number generator thing. The pseudorandom number generator provided by the standard Javascript implementations is actually very good. Your attempts to introduce atmospheric noise data is problematic and not likely to produce a clean result. On the other hand, the PRNG function is well behaved and robust.
 
Last edited:
If I am understanding, you are still using a deterministic process.



  • Do you think picking a card from a shuffled deck of cards a deterministic process???
  • The deck of cards does not change between shuffles... just shuffled.
  • Do you think the act of drawing a card from the deck to be deterministic or not?
  • Do you think the resulting card being red or black is deterministic?

If you answer No to even ONE of the above questions then the whole process is indeterministic.

If you answer yes to all of the questions above then who is this determiner who is omniscient enough to do that?

  • Do you think any human can do the determining?

If not... then it is random by definition.

If yes... then who?

Handwaving that if we could calculate whatnot and figure out the whatchamacallit and and and ... is just like saying if only we could locate pixie dust we can show that pixie fairies and Peter Pan are real.
 
Last edited:
The numbers in the look up table might have been randomly generated, but from the discussion, you have taken these numbers into a look up table and then use some pseudorandom number generator to pick what number is looked up to determine whether it's heads or tails.


Let's say that one picks the 20th card from the right side of a shuffled and spread out deck of cards every time.

That is not just deterministic... it is not even random

But the deck is shuffled before one picks the 20th card from the right.

Now the deck is not even random numbers... it is the same deck of cards... no?

Do you think anyone can determine whether a red (diamonds/hearts) or black (clubs/spades) card will be drawn??


So
  • We have the same deck of cards... no random numbers or changing at all.
  • We have the same card position picked every single time... not random or not even unknown... fully determined
  • But the cards deck is shuffled before every pick... from the same deck... from the same position

Is the resulting pick (red or black) random?

Is it deterministic? If you say yes... then by whom or what?
 
Last edited:
If you learn just one thing from this thread, may it please be that the word is libel, not slander.
 
If you learn just one thing from this thread, may it please be that the word is libel, not slander.


On the other hand you have not learned how to apologize for false slander nor false libel... just how to double and quadruple and sextuple down on it.

But... let's see if you can answer these questions


Let's say that one picks the 20th card from the right side of a shuffled and spread out deck of cards every time.

That is not just deterministic... it is not even random

But the deck is shuffled before one picks the 20th card from the right.

Now the deck is not even random numbers... it is the same deck of cards... no?

Do you think anyone can determine whether a red (diamonds/hearts) or black (clubs/spades) card will be drawn??

So
  • We have the same deck of cards... no random numbers or changing at all.
  • We have the same card position picked every single time... not random or not even unknown... fully determined
  • But the cards deck is shuffled before every pick... from the same deck... from the same position

Is the resulting pick (red or black) random?

Is it deterministic? If you say yes... then by whom or what?





.
 
So now you admit all that CONCERN before was just red herrings altogether.
For my part, the "concern" was about you apparently trying to relate pseudorandom output to knowledge about randomness in nature.

Over the course of the discussion, I've come to the conclusion that while that's a real issue, it's not a big enough problem to be worth correcting here. The pseudorandom coin flippers we've been playing around with already demonstrate acbytesla's claim well enough: Over time, they do in fact converge on an average 50/50 distribution, just as we'd expect.

Even with a slight bias in the (pseudo)random seeding of the RNG, or in the data set being used, the principle is still clearly visible to the naked eye over a relatively short series of runs (~1000). All we'd see from a longer series of runs is (eventually) that the convergence is slightly off from the center of that 50/50 split.

I'm sure there are real-world applications where even a very small amount of RNG bias can cause problems, but this thread isn't one of them.

Thanks for admitting that... QED!!!
You seem to be taking this whole thing a lot more personally, and a lot more seriously, than it really deserves. You proved acbytesla's claim right off the bat. The rest has just been us fooling around with the premises and implementations suggested by the OP.
 
Very early in the text, The Art of Programming, Volume 2, the author presents his whiz-bang algorithm for (pseudo-)random number generation. Starting with a standard random number generator approach, it continued with a collection of manipulations to compound the randomness with some steps in the algorithm selected at random just to compound the randomness even further.

Truly this would be a fantastic random number generator with all its random randomness.



...'cept it wasn't. And that really was the point.
 
That's the problem. You would be systematically altering a random set. Therefore, the remaining set would no longer be random. You would, thus, be defeating the purpose of having used a true random number generator in the first place.

But, more importantly, you defeated the purpose of using a TRNG as soon as you hard coded the set into your script for it to be reused. Because, from that point on, you were no longer sampling from a uniform distribution over the integers 0,1,...,255, but from a specific, finite, non-uniform distribution of integers. Moreover, you are using a PRNG to sample from that set. What could possibly have been the point of downloading a set generated by a TRNG, just to sample from it using a PRNG? Since you are using a PRNG anyway, you would have been better off just using the PRNG in the first place to sample from Uniform({0,1}), a distribution which actually has the characteristics of the flip of a fair coin, unlike the set you are currently sampling from.

Looking at the bigger picture, jsfisher was right: just to simulate the long-run behavior of coin flips, there was no reason to have used even a cryptographically secure PRNG, much less a TRNG. Furthermore, you have now experienced, first hand, the practical problems of using a TRNG, the reasons they are relatively rarely used in practice.

The worst part of this is, the byte array he downloaded already proves the point raised in the OP: Divide those bytes by where they fall on the number line relative to 127, and we see that there's an almost perfect 50/50 split. This is exactly the prediction that acbytesla made, and that Leumas is responding to in the OP.

Thus... Q.E.D!
 
....
Also at best, you will recreate something that looks like the binomial distribution when you do multiple runs, and if you don't then you know that it is a problem with your simulation of a coin flip, and not the statistics, which have been well understood for over three centuries.


Yup that is precisely why I made Coin Flipper 4.

What you do not seem to understand is that guessing is not determinism.

Statistics is guessing... not determining.

And now you have at your disposal Coin Flipper 4 to see for yourself.

If I asked you to bet how many Heads will there be out of 10,000,000 coin tosses.

Can you tell me the exact number?

If you cannot then you have determined nothing.

Guessing is not determinism.

Try it out...

How much would you wager on telling before 10,000,000 flips, how many heads will there be in the final tally.

You lose if you are even one integer off.

How many $$$$ would you bet... if I told you that if you get the number exactly right you will get 1000 to 1 payout? But you cannot bet less than $1,000.

Are you willing to take on that wager?

You have your centuries old statistics and all... will you bet $1000 on DETERMINING the EXACT number of heads?

Now... before losing your money... try it out... use Coin Flipper 4 and make a bet with yourself.

Repeat it 10 times and see how much money you lost or earned.
 
Last edited:

Back
Top Bottom