Good coin toss code

ThySpektre

TH.net Regular
Reaction score
10
Hello all.

I need a 50% probability generator.

Right now I am using:

(Random integer number between 1 and 2) Equal to 1

and I am getting a LOT more 1's that 2's

Ideas?

ThySpektre
 
Try random integer between 1 and 100 is less than 50, and are you using test map to try it? make sure to have random seed on if you are (otherwise all your randoms will be...not random)
 
> (Random integer number between 1 and 2) Equal to 1
> and I am getting a LOT more 1's that 2's

Sounds random to me.

In 10 tries, "1111111111" is just as likely as "1212121212"...
 
Even if you try a thousand times getting a random number between 1 and 2 and all you get are 1's, you can't say this isn't random...
Just that you had bad luck (if you need a 2) :D
 
AceHart said:
> (Random integer number between 1 and 2) Equal to 1
> and I am getting a LOT more 1's that 2's

Sounds random to me.

In 10 tries, "1111111111" is just as likely as "1212121212"...
yea it is just as likely as 1212121212 but it is no where near as likely as all the other possiblities you could have. if you want to say what number in what order then they all have the same chances, but if you're talking about total 1s and total 2s then it is no where near the same. your chances of getting all 1s in 10 tries is 0.09765625%
you have 102.4 times more chances of getting anything other than all 1s and ther are only 10 other possiblities. each one is NOT just as likely as getting all 1s
 
LOL, Thanks Grundy.

I have a degree in advanced mathematics and was wondering where the previous replies were coming from LOL...

Acehart and xPheRe I'd like to play some poker with you guys :cool:

ThySpektre

AgentPaper, I'll try your suggestion and I see the same behaviour in test (with the random seed thing unchecked, and in Bnet)

Grundy said:
yea it is just as likely as 1212121212 but it is no where near as likely as all the other possiblities you could have. if you want to say what number in what order then they all have the same chances, but if you're talking about total 1s and total 2s then it is no where near the same. your chances of getting all 1s in 10 tries is 0.9765625%
you have 102.4 times more chances of getting anything other than all 1s and ther are only 10 other possiblities. each one is NOT just as likely as getting all 1s
 
Grundy said:
(...) your chances of getting all 1s in 10 tries is 0.09765625%(...)
LOL! If this isn't bad luck... :D

I was talking about randomness, not about how many 1's and 2's you can count in 10 tries.
1111111111 sounds to me as random as 1211212212, even being less probable.

ThySpektre said:
Acehart and xPheRe I'd like to play some poker with you guys
LOL! Maybe you know now why I don't play poker :D
 
Yes,

So whereas you cannot PROVE 10 1's in a row are not random (you also cannot prove they are) without knowing the algorithms guts, you CAN say with ever increasing PROBABILITY that it is not.

I'm an engineer at heart...<0.1% chance is good enough experimentation for me! :)

If I wax philosophical, I do not believe in ANY randomness in the universe...I simply want a better approximation of it here.

ThySpektre


AceHart said:
Hm...

Random has no history.
Neither is it supposed to meet your expectations.
 
Could it be that since it is a random integer it actually takes a random real number and converts it to an integer? Because I think conversion to an integer just drops the decimal part and doesn't round the number (i.e. 1.99 converted to an integer = 1).
Please correct me if I'm wrong. :D
 
ThySpektre said:
LOL, Thanks Grundy.

I have a degree in advanced mathematics and was wondering where the previous replies were coming from LOL...

how old are you :eek:
 
Im 15 too...
 
Back on topic.

I think there's something in the World Editor preferences relating to random stuff and Test Map. That might be affecting it, or you're just having a lucky (or unlucky, depending) streak.
 
I had tried the flag to unlock the random seed in the WE to no avail.

Changing the code as AgentPaper suggested gave much better "randomness".

ThySpektre
 
> Changing the code as AgentPaper suggested gave much better "randomness".

Two guesses here:

1. You're happy with it. (important)
2. It's much less random than you think it is. (ignore this)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top