• 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

It usually helps to read the OP.

I got you Chanakya. The OP is four short paragraphs. Here's the synopsis:

P1. Leumas is inspired to write an app prompted by another poster's musing on probability.

P2. Leumas briefly describes the apps exciting features, mostly consisting of endlessly flipping coins.

P3. Leumas makes confidently incorrect claims about the results that the app would produce.

P4. Leumas talks about historically slow processing speeds on his devices.

Now tell me, what the **** are we supposed to get from that disjointed mess?

But what is your answer to acbytesla's question?

Moreover... do you think randomness is an illusion and there is no randomness that is inherent in the natural world?

See dat? Nothing to do with the OP. Leumas playing the backdoor game.


It is not just the opening post we should note. There is the little matter of what sub-forum Leumas placed this thread, Computers and the Internet.

"Backdoor game", eh? Yeah, that seems to be the case.
 
Here's my "app," "Coin Flipper R," ver. 0.
Code:
sum(rbinom(n=10000, 1, .5))
...
Alas, it runs in the console and not on the web, like Leumas's. On the other hand, it is exactly one line of code, not 200, like Leumas's.

Sorry, Leumas, but all you've done is write 199 lines of literal window dressing to implement a one-line program that does nothing more than illustrate the consequences of an elementary probability theorem that was proved over 300 years ago.


Are you sure it is YOUR app... or even an APP AT ALL?

Look here on this site where "your" "app" that is as you say 1 line of CODE is nothing but a use of an app that is not yours and you have not written a line of it.

It is like using Excel or any other Spreadsheet program or any other of the many EDUCATIONAL applications to help students learn stuff.... which is what this app you are using is.

So it is neither YOUR anything nor is it an app... it is a line of INPUT into an app you are using just like one would use Excel.

So now the question becomes... did you insist and persist on demanding they reveal to you the details of how they programmed their code? And did you verify if they are allowing for the Edge landing??

They are not allowing for an Edge landing are they... and you have no idea what their PRNG is doing... so why do you use an app and claim it is YOUR app and it is one line of code when it is not code but an INPUT INTO AN APP YOU ARE USING?


[IMGW=800]http://GodIsADeadbeatDad.com/CoinFlipper3/images/rbinom.png[/IMGW]​
 
Last edited:
acbytesla's question (the portion you've quoted in your OP) was: "A single coin toss produces an unpredictable result. But we can predict the approximate results of ten thousand coin tosses. Now, is this random?"

Yes, a single coin toss produces an unpredictable result.
And yes, we can predict the approximate result of a large number of tosses.
Also, yes, I guess individual tosses would be random, because QM.


Ok... just one little point... a coin toss is not random because of QM... I explained this in this post... please read it...


Basis my layman's very limited and entirely fallible understanding of QM, no.
To spell it out, no, I don't think randomness is an illusion, and yes, I do think you come across randomness in the natural world.


Good... thanks for the answer.... I agree.


(But no, I don't see this has anything to do with your app.)
(And again, I don't see how this has anything to with your app.


My app is a simulation of randomness... in three versions
  1. Good RPNG
  2. Powerful PRNG which passes all stringent testing for randomness so that no human can DETERMINE its output
  3. TRNG using true random data generated from the inherent randomness of the natural world


I am sorry you cannot fathom how it relates to allowing a HUMAN to do what cannot be done physically without boring and exhausting oneself to death... namely to experiment with randomness of a BINARY RANDOM EVENT.

If you had to do 10M coin tosses it would take you over 3 years of continual coin tossing.

Aah... the wonders and MAGIC of computers that can allow one to do things no human can do.




.
 
Last edited:
I'm afraid that your app won't answer that question.

Even fully deterministic systems can be modeled with random numbers. In fact, this may be the only way to move forward if you don't have all of the necessary measurements to deal with the system otherwise.


You are a STERLING CHAP... my respects and hand extended to you.

You remind me of a Methodist reverend friend of mine. Despite me being an atheist and him being a reverend with his very own church and congregation and despite his extreme theism and my militant atheism we enjoyed many hours of playing chess and dinners and lunches and beers and endless conversations where he was trying to convert me and I was trying to prove to him how much more I know the Buybull and New Tall tales than he does.:D

So... respects and appreciation.... if there were more like you with your integrity and upstanding ethics... this world would be much better.

:th:


ETA: I even let him baptize me in his church in front of his parishioners... and I brought to him a young employee of mine at the time who just had twins and despite this young man and his girlfriend not being Methodists he baptized their children and married them and never asked them to officially become Methodists.
 
Last edited:
Are you sure it is YOUR app... or even an APP AT ALL?

Hint: I put "app" in quotes.

Look here on this site where "your" "app" that is as you say 1 line of CODE is nothing but a use of an app that is not yours and you have not written a line of it.

No, you nitwit. It's the same thing you did except without 199 lines of window dressing. You and I both used a standard library function to draw random numbers.

Adios!
 
Last edited:
Hint: I put "app" in quotes.


But you went on to say that it is one line of code and it runs in the CLI... you never mentioned it is an app YOU ARE USING or give a citation to it or give any hint that it is not some code you wrote as you said it was.


No, you nitwit.


Appreciate it... this is high praise coming from YOU... thanks :thumbsup:



It's the same thing you did except without 199 lines of window dressing. You and I both used a standard library function to draw random numbers.


The fact that you think that, ironically, makes me hark back to this post of yours and the one that it replies to.


...used a standard library function to draw random numbers.


So did you demand they give you their code and command they allow for the Edge case?
 
Last edited:
Hint: I put "app" in quotes....


Here is the guy who wrote the probably much more than 199 lines of REAL CODE of an APP that you used to input into it an input line to get results.

Did you pester him to reveal the code he is using? Did you demand he allow for the Edge case?

Why did you try to say that his app is yours? And why you never gave him or his app credit for your utilization of it?

Why you never cited to his website where you used his app... and not a single mention that you were USING AN APP and not actually CODING one line of code as you claimed?

And then telling me that my app is 199 lines of code compared to your amazing app of 1 line of code?

Do you know how many lines of code there was in the app YOU WERE USING that allowed you the ability to input some text in it so as to use its facility to give random numbers? And why did you say that your input is an app of one line of code?

Ryan Tibshirani said:
I am a Professor jointly appointed in the Departments of Statistics and Machine Learning at Carnegie Mellon University.
 
Last edited:
Here is the guy who wrote the probably much more than 199 lines of REAL CODE of an APP that you used to input into it an input line to get results.

Did you pester him to reveal the code he is using? Did you demand he allow for the Edge case?

Why did you try to say that his app is yours? And why you never gave him or his app credit for your utilization of it?

Why you never cited to his website where you used his app... and not a single mention that you were USING AN APP and not actually CODING one line of code as you claimed?
Edited by zooterkin: 
<SNIP>
Edit for rule 0 and rule 12.


I didn't use anybody's app, and I didn't use anything written by Ryan Tibshirani. I used a standard R function, `rbinom`, just as you used a standard javascript method `crypto.getRandomValues`. Why didn't you credit the authors of that method?
 
Last edited by a moderator:
Edited by zooterkin: 
<SNIP>
Edit for rule 0 and rule 12.
Edited by zooterkin: 
<SNIP>
Edit for rule 0 and rule 12.



I didn't use anybody's app, and I didn't use anything written by Ryan Tibshirani. I used a standard R function, `rbinom`, just as you used a standard javascript method `crypto.getRandomValues`. Why didn't you credit the authors of that method?


What you just typed it on the CLI and presto...? :D

I am starting to think that you did not even type it yourself... but rather had some person do it for you... because very clearly you do not even know how it worked.


...just as you used a standard javascript method `crypto.getRandomValues`. Why didn't you credit the authors of that method?


The above proves that you could not even read my code that you had someone hack for you and give you the listing of.

Because anyone who knows even the slightest about programming knows that what you said is arrantly not true as can be seen by reading and understanding the code that you had someone give you a listing of after hacking it for you.

But hey... don't stop... please do carry on revealing more stuff... thanks:D
 
Last edited by a moderator:
As always, you refuse to answer a simple question, which this time was, why didn't you credit the authors of crypto.getRandomValues? Or, if you prefer, why would you expect me to credit the authors of R's rbinom function when you didn't credit the authors of javaScript's crypto.getRandomValues method (or any of the other javaScript methods you used; after all, they those methods didn't just write themselves? Don't you think their authors deserver credit for their work?
 
Last edited:
...I used a standard R function, `rbinom`,...


What standard?? Which programming language? Which Spreadsheet?

Please can you give a citation?

Or... Could it be from the The R Project for Statistical Computing.

And here is the manual for the App that you used to type a line of input just like someone would type a line in Excel or other Spreadsheets.

1.1 The R environment
R is an integrated suite of software facilities for data manipulation, calculation and graphical
display. Among other things it has
• an effective data handling and storage facility,...
 
Last edited:
As always, you refuse to answer a simple question, which this time was, why didn't you credit the authors of crypto.getRandomValues? Or, if you prefer, why would you expect me to credit the authors of R's rbinom function when you didn't credit the authors of javaScript's crypto.getRandomValues method (or any of the other javaScript methods you used; after all, they those methods didn't just write themselves? Don't you think their authors deserver credit for their work?


Yup the above statement is a very clear example of this post of yours and the one that it replies to.
 
What standard?? Which programming language? Which Spreadsheet?

Please can you give a citation?

Or... Could it be from the The R Project for Statistical Computing.

And here is the manual for the App that you used to type a line of input just like someone would type a line in Excel or other Spreadsheets.

Another evasion. Third attempt: Why did you not credit the authors of the javascript method crypto.getRandomValues? And why, given that you didn't, would you expect me to credit the authors of a standard R function?
 
Enough of this digression. The fact is your app is trivial. Not only does it do nothing more than illustrate a statisitical fact that has been well understood for hundreds of years, it merely implements a rudimentary random number function, which in R (the programming language I know best) requires exactly one line of code.

Your app contributes exactly nothing to our knowledge of anything. And everybody here—including you—knows it.
 
Last edited:
Another evasion. Third attempt: Why did you not credit the authors of the javascript method crypto.getRandomValues? And why, given that you didn't, would you expect me to credit the authors of a standard R function?


Chucks... I was about to say that the above is yet again an example of this post of yours and the one that it replies to.... but I would be wrong since this is the third one.


Enough of this digression. The fact is your app is trivial. Not only does it do nothing more than illustrate a statisitical fact that has been well understood for hundreds of years, it merely implements a rudimentary random number function, which in R (the programming language I know best) requires exactly one line of code.

Your app contributes exactly nothing to our knowledge of anything. And everybody here—including you—knows it.


Wow... so many thanks for that effusive emotional praise... I appreciate the affirmation... QED!!!
 
IDK about version 2 but version 1 doesn't allow for any edge cases. Math.random() returns a double real number with the range 0 < x < 1.

Exactly half of all the possible results will fall within the range 0 < x < 0.5 and the other half within the range 0.5 < x < 1.


Thanks for explaining how V1 is perfectly binary not as people who cannot read or understand code say it is not because they cannot understand how the logic of the code works.

And since you have proven that you are a peer I respect... I will try to explain V2's code to YOU.

In V2 I am using a method from the Javascript programming language's Class/Object called crypto. (line 05).

This method is given an array of a certain length to fill with random numbers according to the length of the array passed to it. And I am specifying it should be SIGNED 32 bit integers (i.e. +/-)

I am limiting the size of the array to 4 for purposes of speed... the larger the array the more time it takes for the method to fill the array. (line 03)

I then sum the array (lines 06-08)...

If the sum ==0 then edge case... but is not tallied
If sum > 0 Heads (line 09)
If sum < 0 Tails (line 10)

And this is one flip of the coin...

The code repeats this for N flips (line 04) and adds up the result of the flip to the previous flips to get the totals for the N flips.

Although the edge case is not tallied... it is still accounted for because the Total of the Hs and Ts for the N flips will be < N by the number of Edge cases.

Code:
01     let resultT = 0;
02     let resultH = 0;
03     const myArray = new Int32Array(4);
04     for (let i = 0; i < count; i++) {
05        crypto.getRandomValues(myArray);
06        const flip = myArray.reduce((a, b) => {
07           return a + b;
08        }, 0);
09        if (flip > 0) resultH++;
10        else if(flip<0) resultT++;
11     }
 
Last edited:
...
In V2 I am using a method from the Javascript programming language's Class/Object called crypto. (line 05).
...
And this is one flip of the coin
...

You are belaboring the obvious. Many of us can read the Javascript just fine and understand what the instructions do. That is not the issue, at least for me. I am interested in the "why" not the "how".

For example, why do you sum 4 values from your pseudorandom number generator rather than just take a single value as is? Does the sum have some superior property that a single value lacks? (Not that it matters for this application, but the individual values from the pseudorandom number generator are uniformly distributed while the sums are not.)

Why did you model the "edge case" as having a probability of something like 1 in 4 billion? That looks like just a wild-ass guess with no basis whatsoever.

What insight do you believe your application provides that wasn't already provided and predicted by simple statistics?
 
And since you have proven that you are a peer I respect... I will try to explain V2's code to YOU.
What I don't like about this method is that the probability of an edge case is not quantified. (Yes I know that it is the probability that the 4 signed integers add up to zero but calculating that probability is not easy).

If it were me, I would decide on an actual probability for an edge case then simulate it first. If the edge case doesn't come up then do the 50/50 calculation. There is no need to use anything other than the PRN for the edge case test since it is such a rare occurrence.
Code:
FOR toss = 1 TO maxTosses
    IF Math.random() < very_small_value THEN
        edgeResults += 1
    ELSE 
        tossResult = trueRandomNumber[0,1];
        IF tossResult = HEADS THEN
            headResults += 1
        ELSE
            tailResults += 1
       ENDIF
    ENDIF
NEXT toss
 
What I don't like about this method is that the probability of an edge case is not quantified. (Yes I know that it is the probability that the 4 signed integers add up to zero but calculating that probability is not easy).

If it were me, I would decide on an actual probability for an edge case then simulate it first. If the edge case doesn't come up then do the 50/50 calculation. There is no need to use anything other than the PRN for the edge case test since it is such a rare occurrence.
Code:
FOR toss = 1 TO maxTosses
    IF Math.random() < very_small_value THEN
        edgeResults += 1
    ELSE 
        tossResult = trueRandomNumber[0,1];
        IF tossResult = HEADS THEN
            headResults += 1
        ELSE
            tailResults += 1
       ENDIF
    ENDIF
NEXT toss


Yes... I agree... and as I said this whole Edge case thing is a RED HERRING in the first place and my fault for falling into the trap of even trying to address the CONCERN.

Now I did notice that the Edge case never came up during my trials (as I said here)... but it is possible which is thus at least accounted for in my excluding the 0 out of the possible integers sum... see my next post for what I did for V3.... I would LOVE your unconcerned educated informed opinion... will post t soon.

Now the problem is you and I can have an educated honest discussion about this because you understand it and are not CONCERNED so much about it because you know as Darat already said that it is not even an issue.

We can also discuss with knowledge how one method is better or worse.

But you do not call me a liar and have not accounted for it just because you do not like the method I used to account for it.

And that is because you understand the code I wrote and can evaluate its accuracy or even logic... but you do not call it NOT THERE and a LIE just because you do not like its logic.
 
What I don't like about this method is that the probability of an edge case is not quantified. (Yes I know that it is the probability that the 4 signed integers add up to zero but calculating that probability is not easy).

If it were me, I would decide on an actual probability for an edge case then simulate it first. If the edge case doesn't come up then do the 50/50 calculation. There is no need to use anything other than the PRN for the edge case test since it is such a rare occurrence.
Code:
FOR toss = 1 TO maxTosses
    IF Math.random() < very_small_value THEN
        edgeResults += 1
    ELSE 
        tossResult = trueRandomNumber[0,1];
        IF tossResult = HEADS THEN
            headResults += 1
        ELSE
            tailResults += 1
       ENDIF
    ENDIF
NEXT toss



When I did V3 having done the test I talk about in this post... I decided to do more research on the edge landing claptrap... and I found that it says that the edge landings apparently have a probability of 1 in 6000 (see here)... which I have a hard time to believe.

But also notice in that article it does say that edge landings are redone... i.e. edge landings absolutely do not need to be accounted for whatsoever.

Anyways... still wanting to carry on experimenting... in version 3, which you inspired and using the TRNs from the website you gave me, I allowed for that 1/6000 thing and I found out that there were WAYYYY TOO MANY occurrences and so I adjusted it.

Guess what... funny enough it is in fact almost what you suggested in your last post.

Now... earlier after I did V3 already... you gave an interesting suggestion (in this post) which I looked at and considered and even tried out... but it ended up giving NO edge cases at all so I examined the raw TRN given by the website and from that concluded that the possibility is indeed nil that this method would occur.

So I kept my original method which is more like the one you did in this post... so evidently educated minds think alike.

Code:
      if (Math.floor(Math.random() * 60000) == 3500 && Math.random() * 6000 == 3000.01) {
         resultE++;
      } else if (randomData[i] > 127) resultH++;
      else resultT++;


So I am using the 1/6000 but multiplying it by the probability of getting exactly 3000.01 which is offset from the middle of the random() spread... this will give very much lower than 1/6000 which alone gives way too many edge cases which I find not credible.
 
Last edited:

Back
Top Bottom