Dice Rolls From The Beginning Of Time

Generating random numbers might seem like a trivial task, that is until the numbers need to be truly random for cryptography or security reasons. When that’s the case, it turns out that these numbers are really “pseudo-random” and follow a predictable pattern. Devices that can produce truly random numbers often do it by sampling random events in the real world rather than relying on a computer to do it directly, like this machine which simulates a dice roll by looking at the cosmic microwave background radiation.

The cosmic microwave background radiation exists in the infrared at the farthest edges of the observable universe as a remnant of the big bang. It’s an excellent source of randomness, but tapping into it poses a bit of a challenge. For this build, [iSax] is using an old Soviet-era Geiger tube to detect the appropriate signal, and a Nixie tube to display the dice roll. After the device detects two particles from the Big Bang, the device measures the amount of time that passed between the detection of both particles and uses this number to calculate the dice roll.

While it takes a little bit longer to roll this dice than a traditional one since it has to wait to detect the right kind of particles, if you really need the randomness it can’t be beat. It certainly works as dice, but we can also see some use for generating truly random numbers for other applications as well. For some other sources of random inspiration be sure to check out our own [Voja Antonic]’s deep dive into truly random number generation.

Continue reading “Dice Rolls From The Beginning Of Time”

Random Numbers From A Smoke Detector

The quest for truly random numbers is something to which scientists and engineers have devoted a lot of time and effort. The trick is to find an unpredictable source of naturally occurring noise that can be sampled, so they have looked towards noisy gas discharge tubes or semiconductor junctions, and radioactive decay. Noisy electrical circuits have appeared in these pages before as random number generators, but we’d be forgiven for thinking that radioactive decay might involve something a little less run-of-the-mill. In fact we all probably have just such a device in our houses, in the form of the ionisation chamber that’s part of most household smoke detectors. [Lukas Koch] has built a project that shows us just how this can be done.

A smoke detector of this type uses a metal shell to house a tiny sample of radioactive americium that emits alpha particles into the space between two electrodes. These ionise the air in that space, and the detectable effect on the space between the two electrodes is increased when ionised gasses from smoke are present. However it can also quite happily detect the ionisation from individual alpha particles, which means that it’s perfect as a source of random noise. A sensitive current amplifier requires significant shielding to avoid the device merely becoming a source of mains hum, and to that end he’s achieved a working breadboard prototype.

This is still a work in progress and though it has as yet no schematic he promises us that it will arrive in due course. It’s a project that’s definitely worth watching, because despite getting more up-close and personal than most of us have with radioactive components, it’s one we’re genuinely interested to see come to fruition.

Of course, we’ve seen smoke detectors in more detail before here at Hackaday.

Bet You Didn’t Know Arduinos Are Psychic

Are you running out of ways to entertain yourself and your family? If you’ve read all the books and watched all the movies, it might be time to explore the psychic abilities of silicon. [Hari Wiguna] has just the trick to keep them guessing for a good long time.

This trick doesn’t take much, just a couple of Arduinos, some momentary buttons, a number pad, and a large helping of math. As you can see in the demo after the break, there is nothing connecting the two, not even 802.11(n). On the randomizer Arduino, [Hari] generates random numbers with the push of a button until the audience sees one they like. Then [Hari] locks in the number with the other button.

What happens next is key: the randomizer generates another random number, but uses it as a hint to set a sentinel digit. The randomizer Arduino subtracts the larger of the two digits in the number from nine and stores the result as the flag. When the next number comes up that has the flag digit in the correct place, the number after that will be the random number chosen at the beginning.

The psychic Arduino’s secret is that it knows the first guess it receives is special. It does the same sentinel digit math as the randomizer, so when the guesser enters the guess with the sentinel digit, it knows the next number entered is the winner. Clear as mud? Check out the second video below where [Hari] explains the trick, a new take on a magic classic.

Looking for a more exciting way to generate random numbers? Try using fish tanks, lava lamps, or muons from outer space.

Continue reading “Bet You Didn’t Know Arduinos Are Psychic”

Flipping A Coin 10,000 Times With A Dedicated Machine

Flipping a coin is often the initial example used to help teach probability and statistics to maths students. Often, there is talk of how, given a fair coin, the probability of landing heads or tails should approach 0.5. Of course, if you want to test this, it pays to have a machine do the hard work for you. [Andrew Consroe] has the rig to do just that.

The build consists largely of 3D printed parts. A large cylindrical shroud is used to keep the coin within the flipping area. A spring-loaded dowel is actuated by a stepper motor spinning a cam, which flips the coin. Once the coin has landed, it is photographed with a webcam. An image processing pipeline then determines whether the coin landed heads or tails. A black spot is used on one side of the coin to aid analysis, as the poor-quality webcam images weren’t good enough to recognise the coin in its standard form. Once the flip has been analysed, a sliding aperture is used to push the coin back towards the flipper for the next cycle.

The machine completes a flip approximately every two seconds, meaning 10,000 flips would take approximately 2.5 days. Unfortunately, due to noise and occasional coin escapes, [Andrew] hasn’t yet been able to achieve his goal. He aims to increase speed significantly before making an all-out attempt.

Coin flips can make for decent random numbers, but if you need better ones, perhaps NIST can help you out. Video after the break.

Continue reading “Flipping A Coin 10,000 Times With A Dedicated Machine”

Finding The Random Seed Of Minecraft’s Title Screen

Minecraft is a game about exploring procedure-generated worlds. Each world is generated from a particular “seed” value, and sharing this seed value allows others to generate the same world in their own game. Recently, the distributed computing project Minecraft@Home set about trying to find the seed value of the world shown in the Minecraft title screen, and have succeeded in their goal.

The amount of work required to complete this task should not be underestimated. 137 users contributed 181 hosts with 231 GPUs to the effort, finding a solution in under 24 hours. The list of contributors to the project is a long one. It appears the method to find the seed involved comparing screenshots from various seed worlds to the original image. This took a lot of reverse engineering in order to calculate the camera FOV and other settings of the original capture, such that the results could be compared accurately. Interestingly, the group found two seeds that can generate the requisite world, suggesting the world generator code has some collisions between seed values.

We’re not sure what’s more astounding, the amount of work that went into the project, or that there’s a distributed computing project tackling advanced Minecraft research. Either way, we’re no strangers to Minecraft hacks around these parts. Video after the break. Continue reading “Finding The Random Seed Of Minecraft’s Title Screen”

A 4-bit Random Number Generator

Randomness is a pursuit in a similar vein to metrology or time and frequency, in that inordinate quantities of effort can be expended in pursuit of its purest form. The Holy Grail is a source of completely unpredictable randomness, and the search for entropy so pure has taken experimenters into the sampling of lava lamps, noise sources, unpredictable timings of user actions in computer systems, and even into sampling radioactive decay. It’s a field that need not be expensive or difficult to work in, as [Henk Mulder] shows us with his 4-bit analogue random number generator.

One of the simplest circuits for generating random analogue noise involves a reverse biased diode in either Zener or avalanche breakdown, and it is a variation on this that he’s using. A reverse biased emitter junction of a transistor produces noise which is amplified by another transistor and then converted to a digital on-off stream of ones and zeroes by a third. Instead of a shift register to create his four bits he’s using four identical circuits, with no clock their outputs randomly change state at will.

A large part of his post is an examination of randomness and what makes a random source. He finds this source to be flawed because it has a bias towards logic one in its output, but we wonder whether the culprit might be the two-transistor circuit and its biasing rather than the noise itself. It also produces a sampling frequency of about 100 kbps, which is a little slow when sampling with he Teensy he’s using.

An understanding of random number generation is both a fascinating and important skill to have. We’ve featured so many RNGs over the years, here’s one powered by memes, and another by a fish tank.

Random Numbers From Outer Space

Need a random number? Sure, you could just roll a die, but if you do, you might invite laughter from nearby quantum enthusiasts. If it’s truly, unpredictably random numbers you need, look no farther than the background radiation constantly bombarding us from the safety of its celestial hideout.

In a rare but much appreciated break from the Nixie tube norm of clock making, [Alpha-Phoenix] has designed a muon-powered random number generator around that warm, vintage glow. Muons are subatomic particles that are like electrons, but much heavier, and are created when pions enter the atmosphere and undergo radioactive decay. The Geiger-Müller tube, mainstay of Geiger counters the world over, detects these incoming muons and uses them to generate the number.

Inside the box, a 555 in astable mode drives a decade counter, which outputs the numbers 0-9 sequentially on the Nixie via beefy transistors. While the G-M tube waits for muons, the numbers just cycle through repeatedly, looking pretty. When a muon hits the tube, a second 555 tells the decade counter to stop immediately. Bingo, you have your random number! The only trouble we can see with this method is that if you need a number right away, you might have to go get a banana and wave it near the G-M tube.

Whether this all makes sense or not, you should check out [Alpha-Phoenix]’s project video, which is as entertaining as it is informative. He’s planning a follow-up video focused on the randomness of the G-M tube, so look out for that.

Looking for a cheaper way to catch your random numbers? You can do it with a fish tank, some air pumps, and a sprinkle of OpenCV.

Continue reading “Random Numbers From Outer Space”