## 3.1 FUNCTIONS OF RANDOM VARIABLES: |

STEP 1: | Define the random variables of interest. |

STEP 2: | Identify the joint sample space. |

STEP3: | Determine the joint probability distribution over the sample space. |

STEP 4: | Work within the sample space to determine the answers to any questions about the experiment. |

1.

X

X

Later, when we are interested in travel distance, assuming U-turns are possible and permissible everywhere, the travel distance D can be expressed as a function of X

2. **Joint sample space.** The joint sample space is the unit square in the positive
quadrant (0 X_{1}
1, 0 X_{2} 1).

3. **Joint probability distribution.** We will assume that the locations of the ambulette
and the medical emergency
are uniformly, independently distributed over the highway. In practice, the three
assumptions entailed in such a statement
would have to be argued for plausibility and measurements might have to be taken.
Naturally, the analysis could also
proceed with an alternative set of assumptions. Since we are now dealing with strictly
continuous random variables, we will
work with the joint probability density function, which is

4. Work in the sample space. This is the point at which the never-fail method for
deriving distributions comes
into play. We want the probability law of

Here, in our general notation, N = 2 and M = 1 and we are confronted with what is sometimes called a 2-to-1 transformation.

To apply the never-fail method for finding the cdf of D, F_{D}(y), we first locate the
region in the (X_{I}, X_{2}) sample space
corresponding to the event (D < y). Formally, the steps are written as follows:

To remove the absolute value operator, we consider two cases separately: case 1: X

Step b of the never-fail method requires that we integrate f

we have now completed step b of the never-fail method and we are "done." [What do we know about F

Should we desire the pdf of D, we differentiate, obtaining

From the pdf (or cdf) we can determine anything that is desired concerning D. For instance, the expected value (or mean value) of D is

These results will be of use in our further work.

A system administrator may be interested in knowing the effects
on travel distance of prepositioning the ambulette at
the center of the interval depicting the highway, thus fixing X_{2}
Then the joint sample space is the straight line indicated in
Figure 3.2. If the new travel distance is D'=|X_{1}-1/2|, the

region for which (D' y) is the line segment of length 2y centered at X

How could this result also be obtained by inspection? The mean and variance are

Thus, a change in deployment policy resulting in an ambulette prepositioned at the center of its service area rather than randomly patrolling its service area reduces mean travel distance by 25 percent, the variance of the travel distance by 62.5 percent, and, perhaps important in "worst-case" analyses, the maximum possible travel distance by 50 percent.

*Question:* How would one determine (or estimate) the joint
distribution function for X_{1} and X_{2} in practice?

*Further work:* Problems 3.2-3.4.

**Extension: Scaling**

We often select the scale of a probabilistic modeling problem for
analytical convenience. For instance, if the
length of highway analyzed in Example I had been 13.72
kilometers, the factor of 13.72 would have occurred in
numerous places (making the analysis obviously less attractive).
Thus, after performing the analysis for a
conveniently scaled problem, we often rescale it to suit the
real-world situation at hand. Scaling can also occur when
switching systems of measurement, say from British units to
metric units.

Suppose that we have derived the probability law for W, given one
scale, and we wish to find the moments and
the probability law of

In words, multiplying a random variable by a constant results in its variance being multiplied by the square of that constant.

We can also derive the probability law of V (assumed to be
continuous) using the never-fail method. The
analysis proceeds as follows:

To proceed further, we must distinguish two cases:

These equations constitute the answer to our problem. For instance, in the ambulette example, if a = 13.72 kilometers and b = 71.09 kilometers, we would be modeling a 13.72-kilometer stretch of highway starting 71.09 kilometers from the origin. Returning to the patrolling ambulette example, the cdf for X

You might find it helpful to sketch several different applications of this result.

Suppose we are interested in the coordinates that determine a dispatch incident, X

Since we have already performed Steps 1-3 in describing the experiment, we are ready to go to Step 4 (work in the sample space) and employ the neverfail method. The random variables that are functions of the original random variables are

We wish to derive the joint probability law for R and L. This is sometimes called an N = 2-to-M = 2 transformation. To execute step a of the never fail method, we proceed formally as follows:

To proceed from here, we consider separately each of the two events in braces and "merge" these later by intersection.That is, we can write

To determine the set of points in the (X

Proceeding in a similar manner for Min (X_{1}, X_{2}) 1, we again
consider case 1: X_{1} X_{2}, and case 2: X_{1}
X_{2}. For
case 1, Min (X_{1}, X_{2}) = X_{2} and the event Min
(X_{1}, X_{2}) 1
corresponds to the set of points below the line x_{2} = 1 (Figure
3.4). For case 2, Min (X_{1}, X_{2}) = X_{1} and the event Min (X_{1}, X_{2})
1 corresponds to the set of points to the left of the line x_{1}
= 1. Combining these two cases, the event Min (X_{1}, X_{2}) 1
corresponds to the L-shaped region shown in Figure 3.4.

The intersection of the two events found above yields the event of interest, {R r, L l}, shown in the crosshatched region in Figure 3.4. We have now completed step a of the never-fail method,

To carry out step b all we need to do is to integrate the joint
pdf f_{x1, x2}(·) over the region (event) found in Step 1. Again,
because of the special nature of this sample space and its
probability assignment, we can do this by working directly with
areas in the sample space. By computing the relevant areas, we
obtain

The joint R, L sample space is shown in Figure 3.5. The joint pdf of R, L over this triangular region is uniform. Does this make sense intuitively?

Suppose that it is not travel distance we are interested in but rather travel time. If we define random variables

time is related to distance and speed by the familiar equation

In general, to obtain the pdf of T we would require the joint pdf of D and S, say f

The event corresponding to [D tS) in the (D, S) sample space is shown in Figure 3.6. In principle, all we need do is integrate the joint D, S pdf over this region for each value of t to obtain the cdf for T, F

As a simple example, suppose that the speed of response could assume only two values, S = 1 or S = 2, with equal probability. Assume that distance is distributed as the ambulette response distance of Example 1, independently of the speed of response. Then

This formidable-looking expression represents the pdf of two random variables, one continuous and the other discrete. As long as we keep in mind that pdf's have no probabilistic meaning until we integrate them and that the integration properties of impulses are well defined, we will be in fine shape. (Recall Problem 2.2.)

The joint (D, S) sample space is shown in Figure 3.7. We now
proceed with the never-fail method.

Examining Figure 3.7, we see that the straight line x = ts intersects both "lines" of the sample space for 0 < t < 1/2. So, for those values of t, we have

The "1/2"'s arise from integrating left to right across the impulses; the FD(·) terms arise from integrating from x = 0 to x = ts at s = 1 and s = 2. Since from Example 1, (3.1), we know that

Once t exceeds 1/2 in value, the sweep of the line x = ts no longer picks up additional probability from the "line impulse" at s = 2. So, for 1/2 < t 1, F

This pdf is sketched in Figure 3.8. Note the discontinuity in slope at t=1/2. This is not unusual in practice; in fact, one often comes across problems in which the derived pdf is discontinuous (in value) at one or more points. Points of discontinuity, either in value or slope, usually correspond to "switchover points" in the original sample space in which the summation or integral for accumulating probability for the cdf switches over to some new functional form. Switchovers often occur when the region of accumulated probability changes in geometric form, such as occurred at t=1/2 in the example.

While we have completed our derived distribution work on this
problem, there is one additional issue that we wish to
address and that deals with expected values of random variables.
Here the expected value of T is

We may wish to calculate the expected value simply by working in the (D, S) sample space. Because of independence, if T = h

as calculated previously, This is an illustration of the following general principle:

If one only desires expected values and not the complete probability law of a function of random variables, it is usually computationally easier to work directly in the original sample space to compute the expected values.

There is a second general principle we can illustrate with this
example. When asked to calculate E[T], one may be
tempted to say that

Clearly, this is not correct, the answer being about 11 percent less than the correct answer. The error lies in assuming that E[1/S] = 1/E[S].

In general, the expected value of a function of a random variable is not equal to the function evaluated at the expected value of the random variable.

In this case one can prove mathematically that for any
nonnegative random variable S,

Hence, using (E[D]/E[S]) to estimate E[T] in such a case results in an optimistically low estimate of average travel time. In a practical sense these relations imply that an urban service agency cannot infer that, say, a 20-mile/hr average response speed and a 1-mile average travel distance imply a 3-minute average travel time. On the contrary, the average inverse speed could be, say, 0.10 hour/mile; in such a case if travel distance and travel speed are independent, the average travel time is 6 minutes, not 3 minutes.

To this point our derived distribution examples have dealt with sample spaces in which all random variables had finite maximum and minimum values. This is not a necessary requirement, and many derived distribution problems, such as the case considered here, allow one or more random variables to assume infinitely large (positive or negative) values.

Suppose an urban vehicle is located at (X_{0}, Y_{0}). An automatic
vehicle location (AVL) system utilizes one of the several
available technologiesz to estimate the location of the vehicle.
Such an application is relevant in police departments,
taxicab services, maintenance services, and numerous other urban
services. Suppose that the estimated position of the
vehicle is given by

Y = Y

where the standard deviation specifies the resolution of the system. It now makes sense to examine properties of the "radius of error"

To derive the probability law of R we work in the (X

Because of the circular symmetry of the situation, we find it easier to evaluate this integral by changing to polar coordinates and , where

These relationships are shown in Figure 3.9. Since the infinitesimal area to be integrated changes from dx dy to d d, we can write

Carrying out the final integration, we find that

Notice that this pdf behaves as we might expect intuitively: it starts at zero at r = 0 and grows monotonically to a maximum (which occurs at r =) and then decreases monotonically in an exponential way according to r

Among other applications, the Rayleigh probability law arises in physics in various scattering experiments and in communication theory in the modeling of noise over a communication channel. We have now seen how it arises as a derived distribution in an urban vehicle location context.

There is an alternative way of deriving the Rayleigh pdf directly
without first finding the cdf. The method is useful in
other applications, as well, in which it is easy to make
infinitesimal probability arguments. However, when in doubt, we
always prefer to resort to the never-fail cdf method. The direct
method proceeds as follows : since a pdf has a probability
meaning only if it is integrated, we "integrate" f_{R}(r) over the
infinitesimal interval [r, r + dr),

Again because of circular symmetry, we change to polar coordinates and 6, with = r and d = dr, thereby obtaining

as previously derived. We used such an infinitesimal argument when showing in Section 2.12 that the Ith-order interarrival time of a Poisson process has an Ith-order Erlang pdf. However, again we caution those computing derived distributions that this "infinitesimal" method for finding the pdf directly is fraught with potential pitfalls and difficulties for all but the simplest problems. Thus, the never-fail cdf method remains our primary tool for deriving distributions.

As another example of deriving distributions of random variables, we consider a problem that arises in transportation systems (e.g., "dial-a-ride" systems, taxicab systems), emergency services (fire, police, and ambulance), and other municipal systems having mobile units. The problem deals with the "penalty" in travel distance incurred by a mobile unit while traveling a grid of streets, compared to a helicopter or other unit that could travel "as the crow flies."

If the mobile unit is located at (x_{1}, y_{1}) and is traveling along
a shortestdistance path to (x_{2}, y_{2}) perhaps to pick up a
passenger, then the right-angle distance between the points is

If street directions are parallel to the coordinate axes, the right-angle distance (also called Manhattan, metropolitan, or rectangular distance) is a good approximation for the actual travel distance covered.

Of interest in designing computer dispatching algorithms and in developing planning models, the ratio of the right angle to the Euclidean distance provides insight as to the extra distance traveled because of the requirement of driving on streets. For instance, if one knew the average value of this ratio, then in a computer dispatching algorithm it might be acceptable to estimate the travel distance as the product of this average value and the Euclidean distance, the latter being obtained easily from a file of (x, y) coordinates.

Consider two points (X_{1}, Y_{1}) and (X_{2}, Y_{2}),
corresponding to the
trip origin and destination, respectively, defined
relative to any fixed coordinate system. Let
(0
/2) be
the angle at which the directions of travel are rotated with
respect to the straight line connecting the two points (see
Figure 3.10). Given , the right-angle travel distance between
(X_{1}, Y_{1}) and X_{1}, Y_{1}) is

We wish to derive the cdf of R using the never-fail method, making reasonable assumptions about the probabilistic behavior of .

Here we are deriving the distribution of one continuous random variable which is expressed as a function of another continuous random variable (i.e., a "one-to-one" transformation). The cdf of R is

The event corresponding to (R r) in the sample space is shown in Figure 3.11. Now in a large, uniform city it makes sense to assume that is uniformly distributed over [0, /2]. (Why?) We call this an isotropy assumption, meaning sameness regardless of direction. Given the isotropy assumption, we can integrate the pdf of over the event indicated in Figure 3.11 to obtain

Thus, "on the average" the mobile unit travels about 1.273 times the Euclidean distance (given the model assumptions). Since = 0.0155, the ratio

As a final detailed example of a derived distribution problem, we consider a situation in which two continuous random variables give rise to one discrete random variable. This 2-to-l transformation arises due to quantization of odometer readings in urban vehicles. The same analysis applies in other quantization settings, for instance in cases where successive event times are quantized.

Assume that we are running an experiment to estimate the
distribution of distance traveled by taxicabs, where distance

D miles traveled from the moment of
dispatch to arrival at the
address of the caller

All we have available experimentally are recorded travel
distances, which are quantized as 0 miles, I mile, 2 miles, and so
on. We wish to examine the quantitative effects of such
truncation. Quite clearly, the same model could be used for
studying
response distances of emergency vehicles, "paid" trips of
taxicabs, trips of dial-a-ride vehicles, etc.

For a journey of length D, the recorded travel distance equals
the sum of D and the accumulated odometer mileage at the
moment of dispatch since the last odometer reading change, the
sum truncated to the largest integer not exceeding the sum.
For instance, if the vehicle had traveled 0.9 mile since the last
reading change and then traveled 1.2 miles to the address of
the caller (following dispatch), the recorded mileage would be
the largest integer not exceeding (0.9 + 1.2) = 2.1, which is
2 (miles). If, however, the noninteger accumulated odometer
mileage at the moment of dispatch had been 0.6 rather than
0.9, the recorded mileage would be the largest integer not
exceeding (0.6 + 1.2) = 1.8, which is I mile. In the first case,
the
odometer's mileage reading had changed twice; in the second,
once. As examples will clearly demonstrate, the recorded
travel distance can either underestimate or overestimate the
actual travel distance by as much as I mile.

*Solution*

**Random Variables**

There are two key random variables that give rise to the
quantized distance random variable:

D actual travel distance

accumulated noninteger
odometer mileage at the moment
of dispatch (a random variable distributed over [0, 1))

If we let the quantized distance random variable be

K recorded mileage for the journey

Then K is a function of D and :

Here we have a discrete random variable expressed as a function of two continuous random variables. If we have the joint probability law for D and ), we would like the probability law for K.

The (D, ) sample space is the infinite strip of width 1 (0 < D < , 0 1), shown in Figure 3.12. Without yet assigning a probability law over this sample space, we have performed in Figure 3.12 the "work" required to find the sets of points in the sample space that give rise to different values

of the random variable K. We illustrate the derivation of one of the "45° lines" partitioning the sample space. Suppose that the experimental value for D lies between 1 and 2 (i.e., 1 d 2). Then, for "sufficiently small" , K will equal 1; otherwise, K will equal 2. The switch from K = 1 to K = 2 will occur at the point at which d + = 2. Thus, the switch occurs along the line

Without knowing the exact distribution for D, we can make some further progress in our analysis of the effects of quantization. From physical considerations, the following assumptions seem reasonable:

- The random variables D and are
*independent*. - is
*uniformly distributed*over [0,1]. (Why?)

Since entire subregions of the (D, )
sample space give rise to
exactly one value of K, we can deal directly with the pmf
for K, not the cdf. Given the assumptions regarding f_{D},
(d,)
above, if the cdf for D is known, say F_{D}(·), the probability
mass function for K is readily computed:

Thus, any statistical procedure using experimental data to estimate E[K] should also yield an (unbiased) estimate of E[D]. For such a procedure to remain unbiased, it is necessary that zero-mileage journeys be recorded and used in the statistical tabulations.