**Suggested Citation:**"Appendix D: Functions and Random Variables." National Research Council. 2000.

*Risk Analysis and Uncertainty in Flood Damage Reduction Studies*. Washington, DC: The National Academies Press. doi: 10.17226/9971.

## Appendix D

## Functions of Random Variables

A random variable *X* is a variable whose probability of taking on a particular value *x* in an infinitesimal range is described by a probability density function, f(x). The mean or expected value of *X* is given by

in which the product *f*(*x*)*dx* is the probability of *x* occurring in an interval [*x, x + dx*]. The variance, σ^{2}_{x}, is similarly

When Monte Carlo simulation of a random variable is carried out, a set of n independent values is generated to yield a set of replicates {*x*_{1}*, x*_{2}, . . . , *x*_{n}}, from which the mean is estimated as

The weight, 1/*n*, implies each value is as likely as any other. Equation 3 represents the process actually used in the Corps's risk analysis procedure, in that the weight, 1/*n*, approximates the theoretical probability, *f*(*x*)*dx*, and the summation in Equation 3 replaces the integral in

**Suggested Citation:**"Appendix D: Functions and Random Variables." National Research Council. 2000.

*Risk Analysis and Uncertainty in Flood Damage Reduction Studies*. Washington, DC: The National Academies Press. doi: 10.17226/9971.

Equation 1.

When a sum *Z* of two random variables, *X* and *Y*, is required, the process is more complex. For two variables, *x* and *y*, the corresponding *z* is

*z = x + y,* (4)

and the expected value of *Z* is the sum of the expected values of *X* and *Y*:

*µ*_{z}*= µ*_{x}*+ µ*_{y}.(5)

However, the variance of *Z* is

*σ*^{2}_{z}*= σ*^{2}_{x}*+ σ*^{2}_{y}*+ 2ρ*_{xy}*σ*_{x}*σ*_{y}*,* (6)

where ρ_{xy} is the correlation coefficient of *x* and *y* (−1 ≤ ρ_{xy} ≤ 1). The correlation coefficient introduces a new element into the picture and represents the degree of association of values of *x* and *y*. When the variables are statistically independent, ρ_{xy} = 0, and the variance of the sum is simply the sum of the variances. When the variables are positively correlated, the variance of the sum is increased by an amount proportional to the degree of correlation.

Similarly, when the difference, *Z*, between two random variables, *X* and *Y*, is found, the value of the variate *z* can be found as:

*z = x − y* (7)

and the expected value as

*µ*_{z}*= µ*_{x}*− µ*_{y}, (8)

while the variance of the difference is given by

*σ*^{2}_{z}*= σ*^{2}_{x}*+ σ*^{2}_{y} − 2*ρ*_{xy}σ_{x}σ_{y}. (9)

In this case, if the variables are positively correlated, the variance of the difference is diminished by an amount proportional to the degree of correlation.

**Suggested Citation:**"Appendix D: Functions and Random Variables." National Research Council. 2000.

*Risk Analysis and Uncertainty in Flood Damage Reduction Studies*. Washington, DC: The National Academies Press. doi: 10.17226/9971.

The significance of all these definitions is that Monte Carlo simulation works at the level of replicates, or individually generated values of variables *x* and *y*. At that level, the normal rules of arithmetic for sums and differences apply, as specified by equations 4 and 7, and they can also be applied to the expected means of those variables, as given by Equations 5 and 8. However, the variability of a sum or difference of random variables depends in part on the variability in the individual variables and also on the degree of correlation or interdependence between the variables. Properly quantifying variability in a problem involving the interaction of several random variables requires an understanding and a correct representation of their interdependence or correlation.