A Mathematical Formulation of the Monte Carlo Method∗
Total Page:16
File Type:pdf, Size:1020Kb
A Mathematical formulation of the Monte Carlo method∗ Hiroshi SUGITA Department of Mathematics, Graduate School of Science, Osaka University 1 Introduction Although admitting that the Monte Carlo method has been producing practical results in many fields, a number of researchers have the following serious suspicion about it. The Monte Carlo method needs random numbers. But since no computer program can generate them, we execute a Monte Carlo method using a pseu- dorandom number generated by a computer program. Of course, such an expedient can never have any mathematical justification. As a matter of fact, this suspicion is a misunderstanding caused by prejudice. In this article, we propose a proper mathematical formulation of the Monte Carlo method, which resolves this suspicion. The mathematical definitions of the notions of random number and pseudorandom number have been known for quite some time. Indeed, the notion of random number was defined in terms of computational complexity by Kolmogorov and others in 1960’s ([3, 4, 6]), while the notion of pseudorandom number was defined in the context of cryptography by Blum and others in 1980’s ([1, 2, 14]). But unfortunately, those definitions have been thought to be useless until now in understanding and executing the Monte Carlo method. It is not because their definitions are improper, but because our way of thinking about the Monte Carlo method has been improper. In this article, we propose a mathematical formulation of the Monte Carlo method which is based on and theoretically compatible with those definitions of random number and pseudorandom number. Under our formulation, as a result, we see the following. The Monte Carlo method may not need random numbers; pseudorandom numbers may suffice. As a matter of fact, for the purpose of the Monte Carlo integration, there exist pseudorandom numbers which can serve as complete substitutes for random numbers. The Monte Carlo integration is a numerical integration method making use of the law of large numbers. Since most of important applications of the Monte Carlo method are actually Monte Carlo integrations, the above fact is very significant. ∗ Ver.20151111 / This article is a digest of [11]. For details, see the full version [11]. 2 Overview The Monte Carlo method is a numerical method to solve mathematical problems by computer-aided sampling of random variables. For each individual problem, we set up a probability space (Ω; F ; P) — in this article, for simplicity, we assume it to be a proba- bility space of finite coin tosses L f0;1gL + (f0; 1g ; 2 ; PL = the uniform probability measure); L 2 N ; — and a random variable S defined on it; S : f0; 1gL ! R. We evaluate S (!) by a computer for some chosen ! 2 f0; 1gL, which procedure is called sampling. Figure 1: Distribution and generic value of S (Conceptual figure) an exceptional value a generic value The Monte Carlo method is a kind of gambling as its name indicates. The aim of the player, say Alice, is to get a generic value (Figure 1) — a typical value or not an exceptional value — of S by sampling (x 3.1). Suppose that she has no idea about which ! she should choose to get a generic value of S . She chooses an ! 2 f0; 1gL of her own will, realizing the risk of getting an exceptional value of S . Her risk is measured by the probability PL(A) of a set n o A := ! 2 f0; 1gL S (!) is an exceptional value of S : y1 Since S seldom takes exceptional values, we have PL(A) ≪ 1, and hence, Alice may well think that she will almost certainly get a generic value of S . Of course she will, when L is small. But when L ≫ 1, say L = 108, it is not sure that she will even though PL(A) ≪ 1. In case L ≫ 1, how Alice chooses an ! 2 f0; 1gL comes into question. Indeed, to specify an ! 2 f0; 1gL, when L = 108 for example, she cannot help using a computer because of its huge amount of information; ! is approximately a 12MByte data. Obvi- ously, a 12MByte data is too huge for her to input directly from a keyboard to a computer. So, she needs some device. But whatever device she may use, those !’s2 f0; 1gL she can choose of her own will are very limited (x 4). By this reason, even though PL(A) ≪ 1, we cannot say that Alice is able to get a generic value of S almost certainly. Therefore, to let y1a ≪ b stands for “a is much less that b”, while a ≫ b stands for “a is much greater than b ”. 2 the risk evaluation PL(A) have a substantial meaning, it is natural to think that Alice needs an ! 2 f0; 1gL which she cannot choose of her own will — namely, a random number.y2 On the other hand, S in an actual question must not be an arbitrary random variable, but one which represents some significant quantity. Thus S is very special among all the functions f0; 1gL ! R. Therefore Alice may possibly be able to get a generic value of the special random variable S for a special ! — not a random number — which she can choose of her own will. It is pseudorandom generator that is planned to realize this idea. A pseudorandom generator is a mapping which stretches short f0; 1g-sequences into long f0; 1g-sequences. For example, suppose that Alice uses a pseudorandom generator g : f0; 1gn ! f0; 1gL, n < L, to sample S . First, she chooses a seed !0 2 f0; 1gn of her own will. Here n should be so small that she may input !0 directly from a keyboard to a computer. Then the computer generates a pseudorandom number g(!0) 2 f0; 1gL from her seed !0, and she finally gets a sample S (g(!0)) of S . As a result, she is now betting on whether S (g(!0)) is a generic value of S or not. Her risk is now measured by the 0 probability Pn (g(! ) 2 A). This probability naturally depends on g, but if there exists a 0 pseudorandom generator g such that Pn(g(! ) 2 A) ≪ 1 holds, Alice can actually get a generic value of S with high probability. Such a g is said to be secure against A (x 5.2). The problem of sampling in a Monte Carlo method is solved by finding such a secure pseudorandom generator. For a general random variable S , although there are many candidates, there is no pseudorandom generator which is proved to be secure against the set of those !’s 2 f0; 1gL that yield exceptional values of S (x 5.3). However, if we restrict the use of pseudorandom generator to the Monte Carlo integration, i.e., if S in question is a sample mean of i.i.d.y3 random variables, there exists a pseudorandom generator which is secure against the set of those !’s 2 f0; 1gL that yield exceptional values of S . Such a pseudorandom generator has already been used in practice for not too large Monte Carlo integrations (x 6.2). 3 Monte Carlo method as gambling Mathematical problems should be solved by sure methods, if it is possible. But some problems such as extremely complicated ones or those that lack a lot of information can only be solved stochastically. Those treated by the Monte Carlo method are such prob- lems. 3.1 Player’s aim As a mathematical formulation, it is proper to think the Monte Carlo method as stochastic game, i.e., gambling. The aim of the player, Alice, is to get a generic value of a given random variable. (The mathematical problem in question is assumed to be solved by a generic value of the random variable. See examples below.) Of course, Alice has a risk to get an exceptional value, which risk should be measured in terms of probability. The following is a very small example of the Monte Carlo method (without computer). y2By this reason, some people use physically generated random numbers. But this article deals with only solutions by pseudorandom generators. y3i.i.d. stands for independently identically distributed. 3 Example 1 An urn contains 100 balls, 99 of which are numbered r and one of which is numbered r + 1. Alice draws a ball from the urn, and guesses the number r to be the number of her ball. The probability that she fails to guess the number r correctly is 1=100. If we state this example in terms of gambling, it goes that “Alice wins if she draws a generic ball, i.e., a ball numbered r, and loses otherwise. The probability that she loses is 1=100.” In general, the player cannot know whether the aim has been attained or not even after the sampling. Indeed, in the above example, although the risk is measured, Alice cannot tell if her guess is correct, even after she draws a ball.y4 There are some cases where exceptional values are needed. For example, we of- ten seek for the minimum value of a complicated random variable X by a Monte Carlo method. In such a case, we define another random variable S so that a generic value of S is an exceptional value of X. Look at the following example. Example 2 Suppose that Pr(X < c) = 1=10000. So X can be less than c, but the f g40000 probability is very small. Take a sequence Xk k=1 of independent copies of X, and y5 define S := min1≤k≤40000 Xk.