What's the difference between a random number and a pseudo-random number?

Wonderful 27 pages of witty comments.

Who uses hand transferred (ie from hard copy) to software input? Shouldn’t this data be released electronically?

Also, what’s a normal deviant? ::straight line:: 1) the word is nicely oxymoronic, and 2) I consider myself a normal deviant (just ask my shrink).

Seriously, in random-number theory, what’s a normal deviant?

There’s nothing trivial about games. :mad:

That book was from long before everybody had a computer (and therefore a convenient source of pseudorandom numbers) at their fingertips. People would indeed use it for various pencil-and-paper calculations that required a random input or sequence. Or on smaller computers that didn’t have PRNG hardware. It’s only useful today as a historical relic.

Normal deviate, not deviant. It’s just a a number between 0 and 1. They are used in statistics and sometimes you want a random number between 0 and 1 to test your statistical algorithms.

Seriously. My crappy laptop can reproduce the entire contents of that book in about a tenth of a second.

R code:



library(matlab)
tic()
x <- rnorm(1e5)
y <- sample(0:9, 1e6, replace = TRUE)
toc()


Not quite, a normal deviate is a sample from a random variable with a normal distribution (the standard bell-shaped curve, otherwise known as a Gaussian distribution). A normal deviate can take any value between negative and positive infinity. A standard normal deviate comes from a distribution with a mean of zero and a variance of 1.

Also to remember: while crytography etc. needs truly random numbers, and others (as explained already) need pseudo-random for repeating, humans also don’t want true randomness.

What humans perceive as randomness is really randmoness with a filter removing obvious sequences - sequences which are obvious to humans though they have been produced by truly random means. We’ve had several threads on this regarding music players in “shuffle” mode - companies first used a normal random function, but then people complained that two Beatle songs were played right after another, or song Nr. 5 after song 6, so the random function must be broken.
Now the software keeps track of the last five titles or so to avoid repetition (making everything more complicated than a simple RND command), and giving humans the illusion of true randomness.

Another example: if you throw 6 dice and get 1,2,3,4,5,6 in a row, you’d claim it’s not random because it’s ordered. But unless the dice were tampered with, and if you used a true random means of throwing, then the production was random, and therefore the result, too. And you can’t predict the next throw from this, either. Yet humans assign a meaning to this particular sequence out of all possible ones and label it as ordered.

You can too! I’ll bet the next roll will be 7.

Wow. I’ve been around the block enough to know poor programming is almost more the rule than the exception, even when real money, lives, or important secrets are at stake, but that shuffle routine is remarkable!

… then again, I suppose we can’t rule out the possibility that the coder was a very clever guy who ended up making a lot of money at the PlanetPoker Internet cardroom. :stuck_out_tongue:

Particularly when real money is involved.

Yes you can. Imagine you assign a different numerical value to every card in a deck and then you shuffle the deck randomly. The sequence of cards coming off the deck will be truly random but no card will have the same value as any other card.

And if you’ve seen the first k cards, you have information about what the (k + 1)st card says that you wouldn’t have otherwise. If the cards are independent, you get no information, and that’s more secure.

Crap.

I don’t think public key cryptography depends in any way on random numbers. You find a pair of 500 digit primes and multiply them and choose an exponent and you are in business.

People are talking pretty seriously about deprecating RSA in favor of elliptic curve algorithms. Apparently factorization is a little too close to practical these days.

And how do you pick those two primes? If anyone knows what method you used to pick your primes, they can figure out what the primes were, and hence your private key. Unless, of course, you have a good, truly random, way of picking them.

How random is your algorithm for finding those two primes? Or put another way, how much entropy is in your choice? If there is a common algorithm for finding and then choosing primes I need to know that it doesn’t contain issues that result in the sequence of primes actually used by people creating keys doesn’t produce a limited search space of primes, thus making brute force attack possible. Thus the choice of primes must itself be true random. The key generation is only as good as the random input. Primes are just an implementation tactic used to make it hard to find.

In any case, most public-key systems are used just for exchanging symmetric keys. Which are really big, hopefully unpredictable numbers.

(This is because symmetric cryptographic algorithms are a lot faster than asymmetric ones, so you don’t want to encrypt large amounts of data using the public-key algorithm.)

But that comes from the guarantee of uniqueness, not any algorithm that fulfills that guarantee. Also, the amount of information gained is proportionate to the ratio of k to total deck size. An easy way to mitigate this risk to just to make the deck size many orders of magnitude larger.

Is repetition part of the definition of pseudo-randomness? Could there not be a pseudo-random number which never repeats?

I don’t know that it is part of the definition of pseudo randomness, but any PRNG that operates on a real computer must repeat, simply because there are only a finite number of states for it to be in after each call. The best it can do is go through every possible state, but after that it has to enter a state that it has already been in.

Here’s a paper describing an aperiodic PRNG. I’m not sure such a thing is of much practical use though.