Can humans create random numbers?

Yes, that’s part of the trick: that there are fewer possible numbers to choose from than it may first seem. When the guessor guesses correctly, many people forget the rules and assume that he had a 1/50 chance of being right.

But, when I said that the distribution of answers is non-random, I meant amongst the 8 possible replies. :slight_smile:

Any chance of recalling where you remember that from? Because that’s pretty much what I’m after…

There’s no list. It’s a mathematical function. You initialize it with some number (called “the seed”) and it generates a “random” number as its output. The new number becomes the seed for the next time you call the function.

Humans can certainly generate pseudorandom numbers by mentally working through the steps of one of these functions. But I strongly doubt that we can create randomness just by willing ourselves to randomly spit out numbers. Our brains aren’t wired that way.

I don’t doubt that you know better than me. I guess I’m used to Visual Basic (and other versions of Basic) where the Rnd() function works as I described. For the last few years I’ve been doing a lot of programming in Matlab, where again the rand() function produces a number from 0 to 1 (or a matrix of such numbers). If the random number generator is really generating random integers, I have to wonder what’s the point of the language converting them to decimals. It seems that the programmer could just as easily do this himself if that’s what’s desired.

Is this really true? My impression was always that the “seed” was basically just telling it where to look in some long prerecorded list of random numbers. But I’m a mostly-self-taught programmer, so a lot of things like this I tend to use without knowing all the details.

If it’s just an actual closed-form mathematical function, (as opposed to just a function in the sense that it takes an input and returns the appropriate output), then what’s the function?

Here ya go.

In retrospect, I suppose it was naive of me to think that any reasonable-size list of random numbers would be good enough for serious scientific applications of random numbers, like monte carlo calculations and whatnot.

This is the most common way biases are introduced into code using random sequences. Basically, it’s really really hard to use pseudorandom numbers correctly, and probably only Donald Knuth knows for sure.

Pochacco has it right. All pseudorandom generators, if run long enough, will repeat their sequence. A good algorithm will have a very long sequence, hopefully longer than the range that you’re interested in.

But at some level, you need to understand how pseudorandom numbers are generated, and how floating-point numbers are represented. For instance, if you have 60,000 possibilities and your generator only produces 65536 values (common for the rand() function in the C programming language) it is impossible to get a uniform distribution. If you scale the 65536 values to the 60000 range, you’ll get 5536 values with twice the probability of being picked. In this case, the best solution is to pick a value and if it’s above 60000, to try again. Some people recommend taking the integer value and performing a modulo operation (basically, X mod b means if X is bigger than b, keep subtracting b until X is less than b), but that moves the bias to the beginning of the distribution.

At any rate, the best way for a person to generate random numbers in a pinch is with a fair coin.

As an illustration of human non-randomness, consider the game Paper, Rock, Scissors. If you always choose your gesture randomly, with an equal chance of each, you’ll be unbeatable: No matter what strategy your opponent tries to use, you’ll win as often as you lose, in the long run. But there are computer programs which can play Paper, Rock, Scissors, and consistently beat humans in the long run (that is, win more times than lose). Since no strategy can beat the random strategy, and these computer programs have a strategy that can beat humans, that implies that humans don’t really use the random strategy.

Actually, if (as is usually the case) generating (pseudo)random bits is one of your more expensive operations, you can do better than that. You need log(60000) bits (that is, 15.873 bits) of randomness. You start off as you said, rounding up and generating 16 bits (= log(65536) of randomness, and if you get a number under 60000, you’re fine. But if you get a number over that, you still have log(5536) = 12.435 bits of randomness left over. So then you only need to grab 4 more bits of randomness to try again, to generate a number between 1 and 88576. If that number is below 60000, then you’re done, otherwise you have left over a perfectly good random number between 1 and 28576. Grab two more random bits, and you now have a random number between 1 and 114304, and so on.

No, I don’t. But as was mentioned earlier, most people don’t think a sequence is random if it contains the same number twice in a row, so the next number depends on at least the last number, and maybe the last few. So if you write a program that models the user’s input as a Markov chain (where the state is the last four or five numbers), you can apply standard reinforcement learning techniques to the problem of guessing the next number. I bet it would work pretty well.

I don’t mean to muddy the waters here, but I just had a stray thought that won’t leave me alone: How do we know that a particular set of random numbers truly is random? After all, by definition the result cannot be replicated. . . .

Kornblutian Bistromathics is a method for generating random number sequences, based on Douglas Adams’ principle of Bistromathics, and determined through close observation of Washington Post reporter Anne Kornblut.

The researcher must first approach Ms. Kornblut for a lunch appointment. During said lunch, Ms. Kornblut (selected for her high observability quotient based on cuteness factor) is observed for such repetitive behaviors as blinking, using words such as “uh,” “um,” or “Obama,” tapping her salad fork on her plate, or toying with half-eaten chicken legs. The instances of each behavior are then tabulated; the result is a Kornblutian random number sequence.

Back in the old days…I remember a great cartoon in the magazine ‘The Dragon’ where office people where saying:

“You better answer the phone…it is metallic circular banding”

“I got engaged! Do you want to see my engagement metallic circular band?!”

“Ahhhh man…my ears are metallic circular banding”

“This morning my kids were playing metallic circular banding around the rosie”.

etc etc

The final panel had one person asking another manager type “So…you still having trouble with the Tolkien Estate?”

{The Tolkien estate tried to sue D&D for using the word “ring”.}

A set of numbers is random if, given the entire sequence up to a given point, you can’t predict the next number with accuracy better than chance.

That doesn’t seem like a very useful definition, though. I mean, how would you know if your inability to predict the next number is because the sequence is truly random, or just because you aren’t good enough at coming up with a prediction algorithm?

I was speaking colloquially there. By “you can’t”, I mean “there does not exist an algorithm that can”.

I remember hearing an anecdote about a computer programming professor in my college who every year would ask his class to come up with a random sequence of 50 numbers 0-9 and then ran a program that generated an actual random 50 number sequence.

After mixing the computer generated sequence in with the ones submitted by his students he was able to tell the computer generated one apart of the ones his students submitted every single time. His explanation was that the computer generated sequence was always the one with the largest consecutive string of the same number.

There are also statistical analysis tests that can be done on a sequence of numbers to measure its “randomness”.

For instance, in a long random sequence you’d expect all the possible numbers to show up with approximately equal frequency. You’d also expect all possible intervals between each number and its neighbour to show up with approximately equal frequency.

There are lots more tests like these. And more tests are developed from time to time that can find patterns in sequences that passed all the other tests of randomness.

But all tests like this do is give or take away “confidence”. They cannot tell you for certain whether the sequence is random.
In the case of pseudorandom number generators, we know ahead of time that the sequence is not random. But we want the algorithm to produce sequences that pass all (or all reasonable) tests of randomness nonetheless.

It depends on what you mean by “random”. On some mathematical formalizations of this concept (e.g., the one ultrafilter is referring to), it will make sense to say of a particular sequence that it is or is not random; on other formalizations, it will not. As is often the case with concepts in ordinary language, “random” admits many related but non-identical mathematical interpretations…

(Actually, if I understand ultrafilter correctly, the interpretation he is referring to will only allow us to say nontrivially of infinite sequences whether they are random or not; any finite sequence can, of course, be predicted perfectly by some algorithm)

I get that, but how do you know if there exists an algorithm that can? I mean, the question “Is there an algorithm that can do X” isn’t always one we know the answer to. If it were, then we’d be able to answer questions like “Is there an algorithm that can solve this NP-Complete problem in Polynomial time?”

I suppose if there’s no reason to expect any two numbers in the sequence to be related to each other (e.g., if it’s a sequence of die rolls or something), then we could say of course there’s no algorithm that can do it. But is the question “Is this sequence random” basically unanswerable if we don’t know where the sequence came from? (I mean, unanswerable in the affirmative – clearly you could prove that it’s not random just by exhibiting an algorithm that predicts the next number.)