Brought to you by Toyota. Let's go places. Welcome to Forward Thinking, heys and welcome to Forward Thinking, the podcast that looks at the future and says zero zero zero zero zero zero one zero zero zero zero zero zero one one. I'm Jonathan Strickland and I'm Joe McCormick, and today I thought we should talk about something really random, well not that random, because we were asked to talk
about it. Actually it's fairly predictable. But a sort of random request came in a user, not a user listener. We're not some piece of software, not yet, kind of like one you aren't, Okay, No, our listener, Sean wrote into us via email and asked us, how about something on random number generators r n G S or pseudo random number generators p r n G S or p png G p r G S and the likes and what better sources of entropy might be tomorrow. I thought this was a great topic because random numbers are a
fascinating subject that does not get enough love. Yeah, it actually ends up being a philosophical discussion, going to the point where you're you're starting to question the very meaning of the universe, and it sounds like I'm being flippant, but that is totally true, right, It goes sort of to the very nature, the base nature of what reality is. Yeah. So when you get to that, you know, it's saying, like, wo how can we make a true random number generator?
Things get a little little whibbli wobbly and timey. Whymy Yeah? So what would it mean for a number to actually be random? Hold on? Hold on? I've got some some elementary school knowledge to drawn because when I was in fifth grade, my classmates I would do something and then one of the girls in my class would say, Joe, you're so random. So clearly that was it, right you? You drew upon an infinitely large list of potential behaviors and picked one with no predetermination of which one that
would be, and that's what you went with. Well, I don't know. I think we can spend the rest of this podcast going back and forth about whether or not my fifth grade classmates were using the word random correctly. But random doesn't mean weird, and random doesn't mean what what would it be? You know? Like bad or pointless? That's the thing people often say random to mean pointless. Sure, although it does mean unpredictable, and they could have been
talking about the fact that you were behaving unpredictably. You know. That's another thing, though, If somebody is consistently weird, they're not really unpredictable. You can predict what they're going to be, which is weird. Well, what depends on what kind of weird they're being. I mean, if you're being like Tim Burton weird, that all you can predict is that they
will be weird. You cannot necessarily predict each individual weird action that person takes, so the general behavior might be predictable in the sense that this is generally a series of unpredictable events. My head hurts. Okay, okay, let's get back to numbers so we can do this topic. Right. So what would it mean for a number a number
to truly be random? Well, for talking with computers, this simplifies things in a huge way because computers understand two numbers zero and one, right, that's a bit okay, So which one's random is zero? Okay, you're not exactly all right? Have you ever watched an American football game, Joe, I
believe I've heard of this. Yeah, at the beginning of an American football game, the referee will toss a coin into the air and allow one side to pick either heads or tails, which will then allow that side to determine whether they will kick off or receive the football. Should there called sign land face up. If it's, of course, the other one, then the other team gets to make that choice. But the determination is random. It's determined by an act of chance the the side of the coin
that ends up facing up right. Right. So the thing about this is maybe if we flipped a coin ten million times, we might find out that a coin flip is not actually random. Well, you would have to flip the coin a huge number of times and start to look at it and say how far does this deviate from and does that in fact suggest that there's something strange about the coin that is causing it to come
up on one side more frequently than the other. Right, But it's at least random enough, right, It's unpredictable that somebody couldn't bank on heads or tails and come out right most of the time. Right. So a true random bit generator which would only be able to generate a zero or a one, would do so, uh, and you would be unable to have a greater than fifties probability of predicting whatever the next bit generated was going to be.
So in other words, no matter how many bits have been generated in the past, even if you knew every single one of those, like you had a record, you have maybe a binder filled with zeros and ones that tell you every single bit this thing is generated in the past, you would not be able to use that information to guess what the next bit would be because every single time it generates something would be independent and unpredictable.
All right, So let's if you do have a true random bit generator, then you are able to create these bits without being able to determine ahead of time which one it's going to be. It's unpredictable, it's truly random. So computers are not very good at that. But we'll get into that. But let's say that you harvest a series of bits from a random source, all right. Now, some of those bits may actually be guessable because they
might be dependent upon other bits. So if you, for example, have a zero or a one, and you could not predict whether that was going to be a zero or a one, but an adjacent bit if you know if the first bit of zero, it's always also going to be a zero. Like if you know that, then suddenly you have a little less randomness in that number because
it's dependent upon the value of an earlier bit. So the if you add up all the ones that are truly unguessable the bits within that numeral that you have, and you add up all the ones that are truly impossible to predict, that ends up being entropy. That's what we call entropy in this instance. Entropy in general means something else in physics, but in this case, that's what
entropy is referring to. It sort of makes sense. The use of that term entropy is in a closed system, when everything tends towards chaos, Yeah, things break down, order breaks down, and and chaos is a form of predictability definitely. Sure. Yeah, like physics heat right, Yeah, at least chaos and at any rate, chaos ends up being complexity, which for humans tends to go towards unpredictability, although technically complexity and unpredictability
are two separate things. If you have a computer system complex enough and powerful enough that that complexity within a chaolic system could potentially be predictable. But we'll get into that too. Well, that is what we need to talk about now, because I'm sure y'all have all used a computer program at some point a few times that gives you that gives you some kind of outcome that's based on a random number what should be considered a random number.
But most of the time when you've done that, I bet that it has not been a true random number, but what we would call a pseudo random number. So it's random enough, it's ran him enough that it generally works for things that are low stakes, it can fill in. Let's say you're playing a computer game and it's something that calls for some random element to be like the dice roll for hit points on a on an RPG
game or something. It can do that fine, But when you think about it, how could it actually be truly random? Because computers are deterministic machines. Every event in the computer unless there's some kind of like physical error that's introduced by the outside, unless there's some kind of error that's caused by I don't know, quantum tunneling or something like that, just some mechanical or electrical failure, But everything that happens
as it should is deterministic. It's controlled by instructions based on what has come before, right, specific instructions that people have written that it's just following. So how would you tell a computer come up with a random number? If if you're a computer, the way you answer that is, okay, what random number should I use? Yeah? So essentially what you have to do is you have to build in
some form of algorithm that's a set of instructions. Algorithm is essentially just a fancy word for saying instructions, And those instructions would be to take some form of input, uh, normally, apply some series of calculations to that input, and then the output is your random number. Right, so your input should be at least somewhat changeable, something you know, beyond just the string of four digits. That clearly wouldn't work
because it would always the outcome would always be the same. Right, So you might sample something like the time. Yeah, the time of day in fact, is a very common one for simple random number generation or pseudo random number generation. So that you send in a command, it takes note of the time stamp like the date and time, exact time that you said, do this thing, converts that into the seed that's the number that will be fed through the algorithm or formula, and then you get the output,
the actual quote unquote random number, which is not truly random. Again, it's dependent upon the time that you sent the command and whatever that series of steps happen to be. And it might be that that's a lot of steps, it might be very simple. It might be multiply uh, the seed by this number and then subtract this other number from it, and whatever is left that is your random number.
But it's important to remember that the pseudo random tree always does grow from the seed, so it's entirely dependent on what the seed is. Yes, and if the seed is not random, then the final output can't in a mathematical sense, be said to be truly random. Well, yeah, and we often in discussions of random number generators you will often see the term attacker because a lot of random number generation centers around security and cryptography and incredi
option and it's very important in those fields. And in those fields you might have a potential attacker, someone who is looking to to to exploit a vulnerability or infiltrate a system in some way, and so the the robustness of your random number generator is very important because if it's not robust, if you can start to see a pattern or you're able to predict what that next number is, then your security is compromised. Right, someone could actually end
up posing as a valid user and uh compromise the system. Sure, we can talk more about the purposes and uses of random numbers in a minute, but finish making the distinction between random numbers and pseudo random numbers. Yeah, so a true random number has to be unpredictable, which, again, computer is not good at doing that because they have to
follow some sort of set of instructions. So true random number generators tend to be such a thing as possible by the way, Right, we'll get to the philosophy again later, But true random numbers tend to be based on hardware approaches. So a very simple true random number generator would be a good classic one would be dice, Right, because all things being equal, assuming there's nothing wrong with the dice, any roll of the dice is just as likely to bring up one side versus any of the other sides,
So it is a random event. You cannot predict which number is going to come up next. Right, Even even if you were to roll a die thirty times in a row, you wouldn't be able to predict what the thirty first role would give you, unless again, something was
wrong with the dice. Sure, I mean, you know we're kind of talking about and all of this comes back to the problem of of we're talking hypotheticals and a perfect universe where the table is perfect and the dice are perfect, and the person throwing the dice is perfect, and none of this is influencing the outcome, which of
course it does. Yeah, I wouldn't be surprised if you ran an experiment, or if you could, if you ran an experiment where you had somebody roll a die ten billion times, I suspect you would find that some sides of that die are actually more likely to come out on top than others. Again, it all depends upon the construction of the die, right, because if the die is truly los as close to perfect as possible, then you
shouldn't have any any bias there. But so another thing you need to remember is a good pseudo random number generator, it will not have a repetitive cycle, although they all do. It's just the cycles tend to be very, very very long. So that uh two we mirror mortals, it appears like it never repeats. Um, they should have really good numeric distribution, which means it shouldn't favor any one number over any
other number. You should have an equal distribution amongst them. Uh. And it shouldn't be predictable, obviously, because if it is, that it's not really useful. True random number generators are slow and inefficient, so that's why we don't tend to use them for really complex tasks, especially tasks where you have to generate a lot of random numbers in a
short amount of time. Uh So the advantage though, is that they're nondeterministic and they're a periodic, so they don't repeat, and there's nothing that you can you know, you can't you can't predict the outcome because they're nondeterministic. Pseudo random numbers are deterministic and periodic, but they are also way more efficient, so it's easier to generate a lot of
them in a short amount of time. And if you make a strong enough, a robust enough system, despite the fact that they're deterministic and periodic, they can still be largely unpredictable. Right there. Uh, they're so big. Basically, there's so much brain power involved in predicting them that they
can be effectively thought of as random. Right. The goal is that you have to make it complex enough where a brute force attack, which is where you would just start going with, every potential answer for the problem could be, you know, used one at a time. Right, you do that thing where you throw ten million or ten billions exactly if you can make that random, that pseudo random number large enough so that the effort it would take to successfully get a brute force attack to work is
greater than what most people have at their disposal. Your system is generally thought of to be pretty safe. So, in other words, let's say that it's the Hollywood version of hacking where you use a joystick. None. None of those systems are very safe. Yeah, it's your first you've got to get some eyeliner, or or your password is five letters long, it's all upper case and it's just sword or something like that, and that's that gets you into the system. Uh yeah, that would those those security
systems would fail dramatically compared to what we're talking about here. Okay, so we have computers that work as pseudo random number generators. They're they're random enough even if they're not true random. Then we have some other ways of maybe creating something that might be thought of as truly random. We can debate and talk about those later, But first, why do we need random numbers? Like, what's the point other than you know, if we've got pseudo random number generators that
are good enough. I mean, why do we actually have to come close as possible to true randomness. Well, if you want to play a chaotic neutral character in Dungeons and Dragons, you want to get as close to truly random as possible because that's what that's what dictates their hearts. UH. To be more serious, you would want random numbers, really good random numbers, for lots of different purposes. One is
UH sampling, So sampling populations. Now this can mean anything, not just sampling populations of people, but for all sorts of types of of of scientific inquiry. But one real life example I can point to is imagine that you are at t S a secure pity agent, and your job is to stop a random stop random people for screening at the airport, and you're not supposed to act on any bias. Right, You're not supposed to stop people because of the way they look or anything along those lines.
What your what your directive is, you're stopping a random person, and if you truly wanted to be random, you would need to have this kind of generator that would tell you the seventh person to go through this. This line is the one you stop the next time it says the second person, next time it says the forty seventh person, and you would just follow that instead of acting upon your own quote unquote, Oh, I'm going to stop this person because now it's time for me to do another
random search. Something that goes along with sampling, though, is actually something that might be useful in science, which is simulation. Yeah, I mean in simulating trials and real world events. If you're going to try to run an experiment on your computer instead of in real life, it's very important to be able to have random inputs. Sure, even if you
are incorporating a human into the testing. So let's say it's a simulation where you are simulating it's like a test pilot simulating a simulated flight where you're simulating weather
patterns as well. Clearly you want those weather patterns to be as random, but still, you know, still akin to actual weather, realistic right, because otherwise what could happen is the test pilot goes through the system, perhaps things go poorly and the test pilot ends up crashing the simulated plane, and then the test pilot is told to go through it again after some adjustments have been made. But now
the test pilot knows that pattern. So if the pattern was exactly the same, you wouldn't be sure that whatever changes you made were actually the things that affected the outcome of the simulation. You need that randomness so that
you can ensure that the thing you are actually testing matter. Yeah, you don't want the pilot to be able to just like memorize, like like she's playing Battle Toads or something where you know, yeah, here's where the crossmen come three times and then down, yeah, and then it's the goomba and then right as a that's a heck of a mixed of video game. I mean, it would make Battletoads a lot easier. Honestly, goombas were the enemies, but the uh,
you know another example. And you know, it sounds like I'm being kind of trivial with these, but these are really true. Gambling is important. It sounds trivial now if you're a gambler. I'm sure it's not trivial at all, because you you definitely you're counting on the fact that the numbers that are coming out of the system are truly random. If there is a bias somehow, I suspect if there were a bias, it would be a bias toward the house. I can't say for sure, but yeah,
who knows, well it matters. Very cynical, Joe. But let's say it's a game of craps. Now, with craps, there are a lot of different ways to bet, So your bet is what is gonna matter, not not whether or not certain numbers come up more frequently frequently than others.
Because if you know notice that certain numbers are coming up more frequently than others, you can place your bets toward that to try and win, which would give the incident to the house to change out those dice immediately, because otherwise they're going to start losing money if people pick up on that. So it depending upon the game. It can really be in the house's interest to make sure that this game is working exactly the way it's supposed to and things like have a house advantage. Sure, yeah,
things like slot machines. I did a full episode on slot machines for tech Stuff where we talked about the various elements that introduce kind of, uh, the randomness in slot machines to make them attractive to people who want to gamble. And in fact, over the lifetime of a slot machine, most slot machines, and they guess pay out somewhere between ninety and nine of all the money that go into over the lifetime of the machine. On a
day to day basis, that is not the case. So you've got to keep in mind this is a long game you're talking about. But but randomness is important in that in that realm too. It's not like there's a series of mechanical gears in that slot machine that get that tells you whether or not you're going to win. It's actually more based upon the moment that you hit the button or pull the lever to initiate it. It's more of that time stamp approach we talked about earlier
in the podcast. But of course, another big use and the main one we alluded to earlier, is cryptography in keeping things secret and keeping them safe. Yeah, pretty much nice? Is it secret? Is it safe? The yeah, this is a big one. So this can be for anything, right, not just not just the super secure stuff you want
like banking or or purchases. But anytime you log into any kind of web service where you're you're actually you know, you're logging in as yourself, you are assigned a unique I D for the duration of your visit to that website. It's how the server knows that this is you, even if you are navigating around the various site to the various pages within it. If you're logged in and knows, oh, well, this is Jonathan, or this is Lauren, or this is Joe, and it doesn't mix us up because we each have
a unique identifier. Now, if whatever they're using to generate those unique identifiers is in fact predictable, it could allow an attacker to come in and if they have enough information, be able to guess at the unique ID of any one of the three of us and pose as us, which could be disastrous in the case of something like a bank account where they suddenly have access to all of our online banking stuff, that could be a huge problem. So you need to have a really robust system for
generating random numbers to create these unique ideas. Now that's just one example. It is all over the place in cryptography. So all all of these are important reasons for us to have random numbers or pseudo random numbers at the very least. But how how have we dealt with actually creating these in in the past and right now? Well, if we want to look at the past, I think we've already been talking about one of the big ones,
which is dice, dice, the roulette wheel, all kinds. They're basic analog mechanical methods for generating things that are pretty close to random. You know, they're they're probably not actually random.
Like I said, I bet if you designed a machine to throw a die, you know, a hundred billion times or whatever, you would eventually determine there's some kind of slight bias based on how the dye is made, or how the machines throwing it, or even the surface upon which the die is hitting, because if you changed out the surface that would likely change the results. Yeah, all that, but generally things like these have been random enough for
people they worked pretty good. Another thing that I wanted to think about was humans are brains generating random numbers consciously? Like I can say Lauren, what's a random number, Jonathan, random number pie? That strikes me as not especially random, But I like that. That's that's somehow less random than forty six. It's far less random than I don't get it, because hey, it was just pie d A three fourteen like three days ago that put the seed in your mind.
If I was a hacker you were using, I would have guessed pie. I thought it is because I had pie for dessert today at lunch. That's why I think you had Mexican food for lunch, followed it up with pie. That's how I celebrate St. Patrick's days, Mexican food followed by pie. I admire your life. Okay, So the question is can humans consciously general right random numbers with any kind of success at all? I mean, when I just asked you all, I'm sure there was a somewhat predictable
reason you said the number you did. Oh yeah, I think I actually picked forty six because I believe earlier you said and so that number was kind of in my head. But I didn't want to say that number because obviously that wouldn't be random. Yeah. So I've always heard the answer to this question is no, humans cannot generate random numbers with even distribution. So I looked it up just to make sure. I've seen actually some competing opinions about this pop up in the scientific literature. Uh,
though strong caveat. Some of the recent papers I saw were published in the journal Medical Hypotheses, which is for much of its history in the time when these papers were published really more of a sort of playground for strange ideas than a place to publish rigorously conducted research, and like it was not pure reviews recently, right, but anyway, So with that very very strong caveat, at least one pay were published in Medical Hypotheses in two thousand and five.
The author claimed that humans could consciously generate random number sequences with success. A quote from the abstract is the results suggest that humans can generate random numbers that are uniformly distributed, independent of one another, and unpredictable. I was a little skeptical of that, and actually there have been subsequent papers at least two I found in the same journal that claimed they tried to reproduce the original results and could not and found that that the results were
substantially non random. It's the same kind of problem that I think has always been reported with humans trying to generate strings of random numbers, which is that they do things like repeat the same number twice in a row too often, or they they do too little of repeating the same number spaced out, and things like that. Actually, there was a funny story I think Jonathan was mentioning it earlier about John von Neuman. Yeah, yeah, no, Eman
came up. Von Neuman came up with a or at least utilized a method that, uh, you know, if you were to just see a string of numbers, you would potentially be able to figure out what was going on if you were very, very observant. He used the middle square method. Here's how it works. You start with a number, usually, you know, like a four digit number. That's your seed, and you square that number. So then you're going to take the middle four digits of that number. You will
actually get an eight digit number total. So you dropped the first two and you dropped the last two digits in the middle four. That becomes your new random number. When you need another random number, you square those four digits and you do the same thing. You do it
over and over. But once you know this is going on, you can start to work backwards and figure out what what the methodology is, and only that you can predict what the next number is because you already have the seed, right, you know, this random number is actually the seed for the next random number, and I know the methodology used to generate the random number. Therefore I can already predict what the next one in that sequence is going to be. So the example I chose, and this was as random
as I could think of. So it's not so not random at all, probably not probably not the You know, we we need to get into an episode where we really talk about the concept of free will and how how much of our actions are actually determined by external sources and other processes that we're not familiar with. So I fully admit all of those are at play. We'll save that for another day. Tell us about numbers I picked.
So I picked the number five nine seven four, I squared it, took the middle four numbers that those middle four numbers were six eight eight six, I squared it. I took the middle four numbers that was four one six nine. So this was the same process. And if I, if you knew that that's what I was doing, then you would just take four, one, six, nine square. It take those middle four numbers and you would have my next quote unquote random number. So not very useful, not
secure at all. You know. I love stories about John von Neumann because they're all about how he would do stuff like that in his head and and scare people sort of too smart for Earth in a kind of creepy way. I also found a great quote from him on the internet today where he said, anyone who considers arithmetical methods of producing random digits is of course in a state of sin. For as has been pointed out several times, there is no such thing as a random number.
There were only methods to produce random numbers, and the strict arithmetic procedure, of course, is not such a method. So I think the point he makes is not that pseudo random numbers produced by algorithms are useless, just the folly of thinking they're truly random. Just a random is the incorrect term. Sure, right, but we've actually got a lot of ways today of producing what some would argue actually are true random numbers, and then other people would say, no,
they're not. Actually Yeah, yeah, we can argue about it, but what are the truest of the true random numbers, so we can come up with Now, I'm going to give an overview of this one, because honestly, the more I looked into it to try and be able to to explain in a simple way what was going on, the more I realized I was not understanding it. So,
uh that caveat out there. Uh. Makoto Matsumoto and Takuji Nishimura developed the Mersin Twister method of generating pseudo random numbers, which is based off the mathematical concept of the Mercin prime, named after Marin Mersen. Okay, So, what is a Meyerson prime number? That's a prime number that is one less than a power of two. So two to the power of two or two squared minus one is three. That's
a prime number. That would be a Messson prime. But obviously you wouldn't want to use a number that small for your period of your prime number generation. That would be the essentially the the the entire span of numbers that you could use before having to repeat, and the smaller that is, the more easily it is broken. Right, So you want a big one, boy, how do they go with a big one? Uh? So for their thirty
two bit word length version. Uh there is a sixty four bit as well, but for the thirty two bit version, they went too to the power of nineteen thousand seven and then you subtract one from that number. Yeah, it's a big number. Uh So the algorithm itself for generating the random number, I mean, this is the period. That's not the random number, obviously, because that's just a number. Uh the algorithm was way too complex for me to unders stand it, so there's no way I can describe it.
I'm sure there's some mathematicians out there who are rolling their eyes, perhaps audibly at this point at my ignorance. But keep in mind I was a liberal arts major, and in his grave I doubt it not, nor do I blame him. Probably yes, in a random fashion. Uh So, the thing is that this is a really complex system. It does generate pseudo random numbers, it does not necessarily pass all the tests of randomness. However, it is really popular.
It's used by a lot of web servers, for example, in its method of producing random numbers or pseudo random numbers. I should say, what about your standard cryptographic hash? Alright, so, uh, did did you actually know what a cryptographic hash? Was. I had to look it up because I always forget. But a cryptographic hash, it's one of those things that I know in a very loose way. Yeah, I know. When I read it on a page, I'm like, okay, and then you're so you're like, explain it to me.
I'm like, uh, that's kind of that's how I am to stuff with cryptography and potatoes exactly. Yeah, it's all fried up in a pan and it's delicious. Uh yeah, unfortunately that is that's not entirely correct, but it is incredibly tasty. Uh yeah. So a hash and I have to remind myself of this all the time too, and I talk about it a lot, so I feel guilty about this. But hash is essentially a uh, fixed length
alpha numeric message that is apparently random. So alpha numerica means that there's both um, you know, uh, letters and numbers represented in the hash. Uh. And it's a fixed length, meaning that no matter what the input is, you're going to get the same length of message on the output. So if it's a single word, you're going to get you know, let's say, let's say it's fifty characters long your hash, you'll get a fifty character long hash representing
that single word, and it's going through a process. The hash itself is the guarded process series of of instructions that computer will uh execute upon input so that you get this output. Let's say that you do a sentence, not just a little word, and you plug it in. You're going to get a fifty character long hash. It doesn't matter what the input is. The output is always going to be a fifty character hash. Now it's gonna be unique to whatever your input is going to be.
And hashes can be significantly longer than fifty characters. I just drew that number out of the air to kind of give an example. But the idea being that there's no way for you to determine what the input was based upon the output because it doesn't give you any hint as to the nature of that input. Right right, part of the hash isn't like ps, the original message was seventy eight characters long, right exactly. Okay, yeah, y'all are not satisfying me. Pause. These things we're talking about
are still based their out rhythmic. Yeah. So what we really need to focus on, I think, is ways of getting a seed or a period or you know, drawing that initial number that really are random. I mean again, we're here, we're sort of like churning complexity with complexity until we get something that's really hard to an that's hard to untie. But what we want is a knot that starts untiable. Okay, you know, Like, so how about
if we went for Schrodinger's random number. Yes, this is actually my very favorite method of determining of spitting out a random number, and it's based on the principle that when when radioactive stuff decays, it decays at a completely unpredictable rate. That's true, that that that point at which it flips is you can't I mean, you can make a pretty good guess it when, but the actual point
predict you cannot predict. So if you set up a Geiger counter, uh, and then set up a computer to you know, uh, record when that actual flip happens, you've got a random number. Yeah. Yeah, essentially, And a lot of random number generator systems use a combination of true random number generators and pseudo random number generators. So the true random number ends up becoming the seed, and then it goes through the process of the pseudo random number generator.
Until you get your quote unquote random number. But by making that seed truly random, you can't predict what the next one is going to be, right because of the nature randomness, and radioactive decay is a great way of doing that, because, like you were saying, Lauren, you can't predict when that moment happens, when that radioactive particle decays, and so as long as you have a good detector and you have a way of feeding that information into
the computer, you're set. My question would be how often is this used in real life? Like how many systems do people have set up with I don't know what would they have, like a piece of uranium and a Geiger counter. That's just saying like, if there's a click, it's a one. If there's no click, it's a zero. Look, you might be able to buy plutonium at seven eleven. But um so it's not obviously not common, but there are places that use it. The hot bits service in
Fermi Lab in Switzerland uses this methodology. There are other ones as well, but something guessing mostly bond villains. Probably yeah, you're not gonna you're not gonna have like when I when I'm when I'm rolling up characters so that I can, you know, play my D and D game. I am not going to be using this methodologist because you don't want to die of cancer. Yeah, I like that. Quotes on that too. I mean die of cancer. By that, I mean die of cancer, and I mean literally that's
actually what I meant. No, surely, I'm sure they don't have chunks of uranium in the video poker machine that you're using at the oh, your friends are having fun. I feel reasonably I mean it is not that far from Los Alamos, but I feel reasonably confident. Okay, what about some other at least apparently random fluctuations in physical events in the world. Yeah, well, yeah, yeah. The We're always saying that the weather is random or very difficult
to predict at any rate. So what about atmospheric or electromagnetic phenomena. Yeah, it's exactly one of the sources that a lot of different true random number generators will use.
They'll use some sort of measuring device you and I might call it a radio crazy to pick up fluctuations in electromagnetics, you know, broadcasts, because lots of lots of stuff can cause radio waves to get picked up by a radio right, like, especially if you're on a M things like like lightning strikes that will get picked up
by a M radio. In fact, that's why you get interference when you tune into an AM radio station and there's an electric storm nearby or you have you know, pass underneath the bridge, and you get that interference because it's the signals no longer getting to you, uh in a in a strong fashion. So using a radio, you can pick up these this atmospheric noise and feed them into a computer to create random numbers. That's entirely possible
outcome as well, So it's pretty good. Although let's say that look at this from the point of view of an attacker. You could conceivably broadcast electro magnetic radiation to your target in an effort to influence the random number generator and then therefore creative vulnerability to get into their system. When you when you read about the actual problems people think about, and this is problems in the sense of like big, big picture, like like how impervious is this
system to an attack? They get to these discussions where you think, all right, no reasonable human being would ever be able to do this, And that's not the point. We're saying it is in fact impervious. We're not saying is it. Is it practical? Well? Yeah, yeah, I mean it's seriously doubt that any hacker is going to be sitting, you know, across from your your random number generator station and going like, start up the DVD of Wayne's World.
We're going to predict some numbers. Be an excellent source of it, though that movie is so random. But you you know, you can also use actual noise, like acoustic levels, that can be a way of generating random numbers. Obviously, hold on, let me discover your seed. Uh yeah again. Obviously, if you are in a if you're in an environment that has a repetitive noise, that's a problem because you've got a repeating pattern that will happen. If you are in an area that your attack or can get access
to and thus introduce a noise, that's a problem. So not necessarily as secure as some other ones. My favorite really was a system that made use of lava lamps. I saw this note I'm confused. Okay, so it really did use lava lamps, and the system, by the way, is no longer in use. But the way it worked was that there was a camera pointed at lava lamps. It was like early seventies bad you know, sadly disco
and randomness died out at the same time. No, it was so it was a camera pointed at the lava lamp, and lava lamps have wax essentially in them that heats up and then starts to float toward the top and it deforms in interesting ways, and the camera would take images. The images would be converted into digital information, and that would be shaped by the shape of the lava in the lava lamp or the wax in the lava lamp. So it would create random numbers based upon the shapes
of the lava, which you could not predict. You couldn't predict what shape it was going to be in at any given moment, and I thought it was a brilliant way of creating random numbers. Also stylish. I would call it tubular. In fact, totally that's eighties, not seventies. But all right, I would call it groovy personally, but that's because I'm a child in the seventies. So how mixed entropy.
We talked about intropy earlier. That idea of the entropy represents the truly unguessable bits in the string of bits um mixed entropy. This is a concept where you take lots of tiny bits of randomized information collectively to then feed into your you know, pseudo random number generator. Uh, this could be disc could take lots of different forms. You could have the air turbulence within a sealed disc
drive as a source of entropy. So we're talking obviously about an actual physical hard drive, not a solid state hard drive, right, Like the kind of has a spinning magnetic disc in it that would create air turbulence. That air turbulence would end up becoming converted into digital information that would then be fed in as part of a seed for a pseudo random number of generator. Yeah, you'd get a much more uh steady seed from a solid state drive. Yes, that would be pretty easy. Not too
much air turbulence from that. Yeah, I guess if it heated up enough, it could create some. But even so it's not much. Sorry, yes anyway, but no, you are absolutely right. Without the spinning disk, it's really not they're not getting a lot happening there. But yeah, it's the idea is to collect a lot of these different sources because individually there's not enough entropy there to create a strong random number, but collectively and mixed together you can
do that. Um, it makes it much more difficult to predict. So what then, is the future of generating random numbers? Quantum? That's your answer for everything? You know? It's say that word again, quantum um? You mean quantum? Well, I mean, if you want to pronounce it correctly. Sure, I'm talking about the behavior years of the world at the sub atomic level, the world that, based upon our perceptions, is
largely random and unpredictable. Well, I guess this would sort of be the same principle behind using radioactive decay to generate random seeds. Right. Yeah, uh so here's the thing. This is where we get into the philosophy argument. Right, so, quantum effects appear to be random to us, many of them, not all of them, obviously, but many of them appear to be random to us, and in fact, there seems to be a limitation on what we are able to
know about any given quantum effect. For example, the whole idea of for a subatomic particle, we might know it's it's a velocity or its position, But the more we know one, the less we know the other that kind of stuff. With that limitation in mind, there at least
has the appearance of randomness here. Now, it may turn out that the univer eorse itself is by and large or maybe entirely deterministic, that in fact, everything that's happening is a direct result at some point, like you could trace it all the way back to the Big Bang, and that nothing is going outside of that. That's a philosophical argument, however, because that requires knowledge of such a vast nature as to be impossible for us to to
actually obtain. Right, Well, I mean, we at least observe that everything above the quantum level seems to be at least deterministic. Like if if you were able to know everything about the thing that happened before, you should be able to expect to the next thing that happens. Sort of what the project of physics is. Yeah, it kind of kind of like if you were able to know everything about a weather system, I mean, everything, which you can't. It's it's not possible, at least not possible today, and
I doubt it will ever be possible. But let's say that some how you are able to have that knowledge, then presumably you'd be able to predict what was going to happen next. So let's take an electrical storm as an example. You might be able to if you know everything that's going on with that weather system, no, exactly when and where the next strike of lightning will occur. But in reality, we can't have all that information. Therefore we can't predict this. Therefore it feels random, right, Well,
there are just too many factors. It's it's not that it's a truly random occurrence. It's that we uh a don't don't even know how many digits are going into creating. Uh we don't know the period, right, you know. Um, and and since we don't know the entire period, we can't possibly pick the correct answer out of it. It's you know, it would go down to being able to to know when every person turns on the heat in their homes, or or when a factory breaks down for
a few hours or something like that. Yeah, it's it's it's one of those things where, again, the complexity of the system is so great as to effectively be random. Even if you could argue, yeah, that's not really random, well, it it's so complex as to effectively be random. The question is moot. In other words, uh so, and that's the macro scale, you know. Once we get down into quantum mechanics, it really is a question is this truly random? Is it contra causal? Is are these events happening without
any input determining how they will turn out? And the impression I get from reading the current sciences that people think, yeah, I mean it is it is random that these quantum events cannot be predicted by knowing what happened before. Now, it may turn out one day, I mean, I don't know, but it may turn out that we find out that's not true. There is is some information, there's some kind of hidden information that we don't have access to it. If we did know, we would be able to predict
what quantum outcomes will be. Yeah, but that is now in fact, right, Maybe that there is no such information exactly. It may be that the quantum world is nondeterministic and it truly is random, in which case using quantum effects to generate random numbers would be perfect because it is nondeterministic and a periodic. Uh if we would be the way to go. If we find out there is hidden information and we can discover what it is and In fact,
even at the quantum level, things are deterministic. Does that mean that there is no such thing in the universe as a random number? Yeah? I would I would argue yes, even in the truest of true possible true randoms, would still be a pseudo random number. Yeah. It would just be the most complex algorithm that you'd ever seen. But that, in fact, if you were able to know all of that stuff, then you would be able to predict what
the next outcome would be. Uh. I don't. I don't personally feel like that feels true to me, But that's a feeling, So I can't say that that holds any water. But there's some interesting ways that we could harvest bits from quantum uh uh phenomena. For example, the quantum effects in a semiconductor or photon polarization detection. These are things that are seemingly random, and maybe they are truly random,
and that is entirely possible. However, that kind of stuff is really limited to, you know, scientific labs that have sophisticated equipment. So what hope is there for the rest of us? What if what Joe? What if what if you wanted to go out and create a random number generator that relied upon quantum phenomena. What hope do you have? Oh wait, you're referring to the cell phone cameras. I am this was a great story. Yeah no, this was really cool. I'm glad you found this story about Bruno's
Seguinetti who came up and a team of researcher. It wasn't just a Mr Segwinetta. He had a team of researchers as well at the University of Geneva try to find a way of using smartphones to detect quantum data that could be then used to generate random numbers. And the quantum data with a cell phone would be through the use of the camera. Like you said, Joe, my my cellphone camera does not have the resolution to see things at a quantum level. I mean, I've only got
an iPhone four. So maybe that's why you keep adding that CPA tone filter everything as the problem. But it actually your cell phone is made of atoms that do interact at the quantum level. That is true. What we're talking about here, specifically, is the way that a camera, a digital camera captures light. Right we're talking it has sensors,
and the sensors end up corresponding to pixels. Those would be the individual little dots that make up your your image, and photons will collide with that sensor, and then the sensor generates the electrons necessary for this to be translated into an image that ultimately will be displayed back into photons so that your eyeballs can see it. But meanwhile you have this electron phase. And the interesting thing is
that photon emission is one of these random things. We we have a probabilistic model where we can say what the average is of any given moment of photons being omitted, but it turns out that at specific instances that number varies, so there is some randomness there. It's not, you know, we just have the average. We don't necessarily know at any given time how many photons are being admitted within the view of a camera, for example, except that a
camera has to translate those photons into electrons. So if we take the average of what we would expect any given pixel in a photo to generate, so let's say, you know, again, I'm going to use a ridiculous example, and this is truly ridiculous. Let's say, all right, we expect this pixel will capture ten photons and create ten electrons. This is totally wrong, by the way, just to give
the example, but but instead it generated nine electrons. Well, then you know that the actual number of photons was less than what the average was, and that number, the difference there becomes your random number. Okay, and that's for one pixel. Now, the camera they used was an eight megapixel camera, so I had many, many more than just one pixel, right, millions of pixels, And so that means that the all of these different sensors are working in
parallel together. So you take all of the differences of all of those pixels based upon you know what what actually hit it versus the average that you expected, and then then you have your random number. And it's all just from a cell phone. So you could literally have an app on your cell phone that would be able to turn an image captured on the camera into a random number, and you would have access to a quantum random number generator from your cell phone. That's pretty awesome.
It's pretty pretty awesome. Yeah, because again this is the sort of stuff like the quantum number generators for the sort of things you would only find in labs, not something that your average person could have access to. So if you have a real need to generate random numbers for some reason, you want to open an online casino, you know, Yeah, I mean there could be any number of reasons why a person might really have need of this.
I mean maybe you're a web administrator and you need to have this to generate unique ideas, and you thought this is a great way to generate those seeds that I will feed into my pseudo random number generator in order to create as unique ideas. It's a great solution, right, It's something that you don't have to worry about an attacker anticipating what the next number is going to be, because it's impossible. It's quantum, as Terry Pratchett would have said, quantum.
Uh so yeah, this was you know, this is always a fun thing to talk about. I love talking about random numbers and the difficulty of generating them and whether or not they even exist. Uh. I tend to kind of get frustrated with philosophical discussions, but for some reason, this one in particular really appeals to me. Well, it's also mathematical, which helps. Yeah, and I just think you're in a good mood today. Well, I did a Mexican food and pie, so that helps. Well, thank you so
much for the email, Sean. We really liked this topic. Yeah, and in fact, if any of you out there would like to follow in Sean's footsteps and send us a message, maybe you've got something else you want us to cover. There's some sort of future topic you think is really interesting, let us know. Send us an email that addresses FW Thinking at how Stuff Works dot com, or you can always drop us a note on Facebook, Twitter, or Google Plus. Twitter and Google Plus we are f W Thinking. Just
search f W Thinking and Facebook. We'll pop right up, leave us a message, and we'll talk to you again. Release soon. For more on this topic in the future of technology, visit forward Thinking dot com, brought to you by Toyota. Let's Go Places,
