Dept. of Math. University of Oslo Statistical Research Report No. 10 ISSN 0806–3842 August 2004 EXACT SEQUENTIAL SIMULATION OF BINARY VARIABLES GIVEN THEIR SUM Arne Bang Huseby Abstract The paper considers the problem of simulating a vector, Xof n inde- pendent binary variables conditioned on their sum, S. For a fixed value of S an exact simulation method is provided in Huseby and Naustdal[4]. In certain situations, however, it is of interest to generate an increasing sequence of binary vectors X1 < ··· < Xn, such that the s-th vector is distributed as the vector Xgiven S = s, s =1,...,n. If all the variables of the vector Xare identically distributed, it can be shown that this is equivalent to generating a random permutation, {πs} n s=1 , of the index set, {1,...,n}. For more details about this, see Huseby and Naustdal[4]. In the present paper, however, we provide a simulation algorithm for the case when the variables of the vector Xdo not necessarily have the same distribution. This algorithm utilizes the fact that the distribution of a sum of independent binary variables is always log-concave. 1 Introduction When using Monte Carlo simulations to estimate stochastic properties of a model, it is often necessary to accelerate the convergence of the simulations. One way of doing this is to condition on certain functions of the input variables. In this paper we will focus on the problem of simulating a vector, X=(X 1 ,...,X n ) of independent binary variables conditioned on their sum, S. It is well-known (see e.g., Huseby and Naustdal[4]) that the distribution of S can be calculated in O(n 2 ) time. Thus, if φ = φ(X) is some function of interest, then E[φ] can often be estimated more efficiently by conditioning on S through the following formula: E[φ]= n s=0 E[φ | S = s] Pr(S = s)= n s=0 θ s Pr(S = s) (1.1) where we have introduced θ s = E[φ | S = s] for s =0, 1,...,n. Instead of estimating E[φ] directly, we estimate the conditional expectations, θ 0 ,θ 1 ,...,θ n . This is done by sampling from the conditional distribution of X given S = s for s =0, 1,...,n. It turns out to be easy to sample X from the conditional distribution given S = s. An exact method for doing this is provided in Huseby and Naustdal[4]. We will refer to this approach as the direct sampling method. The computational complexity of this method is O(n) per simulation. Since, however, this needs to be repeated for s =0, 1,...,n, the total computational complexity of the direct sampling method becomes O(n 2 ). 1