Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Homework #10. Spring 2001.
Solution
IE 230
Textbook: D.C. Montgomery and G.C. Runger, Applied Statistics and Probability for
Engineers, John Wiley & Sons, New York, 1999. Chapter 6, Sections 6.1–6.2. Pages
12–13 of the concise notes.
1. (Montgomery and Runger, 1999, page 210)
(a) Problem 6–1. Show that the following function satisfies the properties of a joint
probability mass function.
x
y
f XY (x , y )
iiiiiiiiiiiiiiiii
1.5
2
1/8
1.5
3
1/4
2.5
4
1/2
3
5
1/8
---------------------------------------------------------------------All four probabilities f XY (x , y ) are nonnegative.
The sum of the four probabilities is one.
Therefore the function f XY satisfies the properties of
a pmf if f XY (X , y ) = 0 elsewhere.
---------------------------------------------------------------------(b) Problem 6–2(a). From Exercise 6–1, determine P(X < 2.5, Y < 3).
---------------------------------------------------------------------P(X < 2.5, Y < 3) = P(X = 1.5, Y = 2) = f XY (1.5, 2) = 1 / 8←
←
---------------------------------------------------------------------(c) Problem 6–2(b). From Exercise 6–1, determine P( X < 2.5 ).
---------------------------------------------------------------------P(X < 2.5) = P(X = 1.5, Y = 2) + P(X = 1.5, Y = 3)
= f XY (1.5, 2) + f XY (1.5, 3) = 1 / 8 + 1 / 4 = 3 / 8←
←
---------------------------------------------------------------------(d) Problem 6–3. From Exercise 6–1, determine E( X ) and E( Y ).
---------------------------------------------------------------------E( X ) = Σall (x , y ) x f XY ( x , y )
= (1.5)(1 / 8) + (1.5)(1 / 4) + (2.5)(1 / 2) + (3)(1 / 8)
= 2.188←
←
E( Y ) = Σall (x , y ) y f XY ( x , y )
= (2)(1 / 8) + (3)(1 / 4) + (4)(1 / 2) + (5)(1 / 8)
= 3.625←
←
---------------------------------------------------------------------(e) Problem 6–4(a). From Exercise 6–1, determine the marginal pmf f X .
---------------------------------------------------------------------In general, for every real number x , the marginal pmf is
f X (x ) = P( X = x ) = Σall y f XY (x , y ).
Therefore,
f X (1.5) = f XY (1.5, 2) + f XY (1.5, 3) = 1 / 8 + 1 / 4 = 3 / 8←
←
f X (2.5) = f XY (2.5, 4) = 1 / 2←
←
f X (3) = f XY (3, 5) = 1 / 8←
←
f X (x ) = 0 elsewhere ←.
---------------------------------------------------------------------- 1 of 5 -
Schmeiser
Homework #10. Spring 2001.
Solution
IE 230
(f) Problem 6–4(b). The conditional distribution of Y given that X = 1.5.
---------------------------------------------------------------------In general, for all real numbers x and y , the conditional pmf is
f
(y ) = P( Y =y | X =x ) = f XY (x , y ) / f X (x ).
Y | X =x
Therefore,
f
f
f
(2) = f XY (1.5, 2) / f X (1.5)
Y | X =1.5
= (1 / 8) / (3 / 8) (from above)
= 1 / 3←
←
(3) = f XY (1.5, 3) / f X (1.5)
Y | X =1.5
Y
|
= (1 / 4) / (3 / 8) (from above)
= 2 / 3←
←
(y ) = 0 elsewhere ←.
X =1.5
---------------------------------------------------------------------(g) Problem 6–4(c). The conditional distribution of X given that Y = 2.
---------------------------------------------------------------------In general, for every real number x , the conditional pmf is
f
(x ) = P( X = x | Y = y ) = f XY (x , y ) / f Y (y ).
X | Y =y
Therefore,
f
f
(1.5) = f XY (1.5, 2) / f Y (2)
X | Y =2
X
|
= (1 / 8) / (1 / 8) (since f Y (2) = f XY (x =1.5, y =2))
= 1←
←
(x ) = 0 elsewhere ←.
Y =2
---------------------------------------------------------------------(i) Problem 6–4(d). Determine E(Y | X = 1.5).
---------------------------------------------------------------------In general, for any real number x , the conditional mean of Y is
E(Y | X = x ) = Σall y y f
.
Y | X =x
Therefore,
E(Y | X = 1.5) = (2)f
(2) + (3)f
Y | X =1.5
(3)
Y | X =1.5
= (2)(1 / 3) + (3)(2 / 3) = 8 / 3←
←
----------------------------------------------------------------------
- 2 of 5 -
Schmeiser
Homework #10. Spring 2001.
Solution
IE 230
2. (A multinomial problem.) Background. In standard two-parent genetics, each parent
contributes one gene to each off-spring. Genes are dominant or recessive. In eye color,
for example, brown-eye genes dominate green-eye genes. That is, to have green eyes
the off-spring must inherit green-eye genes from both parents. If either gene is browneye, then the off-spring’s eyes will be brown. Each parent contributes one of its two
genes with equal probability, regardless of it being dominant or recessive.
Consider two parents with eye genes ( B , G ) and ( G , G ), where B denotes the brown-eye
gene and G denotes the green-eye gene.
(a) What is the probability of a particular off-spring being ( B , B )? ( G , G )? ( B , G )?
(( B , G ) is equivalent to ( G , B ).)
---------------------------------------------------------------------Assume that genes are passed independently and
that each type of gene is equally likely.
The parents are ( B , G ) and ( G , G ).
Then the multiplication rule yields
P(( B , B )) = (1 / 2)(0) = 0
P(( G , G )) = (1 / 2)(1) = 1 / 2
P(( B , G )) = (1 / 2)(1) = 1 / 2
---------------------------------------------------------------------(b) What is the probability of a particular off-spring having brown eyes? Green eyes?
---------------------------------------------------------------------P("brown eyes") = P(( B , B )) + P(( B , G ))
= 0 + 1 / 2 = 1 / 2←
←
P("green eyes") = P(( G , G ))
=1 / 2←
←
(Or notice that the event "green eyes" is complementary to "brown eyes".)
---------------------------------------------------------------------(c) Suppose that the parents have 4 off-spring? Determine the probability that two are
( B , B ), one is ( G , G ) and one is ( B , G ).
---------------------------------------------------------------------Assume that the off-springs’ genetics are independent.
Then this is a multinomial question, with the 4 off-spring being trials.
Let p 1 = P(( B , B )) = 0.
Let p 2 = P(( G , G )) = 1 / 2.
Let p 3 = P(( B , G )) = 1 / 2.
Let Xi , i = 1, 2, 3, denote the number of ( B , B ), ( G , G ) and ( B , G ) off-spring.
Then
P(X 1 = 2, X 2 = 1, X 3 = 1)
4
2
1
1
= C 2,1,1p 1 p 2 p 2
2
1
1
= [4! / (2!1!1!)] 0 (1/2) (1 / 2)
= (12) (0) (1/2) (1 / 2) = 0←
←
Or simpler would be to notice initially that no off=spring can be ( B , B ).
----------------------------------------------------------------------
- 3 of 5 -
Schmeiser
Homework #10. Spring 2001.
Solution
IE 230
(d) Suppose that the parents have 4 off-spring? Determine the probability that three
have brown eyes and one has green eyes.
---------------------------------------------------------------------Assume that the off-springs’ genetics are independent.
Then this is a multinomial question, with the 4 off-spring being trials.
Let p 1 = P(" brown eyes" ) = 1 / 2.
Let p 2 = P(" green eyes" ) = 1 / 2.
Let Xi , i = 1, 2, denote the number of brown-eyed and green-eyed off-spring.
Then
P(X 1 = 3, X 2 = 1)
4
3
1
= C 3,1 p 1 p 2
3
1
= [4! / (3!1!)] (1 / 2) (1 / 2)
= (4) (1 / 8) (1 / 2) = 1 / 4←
←
(Notice that we have grouped ( B , B ) and ( B , G ), so that
now each off-spring is one of two, rather than three, types. The
multinomial distribution with k =2 outcomes is the binomial distribution.)
---------------------------------------------------------------------(Notice the point being made about the relationship between the multinomial distribution
with three outcomes and the binomial distribution (with two outcomes).)
- 4 of 5 -
Schmeiser
Homework #10. Spring 2001.
Solution
IE 230
3. Computing with very small and very large numbers. (Do not submit an MSExcel spread
sheet.) First read the handout (on the web page) about computing probabilities using the
gamma function and logarithms.
(a) Determine the largest value of x so that f act (x ) does not overflow. Write the
command, the argument value, and the function value.
----------------------------------------------------------------------
fact(170) = 7.257E +306
---------------------------------------------------------------------(b) Write the MSExcel cell command to evaluate 4! using the gammaln function.
---------------------------------------------------------------------Because r ! = Γ(r +1), use "exp(gammaln(5)) = 24".
---------------------------------------------------------------------(c) Using "exp", "ln", and "gammaln" functions, write the MSExcel cell command to
evaluate the gamma pdf f X ( 80.2 ) for r = 44.3 and λ = 0.4. Write its value.
---------------------------------------------------------------------In general, for positive real numbers x , the gamma pdf is
r r −1 −λx
f X (x ) = λ x
e
/ Γ(r ).
This pdf can be rewritten as
f X (x ) = exp(r lnλ + (r −1)lnx − λx − ln(Γ(r ))).
(The new formula contains numbers much smaller than those in the original formula.
Large numbers divided by large numbers can cause numerical computation problems.)
We have x = 80.2, r = 44.3, and λ = 0.4, which yields
f X (80.2) = exp(44.3ln 0.4 + (44.3−1)ln 80.2 − 0.4 × 80.2 − ln(Γ(44.3))).
---------------------------------------------------------------------(d) Write MSExcel code and value for the probability in 2(c). (You might want to check
your answer with the "gammadist(80.2,44.3,2.5,0)".)
---------------------------------------------------------------------Converting to MSExcel commands yields
f X (80.2)= exp(44.3* ln(0.4) + (44.3−1)* ln(80.2) − 0.4* 80.2−gammaln(44.3))
.
This formula yields the same value as the MSExcel command
=gammadist(80.2, 44.3,2.5, 0) = 0.004137.
(Notice that MSExcel parameterizes the gamma distribution
using scaling parameter 1 / λ = 1 / 0.4 = 2.5 rather than λ.
The choice of parameter is arbitrary, so be careful whenever
using new statistical software.)
Why ever provide your own code? Try "gammadist(80.2, 244.3, 2.5, 0)",
which returns "#NUM!", whereas our formula returns 4.57E −125.
----------------------------------------------------------------------
- 5 of 5 -
Schmeiser