Consider a machine that generates numbers at random. Let's say it generates the number 12. Is there is a reason why 12 was selected rather than another random number?

Let's suppose that the machine is my computer and I'm using the function =TRUNC(100*RAND(),0). Then as I put the function in more and more cells, I'll get a list of integers between 0 and 100 that pass various tests for randomness. Let's suppose that the fifth integer on the list is 12. Is there a reason for that?

There is, at least superficially. The function =TRUNC(100*RAND(),0) works by performing various well-defined mathematical operations on an input. The input is the time when you hit "ENTER," according to the computer's clock. Given that input and the cell, the output is determined. Put another way, if two computers ran the program starting at the same time according to their clocks, they would give the same output. So there's an explanation for why the fifth cell ends up containing 12 rather than some other integer. It's a matter of the input and the program.

You might protest that this isn't truly random. If it were, two computers with the same input wouldn't produce the same supposedly "random" output (or at least, they wouldn't be guaranteed to.) You would have a point, though we could push the question back a step: why did you press ENTER at the moment you did? Perhaps there's an explanation for that, or perhaps not. If there is, we might chase the rabbit further through the warren, but perhaps it's better to shift gears.

Suppose that instead of a computer, we have a source of individual photons. Each photon is aimed at a filter for polarization in the vertical direction. Some photons will be absorbed, but some won't. The ones that pass travel on to a crystal that splits the beam in half. Photons that emerge in the upper beam are polarized in the diagonal direction; the ones in the lower beam are polarized at 90 degrees to the diagonal. At the end of each beam is a detector. If the upper one catches a photon, a screen displays a 12. If the lower detector catches a photon, the screen displays a 6. On this run of the experiment, it's a 12. Is there a reason why it was a 12 rather than a 6?

The answer depends on your understanding of quantum mechanics. But on one important view, there is no reason. It's not just that we don't know the reason; it's that there is none. On this view, the randomness of quantum events is basic and ineliminable; there's nothing in nature that fixes the outcomes of processes like this. On this view, if we add an explanation, then we are no longer talking about quantum mechanics.

Is this the correct view? There's a good deal of controversy about that, but it's a serious view, and there are serious arguments on its behalf. On this interpretation, quantum randomness isn't just a matter of passing various statistical tests. On this view, quantum randomness isn't just patternlessness, in the way that the digits in the decimal expansion of a non-algebraic number are patternless. On this view, some questions about why one thing happens instead of another do not have answers.
Whether or not this is a correct description of the actual world, I believe it's a coherent thesis. (Defending that fully would call for a lot more discussion than would be appropriate here.) And so one answer to your question is: if the "machine" you assume is a quantum machine, and if one major interpretation of quantum theory is correct, then no: there is no reason why the screen spat out a 12 instead (in this case) of a 6.

Of course, even if the world is deterministic, the way things behave depends on the initial conditions, as the physicists say. And there may be no reason why those conditions are exactly as they are; they may be merely and sheerly brute. (Indeed, it's possible to argue that this has to be true.) But if the view of quantum theory I've been describing is right, and if the world is a quantum world, then there's deep randomness all around us: vast numbers of things at every turn, turning out one way rather than another for absolutely no reason at all.

Read another response by Allen Stairs
Read another response about Probability