Producing random numbers is very important for many applications. I will cite only two. One is cryptography, as we will see in this lesson. Another one is an applied mathematics method much used to get numerical solutions of difficult problems, known as Monte Carlo methods. Here is a simple example, showing how you can determine the value of pi by counting how many points, drawn randomly and uniformly in a square, are found inside a disk inscribed in the square. After drawing 900 points, one finds 709 points inside the disk. If the distribution of the points is uniform in the square, the fraction of points in the disk is expected to be pi over four. This yields an approximation of pi, good at better than 1%. Many numerical evaluations, in particular of integrals in high-dimension spaces, can be done efficiently with such a Monte Carlo method. The exactitude of a Monte Carlo integration obviously increases with the number of points, but its correctness is based on the availability of unbiased random number generators. But, what is randomness? Defining randomness is a difficult conceptual question which could lead us very far. How would you prove that you have good random number generator? Suppose you have a device that generates apparently random series of zeros and ones. There are many statistical tests based on mathematical properties of random numbers. For instance, the probability of occurrence of zeros and ones should be equal. Also, there should be no correlation between the successive values of the bits. A much-used ensemble of such tests is NIST Test Suite for Random Numbers. But let us suppose that your random number generator passes all these tests. Does it mean that you have true randomness? In fact, the value of these tests is to be able to detect specific failures to be random. So the larger the number of successfully passed tests, the more confident you are that your generator is not a bad random number generator. But you cannot prove that it is really good. So what would be a better criterion? In fact, if we suppose that we need a random number generator for cryptography, we demand that nobody else can get the same number as us. It means that the numbers that are produced are unpredictable. This is a good definition of a useful random number generator. It will lead us to an operational definition. How would you produce random numbers? It is likely that many of you immediately think of more or less sophisticated computer programs to generate randomly zeros or ones. For instance, by taking the last digit after rounding the result of complex operations. That is a method used by some computer programs to get random numbers. But in fact, any computer program is perfectly predictable. So in principle, it is possible to predict which numbers would be generated. This is why the numbers produced by such programs are called "pseudo random number generators". If you think hard enough, you will rapidly discover that a convincing way to produce true randomness is based on random physical phenomena. You can think, for instance, of the last digit given by a thermometer in a windy open space, or of the electromagnetic noise in the atmosphere at the time of thunderstorms. So we have now a pragmatic definition of a good random number generator. It is based on quantities observed on physical phenomena thought to be random, such as atmospheric noise. Let us take a RNG based on a physical phenomenon believed to be random. For a classical random phenomenon, other people could observe the same parameter as us, and thus determine which number we get. In fact, any classical phenomenon leads to randomness that could be predicted or at least observed by somebody else. So, in principle, there could be copies of our series of random numbers. This is not satisfactory for applications such as cryptography. So how to get out of this dilemma? I am sure you guessed the answer. To get true random numbers, go quantum. Do you remember your first course in quantum mechanics? You learned that a particle with spin-1/2 oriented perpendicular to the magnetic field of a Stern-Gerlach analyzer, will exit randomly either in the upper channel or in the lower channel. Weren't you surprised to learn that there is absolutely no way to predict in which channel it will be found? This statement has shocked many physicists. Albert Einstein was one of them, and he debated that question over and over with Niels Bohr. There have been many attempts to complete the formalism of quantum mechanics with supplementary parameters, so called hidden variables, which would determine in advance in which exit channel the spin-1/2 would be found. But we have ample experimental evidence against such a way to complete quantum mechanics. In fact, the most convincing evidences against hidden variable theories have been produced in quantum optics. So, let us trust standard quantum physics and in particular quantum optics, the subject of this course. Do you know a quantum optics phenomenon leading to a random choice between two output channels? Yes, of course. You know that the behavior of a one-photon wave packet on a beamsplitter is random. This is an efficient way to produce a random sequence of zeros and ones. For instance, assigning a zero to detection in the transmitted channel and a one in the reflected channel. There is no ambiguity, since for a one-photon wave packet, there will be one detection only either in the transmitted or in the reflected channel. For an equilibrated beamsplitter, the probabilities are equal, and nobody can predict what will be the next result. The system thus produces a random sequence of zeros and ones. Such a system is called a Quantum Random Number Generator, a QRNG. There is a consensus to consider such QRNG as true random number generators. Why? Firstly because they pass all the known statistical tests. More important, because we think we fully understand how the system works, and according to all we know, its output is fully random. The ultimate analysis of a random number generator is based on the full knowledge of its functioning. With this knowledge, you can make all efforts to find how an enemy could bias a machine and force it to deliver 0s or 1s according to his/her will. In the case of a quantum phenomena, as one-photon on a beamsplitter, there is no way to force nature to choose one of the two possibilities, as far as we know. We think that quantum randomness is fundamental in nature. Of course, if the system is not well enough shielded, there might be a way to blind the detectors and inject false signals into the electronics. But it is a matter of good engineering to be immune from such attacks. These ideas emerged in the 1980s. As you know, one-photon sources were not standard devices at that time. And in fact, what was proposed and used, was not one-photon pulses, but weak classical pulses of light. So let us make a detour through Random Noise Generators, based on weak light pulses on a beamsplitter