News for hackers. Stuff that matters.
Re:Convert standard Geiger counter to RNG by gus_massa on Monday November 13, 2023 @07:25AM (#38249414)
Have you tested how good the random numbers are?

I think they should be good, if the interval between clicks is much larger than the interval for the counter, but I may be missing something. Also, some source emit two particles and I don't know if there are interesting cascades of decompositions.

If two consecutive clicks are close enought, I expect an uneven distribution on increasing secuances like 13478AC023489BC...

Also, for very high click rates I expect missing double clicks.

Re:Convert standard Geiger counter to RNG by pxx on Monday November 13, 2023 @03:09PM (#38254725)
Edit: removed previous post.

The increment happens as fast as the clock allows, which means any reasonable rate is much more than the cycle time. It delays 250us once it hears a click.

I'm not quite sure why we bother with resetting the counter to 0 when it hears a click though.

Re:Convert standard Geiger counter to RNG by auspiv on Monday November 13, 2023 @03:11PM (#38254752)
The linked previous project does:

https://github.com/gbonacini/nuclear_random_number_generator

"I tested the randomness both testing the bytes and the single bits in the binary file created from the ASCII file from the appliance console ( see Appendix here or test directory for full result text).

Accordingly with ENT man page: "If the percentage is greater than 99% or less than 1%, the sequence is almost certainly not random. If the percentage is between 99% and 95% or between 1% and 5%, the sequence is suspect. Percentages between 90% and 95% and 5% and 10% indicate the sequence is “almost suspect”", so having 85.17 percent in the bytes test and 60.52 percent in the bits test should be fine."

Entropy = 7.998386 bits per byte.

Value Char Occurrences Fraction 0 413451 0.500284 1 412981 0.499716

Total: 826432 1.000000

Entropy = 1.000000 bits per bit.

Re:Convert standard Geiger counter to RNG by nonrandomstring on Monday November 13, 2023 @03:20PM (#38254841)
The source of radiation surely makes a difference.

Directing the sensor at a small point source makes clustering higher than if pointing it up into space [0] and receiving the "planar wave" background radiation of the Universe.

I took a while to figure this out when measuring the audio clicks and crackles from fire. I expect similar statistics to apply on a nuclear level (physicists please correct me). Within small, local sources common effects can be linked to common instigators. In other words events beget events. So a local variation in some variable sets off a bunch of related things [1].

As you sum this over an ever larger number of suitably decoupled sources, the central limit theorem starts to apply and what was bad uniform/even distribution becomes good Gaussian. In practice you need more than the theoretical >12 sources, but once you approach a few hundred uncorrelated sources the bell curve gets pretty good.

[0] probably assume the sky/space is an infinite number of sources all at very large distances.

[1] In the (dangerous) limit imagine a near critical mass of Uranium emitting bursts of chain cascades.

Re:Convert standard Geiger counter to RNG by pxx on Monday November 13, 2023 @03:34PM (#38255026)
No this is all wrong. Fire crackles clearly depend on state. Nuclear decay is memoryless; decays are independent events.

https://en.m.wikipedia.org/wiki/Radioactive_decay#Mathematic...

> theoretical >12 sources

What?

Re:Convert standard Geiger counter to RNG by nonrandomstring on Monday November 13, 2023 @03:50PM (#38255198)
Thanks for the correction on nuclear state. It's hard to imagine anything having absolutely no state - but I guess a nucleus is not a "thing" as such, even if surrounded by lots of similar non-things. Does state not subsist in the total assembled mass in my example of near-critical collection?
Re:Convert standard Geiger counter to RNG by nonrandomstring on Tuesday November 14, 2023 @07:36AM (#38262551)
Just answering myself after some reading today.

No, not really Because fission caused by free neutrons (which are rare) is something different from more common "spontaneous" radio-decay.

That does beg the question; what is the cause that we don't yet understand, what lies behind little bits of the universe falling apart?

Re:Convert standard Geiger counter to RNG by ashleyn on Monday November 13, 2023 @04:24PM (#38255614)
I'm assuming the source is just ordinary background radiation. I'm wondering if, at such low levels, the geiger counter can accurately determine it enough to get a truly random output (as opposed to, some internal squelch on the unit creating predictable patterns). You probably would get far better randomisation ripping out americium from an old smoke detector and putting it by the geiger counter. (Just take note that residue on your hands from handling it may be toxic if ingested.)
Re:Convert standard Geiger counter to RNG by robotguy on Tuesday November 14, 2023 @04:46PM (#38270251)
Much safer to buy Uranium on Amazon. That’s what I did. It really freaks people out when you pull out a small metal can with a RADIOACTIVE sticker on it.

You can also get uranium glass beads and radioactive watch hands on Electronics Goldmine.

Re:Convert standard Geiger counter to RNG by mike_hock on Tuesday November 14, 2023 @04:37AM (#38261058)
How about this?

Preparation: Pick some measurement interval in which you'd expect a bunch of clicks, e.g. a minute. Count how many clicks you get in that interval. Then take 138% of that time and divide it by the number of clicks you counted. That will be the interval for your timer.

RNG: Tune the counter so it rolls over approximately once per time interval you've computed above. We'll take two measurements per interval, b0 and b1. Every time the counter rolls over, reset b0 and b1 to zero. When a click occurs, set b0 to one if the counter is less than half its maximum value, otherwise set b1 to one (if multiple clicks occur, the respective bit just stays at 1). When the counter rolls over, check b0 and b1. If they're equal, do nothing (discard the measurement). If they're different, take b0 as a random bit that you've just created (discard b1, and then reset b0 and b1 for the next round). You can then combine multiple successive bits into random numbers of the width that you want.