10. Hypothesis Testing Methods and Confidence Regions 609
3.3 Expectation of a Function of Random Variables
Many cases arise in practice where one is interested in the expectation of a function of a random variable rather than the expectation of a random variable itself. For example, the profit on a stock investment will be a functionof the difference between the per share buying and selling prices of the stock, and the net return on an advertising campaign is afunctionof consumer buying response to the campaign—both the stock selling price and consumer buying response might be viewed as random variables. How should E(Y) be determined when y ẳg(x), x∈R(X), andXhas density functionf(x)? By definition, if we know the density ofY,h(y), then
EðYị ẳ Z 1
1y dHðyị ẳ
P
y2RðYị
yhðyị ðdiscreteị R1
1yhðyịdy ðcontinuousị 8<
:
where Hðyị is the cumulative distribution function. To use this expectation definition directly, one would need to establish the density of Y. This can be done in principle by exploiting the functional relationship between y and x, given knowledge of the density f(x), but finding h(y) can sometimes be challenging (we will examine methods for deriving such densities in Chapter6). Fortunately, one does not need to derive the density function ofy to obtain E(Y).
118 Chapter 3 Expectations and Moments of Random Variables
SinceYis defined via a composition of the functionsgandX, and since the domain of X is conceptually the sample space S, then Y is defined on the elements ofSvia the composition, i.e., an outcome ofycan be viewed as being given byy ẳg(X(w)) forw∈S, so thaty:S!R. This implies that the range ofY and probabilities of events forYcan be represented alternatively as
RðY) = fy:yẳgðxị;x2RðX)g =fy:yẳgðXðwịị;w2Sg and
PYðAị ẳPX(fx:gðxị 2A;x2RðX)g ) =P(fw:gðXðwịị 2A;w2Sg):
Therefore, we can concentrate our attention on thegfunction component of the composition, which has a real-valued domain R(X), and conceptualize the outcomes of Yas being generated byy ẳg(x) for x∈R(X), wherey: R(X) !R. In so doing, we lose no information concerning the possible outcomes ofYor the probabilities of events forY, and we gain the convenience of being able to ignore the original probability space {S,ϒ,P} and deal exclusively with a real-valued domain for the functionY. We will generally focus on this latter interpretation of the functionYin our subsequent study, unless we make explicit reference to the domain ofYas beingS.
We now present a theorem identifying a straightforward approach for obtaining the expectation of Yẳg(X) by using density weightings applied to the outcomes ofX.
Theorem 3.2 Expectations of Functions of Random Variables
LetXbe a random variable having density function f(x).Then the expectation of Yẳg(x)is given by6
EðgðXịị ẳ Z 1
1gðxịdFðxị ẳ
P
x2RðXịgðxịfðxị ðdiscreteị R1
1gðxịfðxịdx ðcontinuousị 8<
:
Proof See Appendix n
Example 3.5 Expectation of Profit Function
Let the daily profit function of a firm be given byP(X)ẳpq(X)rX, whereXis a random variable whose outcome represents the daily quantity of a highly per- ishable agricultural commodity delivered to the firm for processing, measured in hundredweights (100 lb units), pẳ5 is the price of the processed product per pound,rẳ2 is the cost of the raw agricultural commodity per pound, and qðxị ẳx:9 is the production function indicating the relationship between raw
6It is tacitly assumed that the sum and integral are absolutely convergent for the expectation to exist.
and finished product measured in hundredweights. Let the density function ofX bef(x)ẳ1110ỵ2xI[0,10](x). What is the expected value of daily profit?
Answer: A direct application of Theorem 3.2 yields EðPðXịị ẳ
Z 1
1Pðxịfðxịdxẳ Z 10
0
5x:92x
1þ2x 110
dxẳ13:77:
Since quantities are measured in hundredweights, this means that the expected
profit is $1,377 per day. □
Example 3.6 Expectation of Per Unit Profit Function
Your company manufactures a special 1/4-inch hexagonal bolt for the Defense Department. For the bolt to be useable in its intended application, the bolt must be manufactured within a 1 percent tolerance of the 1/4-inch specification. As part of your quality assurance program, each bolt is inspected by a laser measur- ing device that is 100 percent effective in detecting bolts that are not within the 1 percent tolerance. Bolts not meeting the tolerance are discarded. The actual size of a bolt manufactured on your assembly line is represented by a random variable,X, having a probability density f(x)ẳ(.006)1I[.247, .253](x), wherex is measured in inches. If your profit per bolt sold is $.01, and if a discarded bolt costs your company $.03, what is your expected profit per bolt manufactured?
Answer: We define a discrete random variable whose outcome represents whether a bolt provides the company with a $.01 profit or a $.03 loss. Specifi- cally,Yẳg(X)ẳ.01(I[.2475, .2525](X)).03 (1I[.2475, .2525](X)) is the function ofX that we seek, whereyẳ.01 ifx∈[.2475, .2525] (i.e., the bolt is within tolerance) andyẳ .03 otherwise. Then
EðYị ẳEðgðXịị ẳ Z :253
:247
gðxịfðxịdx
ẳ:01Pð:2475x:2525ị :03ẵ1Pð:2475x:2525ị
ẳ:01ð:833ị :03ð:166ị ẳ:0033: □
The reader should note that in the preceding example, whileXwas acontin- uousrandom variable,Yẳg(X) is adiscreterandom variable. WhetherYẳg(X) is discrete or continuous depends on the nature of the functiongand whetherX is discrete or continuous. The reader should convince herself that ifXis discrete, thenY must be discrete, but if Xis continuous, then Ycan be continuous or discrete (or mixed discrete-continuous).
Upon close examination of Example 3.6, the reader may have noticed that the expectation of an indicator function equals the probability of the set being indicated. In fact, any probability can be represented as an expectation of an appropriately defined indicator function.
Theorem 3.3 Probabilities Expressed as Expectations
Let X be a random variable with density function f(x),and suppose A is an event for X. ThenEðIAðXịị ẳPðAị.
120 Chapter 3 Expectations and Moments of Random Variables
Proof By definition,
EðIAðXịị ẳ
P
x2RðXị
IAðxịfðxị ẳ P
x2A
fðxị ðdiscreteị R
1
1IAðxịfðxịdxẳ R
x2A
fðxịdx ðcontinuousị 8>
><
>>
:
9>
>=
>>
;ẳPðAị n
It should be noted that the existence of E(X) does not imply that E(g(X)) exists, as the following example illustrates.
Example 3.7 Existence of EðXị6 ) Existence of EðgðXịị
Let X be a random variable with density function f(x)ẳ(1/2)I{0,1}(x). Then EðXị ẳ01=2ỵ11=2ẳ1=2. Define a new random variableYẳg(X)ẳX1. Since
1=0
j jð1=2ị ỵj1=1jð1=2ị≮1, E(g(X)) does not exist. □ The preceding example also illustrates that, in general, E(g(X)) 6ẳg(E(X)), because E(X)ẳ1/2, so thatg(E(X))ẳ(E(X))1ẳ2, which doesnotequal E(g(X)) since E(g(X)) does not exist. In the special case where the function g is either concave or convex,7there is a definite relationship between E(g(X)) andg(E(X)), as indicated by the following theorem.
Theorem 3.4 Jensen’s Inequalities
Let X be a random variable with expectationE(X), and let g be a continuous function on an open interval I containingR(X).Then
(a) E(g(X))g(E(X)) if g is convex on I, and E(g(X)) >g(E(X)) if g is strictly convex on I and X is not degenerate8;
(b) E(g(X)) g(E(X)) if g is concave on I, and E(g(X)) <g(E(X)) if g is strictly concave on I and X is not degenerate.
Proof See Appendix. n
Example 3.8 Expectation of Concave Function
Suppose that the yield per acre of a given agricultural crop under standard cultivation practices is represented byYẳ5X.1X2, where outcomes ofYare measured in bushels, andXrepresents total rainfall during the growing season, measured in inches. If E(X)ẳ20, can you place an upper bound on the expected yield per acre for this crop?
Answer: Yes. Note that Yẳ5X.1X2is aconcave function, so that Jensen’s inequality applies. Then E(Y)ẳE(g(X)) g(E(X))ẳ5E(X).1(E(X))2ẳ60 is an upper bound to the expected yield. In fact, the function is strictly concave, and so the inequality can be made strict (it is reasonable to assume that rainfall is not a degenerate random variable).
7Acontinuous function,g, defined on a setDis called concave if8x∈D,9a line going through the point (x,g(x)) that lies on or above the graph ofg. The function is convex if8x∈D,9a line going through the point (x,g(x)) that lies on or below the graph ofg. The function is strictly convex or concave if the aforementioned line has only the point (x,g(x)) in common with the graph ofg.
8A degenerate random variable is a random variable that has one outcome that is assigned a probability of 1. More will be said about degenerate random variables in Section3.6.