Shop OBEX P1 Docs P2 Docs Learn Events
Real Random Number Generator Object - Page 2 — Parallax Forums

Real Random Number Generator Object

2»

Comments

  • IAN STROMEIAN STROME Posts: 49
    edited 2007-10-10 23:31
    Hi All
    Built a hardware Random # gen a while ago,
    Used a P-N junction of a noisy transistor reverse biased, fed into an
    OP-amp ( LM308 ?? ) into a comparator ( LM339 ) its threshold set
    for about 2.4V ( TTL ) into a 16bit shift reg ( 2 x LS164 ) these clocked
    by the system clock ( ~=16Mhz ). Checked it with both distribution plot
    and random walk. Looked pretty good bias wise.

    Best Regards
    Ian

    :- More always means worse.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-05-21 14:38
    The other day I ran into a situation regarding the pseudorandom in the Propeller.· My setup is three independent Propellers with each one running an array of RGB LEDs.· I created a couple algorithms that use the random operator (?) to mix up the action.· when I downloaded the code and cycled powere to the system (reseting all Props at the same time) I was surprised to see the results.· Now that I have done more reading and studying it all makes sense.·

    Using ? the three independent Props generating the same "random" sequence.· I did a quick search on the forums and found the Real Random object. This is exactly what I needed, thank you Chip.

    I posted a video on YouTube showing the results of ? versus the real random object.· I thought it was a colorful showing of the results.

    http://www.youtube.com/watch?v=m78pelGumh8



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2008-12-10 21:36
    Ressurecting a very old thread, sorry.

    Thought I'd point out ISSAC, a fast cryptographic pseudo-random number generator. Yes it's pseudo-random, but the sequences are on the order of 28295 long, which for such a simple algorithm is quite long, and that's only if the seed isn't changed.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-12-10 22:35
    Call me stupid,

    but I thought the hope of building a truly random number generator died and was buried years ago. The eternal problem, as I recall, has to do with the detector threshold circuitry. Even if you are monitoring physical events that are purely quantum mechanical in nature, your detection equipment, which establishes the threshold, is a non-quantum mechanical system, which therefore has harmonics, oscillations, etc. Given enough time, these harmonics will show up in your mass of random numbers. In other words, because of harmonics, etc. in the detector circuitry, the threshold will move up and down as it observes a quantum mechanical system. This movement of the threshold therefore creates a bias in the data, and this, by definition, is not truly random.

    As I understand it, God tried to create a random number generator so he could create the universe and then walk away and let things run in some kind of unbiased way. But after pulling his hair out over this problem for billions of years, he completely went insane, made the world anyway, and... well... here we are.


    eyes.gif
  • LeonLeon Posts: 7,620
    edited 2008-12-10 22:44
    Can you quote a reference for that source of bias, and why it matters?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-12-10 23:19
    Leon,

    I'm not sure if it matters or not. I guess that depends on what you're trying to do with your random numbers.
    As for a reference, consider the history of RAND's Million Random Digits. As I recall, they used some kind of quantum based system (radioactive decay?) only to find that a pattern had developed in the digits. They had to "purify" their results several times. Google it and you'll see lots of references to how impossible it is to get truly random data.

    It's weird when you think about it. We accept that we live in a cosmos that has randomness as its background, but that very same randomness appears to be completely inaccessible.



    smile.gif
  • LeonLeon Posts: 7,620
    edited 2008-12-10 23:27
    I've never seen that mentioned anywhere. Quantum RNGs are widely used, and no-one has shown that the output is non-random, AFAIK.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-11 01:27
    I don't know that the phrases "truly random" or "absolute randomness" mean anything at all, to be quite frank. As a working principle, randomness is an invented term that names a relative property, not an absolute one. What it's relative to is our incomplete knowledge about a system being observed, as described by the observations we subject it to and the statistical tests we apply to those observations.

    If you don't know whether the system producing a sequence of digits is a quantum process, an algortihm, or the decimal expansion of pi, how could you tell the difference in a finite amount of time? If each of those sequences exhibits the same statistical behavior when tested, you can't. So, for practical purposes, relative to your prior knowledge and subsequent observations, it doesn't matter from whence the sequences came: they're all equally "random".

    I firmly believe that "pure randomness" is a concept that will always be one reach beyond our grasp. As such, even the language required to talk about it does not and cannot exist.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-12-11 01:59
    Phil,

    you're probably right.


    cool.gif
  • LeonLeon Posts: 7,620
    edited 2008-12-11 02:57
    Chaitin discusses randomness very well, in a mathematical sense:

    www.cs.auckland.ac.nz/~chaitin/sciamer.html

    Quantum events have to be random, otherwise the universe becomes deterministic, resulting in some nasty paradoxes.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 12/11/2008 3:13:22 AM GMT
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-12-15 06:37
    Leon,

    I found one reference you might find of interest:

    (Link deleted due to my sloppy cut and paste)

    Of course, I'm not saying quantum events are not random (though I'm not sure to what precision that has been tested), I'm just saying that it's hard to keep measuring systems from not injecting bias of some kind into what would otherwise be a perfectly random number generator.


    Frankly, it's a problem that blows my little mind. smhair.gif

    Post Edited (ElectricAye) : 12/15/2008 1:55:21 PM GMT
  • LeonLeon Posts: 7,620
    edited 2008-12-15 12:56
    That link doesn't work.

    It's actually impossible to test for true randomness. One can determine if an RNG is suitable for a given application, though.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 12/15/2008 1:02:30 PM GMT
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-12-15 13:51
    Leon,

    My apologies.
    It seems my cut and pasting methods have become victim of quantum weirdness. Allow me to try again with a new link.


    www.americanscientist.org/issues/pub/randomness-as-a-resource/1

    smile.gif
Sign In or Register to comment.