(50g) Programme to Produce a Cryptologically Interesting Random Bit
|
07-22-2023, 11:56 PM
Post: #6
|
|||
|
|||
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit
(07-22-2023 09:04 AM)Gerald H Wrote: After some testing the programme in posting #1 has an average value nearer to 0.5 than that of posting #2 - Could some erudite individual venture a reason for different average values? I'm not qualified to answer your specific question as posted, but I am definitely aware that it is easy to introduce bias in PRNGs when applying digit manipulations to the results. I suspect there's a bias resulting from the method used in your second program, though it's not clear to me where it's coming from. Of course you could simply test the RAND value as being > or < 0.5, but that is a rather blunt force method which disregards the "randomness" of the trailing digits to give its result. If you want all of the RAND digits to have some influence in the output, something like this might work: Code: :: I'm not an expert in PRNGs, so I won't guarantee that there's no bias in the above method. In fact, I suspect it's likely that there is some bias due to the checksum always including the same prologue data for each RAND result. That said, the averages for each block of 1 million I tested still seemed reasonable: 0.499529 0.499503 0.500005 0.500317 0.500096 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(50g) Programme to Produce a Cryptologically Interesting Random Bit - Gerald H - 07-15-2023, 03:34 PM
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit - Gerald H - 07-16-2023, 10:37 AM
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit - David Hayden - 07-18-2023, 04:02 PM
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit - DavidM - 07-18-2023, 05:08 PM
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit - Gerald H - 07-22-2023, 09:04 AM
RE: (50g) Programme to Produce a Cryptologically Interesting Random Bit - DavidM - 07-22-2023 11:56 PM
|
User(s) browsing this thread: 1 Guest(s)