0% found this document useful (0 votes)
26 views27 pages

Random Var Dist

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views27 pages

Random Var Dist

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Random variables and probability distributions

Random variables, or rv’s are used mainly for the purpose to quantify events. So that probability
distribution will be with respect to a number, or a scale. The resulted study is more analytic.
Sometimes the events are themselves numerical in nature. Number of objects such as vehicles, incidences.
Measurements such as weights or heights. We will use expressions in the rv’s to replace events.
Example. A special tire are made in pairs due to the machine. Now let the rv X be the number of non-
defective tires in a pair. Then we have:
Expression Event
X=0 None is non-defective.
X=1 Exactly one is non-defective.
X=2 Exactly two are non-defective.
X≤1 No more than one is non-defective.
X<2 Less than two…
X≥1 No less than one ….

Example. Let the rv be the monthly precipitation in a certain region. Or the average temperature of a
region. It is straight-forward to see the event X > 30, or 10 <X < 25. With suitably defined pdf,
probabilities, that is, areas, can be calculated with integration.

There are two types of random variables, discrete and continuous. The differences between them are self-
explained. One must be careful since some of the popular quantities seem to be discrete but actually are
continuous. Being seemingly discrete is the result from rounding.
Still, the aim is at the distribution, probability distribution, now.
It is senseless to ask what value a random variable will turn out to be. Because it’s uncertain. Rather, the
target is the probability distribution.
The type of distributions for the two kinds of r.v.’s are different. We use tables for the discrete and curves
for the continuous.
It is really not that simple.
Discrete rv’s take on separated numbers. They can be either the number or not at all. So for the discrete,
we use probability “mass” at the possible values to show the likelihood.
Example 1
x P(X=x)
0 0.2 One can plot the
1 0.3 distribution.
0 1 2
2 0.5

Example 2 A branch office of a delivery company recorded the number of packages brought in by individual
customers to formulate the following distribution table.
x 1 2 3
P(X = x) 0.5 0.3 0.2
This kind of distribution is called the probability mass functions, pmf, or simply pf.

Continuous rv’s can be any number in an interval. The probability can no longer be evaluated with respect
to points.
So, instead, the probability will be expressed with areas, areas under a curve representing the distribution.
b
Example 3:
x P(a ≤ x ≤ b)= a

f ( x)dx
P ( X≤x ) =∫−∞ f (s)ds
P(X=x) f(x)
a b

The function f(x) is the probability density function, pdf. It is equivalent to the ordinary distribution curve
we used to look at. The area under the curve on an interval [a, b] is defined to be the probability P(a ≤X≤b).
Quite different from the idea for discrete rv’s. Since any point doesn’t occupy area, it doesn’t matter
whether < or ≤ is used here.
For any continuous type r.v. X, P(X=x)=0, ∀x.
Conditions for probability mass functions.
Conditions for probability density functions.


(1) f(x) ≥ 0 (2) −∞
f (x)dx=1
(CDF) Sometimes it is easier to use the CDF of a rv to figure out the probabilities.
Cumulative dist. function CDF is defined to be
F(x)=P(X ≤ x).
When continuous, P(a ≤ x ≤ b) = P(a < x ≤ b)=…= etc. Once f(x) is known, we know that P(a ≤ x ≤ b)=
b x
∫a f ( x)dx , and the CDF, F(x)= ∫−∞ f ( s)ds . Then we have P(a ≤ x ≤ b)=F(b)−F(a). (This is actually the
Fundamental Theorem of Calculus.)
Conditions for a CDF.
(1) Non-deceasing. (2) F(−∞ ¿=0 , F (∞ )=1.
Points about cumulative distribution function (CDF) of random variables.
Cumulative distribution functions (CDF’s) seem to be an even better tool in calculating probabilities.
Beginners tend to accept probability functions better than they do CDF’s since the former gave better
representation of the idea of distribution. Indeed, there are something about CDF’s which make them
repulsive. Here they are.
Example1. CDF of a discrete random variable with the following probability function.
x 0 1 2 3 4 5
P(X=x) 0.18 0.39 0.24 0.11 0.04 0.04
P(X≤ x ¿ 0.18 0.57 0.81 0.92 0.96 1.00
Example2. The CDF of a Uniform distribution over [a, b] is defined as

{
0, if x < a,
x-a
F(x)= , if a ≤ x < b,
b-a
1, if b ≤ x.

Example3. The CDF is defined as

{
0, if x<0,
8x
F(x)= , if 0≤x<30,
30+7x
1, if 30≤x.
Example4. This is EXP(0.04). The CDF is
F(x)=1- e -0.04x .

(How to find probabilities corresponding to a number or an interval using the CDF.)

If, say, P(X<20) is desired, draw a vertical line at x=20. The y-coordinate of the intersection point with the
CDF is your answer.
P(X<20)=0.55067, P(X<60)=0.90928, P(20<X<60)=0.90928-0.55067=0.35861
If a certain percentile is desired, do it in the reverse order.
Note that for discrete CDF, it often happens that horizontal lines will not cross the CDF. It goes back to the
definition that the rth percentile is the lower bound of all the quantities such that r% of the elements fall
below.
You see now why percentiles were not discussed in details for discrete rv’s.
Take a look at the standard normal distribution, the CDF is like this.

Theoretically, it takes integration to calculate the areas under curves. Thanks to computer systems, we
don’t have to struggle with the calculation. With a well-prepared CDF table, or a simple CDF itself, we are
able to calculate the probabilities desired.
介紹計算方法(不用積分的情況下)
Example Exponential distribution with λ .
P( X ≤a )=1−e−λa
P ( a≤ X ≤b )=e− λb− e− λa
Suppose λ=2.5 , then P(X<2)=_____________.
Suppose λ=2.5 , the median of the distribution is ______________.
Example Suppose the shelf-life of a certain item, in days, has the following CDF.

{
0 ,if x ,
F ( x )= , if 0< x <30 ,
1 ,if x .

(a) What is P(X¿ 24| X>18)?(0.96)


(b) What is the 85th percentile of the distribution?(12)

Remember standard normal distributions?


Suppose that Z~N(0,1), find the following probabilities:
a. P(Z≤1.62)= b. P(Z≥1.03)=
c. P(Z≤-0.89)= d. P(Z≥-2.02)=
e. P(-0.1 ≤Z ≤1.22)= f. P(0.03 ≤Z ≤1.83)
th
Suppose Pa is thea percentile, that is, P(Z ≤ Pa))=a
Suppose Z~N(0,1), find the following percentiles.
a. P75.80= b. P24.20=
c. P97.50= c. P2.50=
data a;input x y ; data a;
cards; do x=0 to 120 by 0.1;
0 0.18 y=1-exp(-0.04*x);
1 0.57 output;end;
2 0.81 data a1;input x1 y1 @@;
3 0.92 cards;
4 0.96 20 .55067 20 0
5 1.00 ;
; data a2;input x2 y2 @@;
data a;set a; cards;
y1=lag(y); 20 .55067 0 .55067
if y1=. then y1=0; ;
data a1;input u1 v1 u2 v2 u3 v3 u4 v4 u5 v5 u6 v6 u7 v7;
cards; data a3;input x3 y3 @@;
-1 0 0 0.18 1 0.57 2 0.81 3 0.92 4 0.96 5 1.0 cards;
-0.03 0 0.97 0.18 1.97 0.57 2.97 0.81 3.97 0.92 4.97 0.96 6 1.0 60 .90928 60 0
; ;
data a;set a a1; data a4;input x4 y4 @@;
axis1 order=-1 to 6 by 1; cards;
axis2 order=-0.1 to 1.1 by 0.1; 60 .90928 0 .90928
symbol1 c=black v=dot i=none h=2; ;
symbol2 c=black v=circle i=none h=2; data a5;input x5 y5 @@;
symbol3 c=black v=none i=join w=4; cards;
symbol4 c=black v=none i=join w=4; 20 0.55067 60 0.55067
symbol5 c=black v=none i=join w=4; ;
symbol6 c=black v=none i=join w=4; data a;set a a1 a2 a3 a4 a5;
symbol7 c=black v=none i=join w=4; symbol1 c=black i=join v=none w=5;
symbol8 c=black v=none i=join w=4; symbol2 c=green i=joint v=none w=4;
symbol9 c=black v=none i=join w=4; symbol3 c=red i=joint v=none w=4;
symbol10 c=black v=none i=join w=4; symbol4 c=magenta i=joint v=none w=4;
proc gplot; proc gplot;
plot y*x y1*x v1*u1 v2*u2 v3*u3 v4*u4 v5*u5 v6*u6 v7*u7 plot y*x=1 y1*x1=2 y2*x2=2 y3*x3=3 y4*x4=3
/overlay vaxis=axis2 haxis=axis1 href=-1 to 6 by 0.5 vref=-0.1 to y5*x5=4/overlay
1.1 by 0.1; vref=0 to 1 by 0.1 href=0 to 120 by 5 ;
run; run;
data a; data a;
do x=0 to 30 by 0.1; do x=-3 to 3 by 0.01;
y=8*x/(30+7*x); y=probnorm(x);
output;end; output;
symbol c=black i=join v=none w=8; end;
proc gplot; symbol c=blue i=join v=none w=5;
plot y*x/vref=0 to 1 by 0.1 href=0 to 30 by 5; proc gplot;
run; plot y*x/vref=0 to 1 by 0.1 href=-3 to 3 by 0.5;
run;

Bivariate distribution.
Joint distribution of two rv’s.
(Joint distribution of two continuous rv’s is not intensively discussed here because it’s not for elementary
Statistics.)
Example: Glass bottles. X is the number of bubbles. Y is the number of foreign particles.製
Y
0 1 X P(X=x) Y P(Y=y)
0 0.60 0.10 0.70 0 0.7 0 0.8.
X 1 0.12 0.08 0.20 1 0.2 1 0.20
2 0.08 0.02 0.10 2 0.1
0.80 0.20 1.00
Marginal distributions.
Joint distribution.
Parameters of the distribution. Mean and variance.
Expected value of a function of rv’s.
Calculation of parameters of probability distributions starts here.

E[X]= ∑ xP ( X=x )
σ 2 {X }= Ε[( x−Ε[ X ])2 ]=∑ ( x−Ε [ X ] )2 P( X =x )=Ε [ X 2 ]−( Ε [ X ] )2

E[‧] is called the expected value of .‧


2
=E[X] is defined to be the mean and σ = Ε [( X−Ε [ X ]) ] the variance.
2

2 2
(What about { Χ̄ , S ¿ ? { Χ̄ , S ¿ are sample statistics. Think about how they are calculated.)
Different symbols popularly used.
 = E[X] = μ x
σ 2=σ 2 {X }=Ε[ ( x−Ε [ X ] )2 ]=Ε [ X 2 ] −( Ε [ X ] )2 =Var ( X )=σ 2x

Example: x P(X=x) xP(X=x) x2 P(X=x)


0 0.2 0.0 0.0 σ 2 {X }= Ε [ X 2 ] −( Ε [ X ] )2
2
1 0.3 0.3 0.3 =2.3 − 1. 3
2 0.5 1.3 2.0 =0.61
E[X]=1.3 2
E[ x ] =2.3
Standard deviation is
preferred. Here σ {X }=√ 0 . 61=
About the expectation E[g(X)].
E[‧] represents an operation depending on a random variable, or on its probability distribution. It’s to
compute the weighted sum of the specified function, g(X), of the random variable X. The weight is the
∑ xP ( X=x ) 2
probability mass at the value of the random variable. For instance, E[X]=all x , E[ X ]=
∑ x 2 P( X=x) , etc. And, we have
E[c]= ∑ c P( X =x)=c ∑ P( X =x)=c ,
E[aX]= ∑ a xP( X =x)=a ∑ xP( X=x )=aΕ [ X ] , and
E[aX+b]= ∑ (a x+b)P( X =x)=a ∑ xP( X =x)+b ∑ P( X =x)=aΕ[ X ]+b .
1 1
These can be viewed as properties of a linear operator. Consequently, E[X 2]≠(E [X])2, E[ ¿ ≠ , etc.
X E [X]

When the random variable is of the continuous type, integration is used instead of summation. The formula
changed slightly to the following.
∞ ∞ 2

E[X]= −∞
2 2 2

xf (x)dx , σ {X }= Ε[( x−Ε[ X ]) ]=Ε [ X ]−( Ε [ X ] ) , where E[ X 2 ]= −∞ x f (x)dx .
2

We will leave it since integration is not a prerequisite of this course.

Joint dist.
Example:
Y Y
0 1 0 1
X 0 0.60 0.10 0.70 X 0 x=0∩y=0 x=0∩y=1 x=0
1 0.12 0.08 0.20 1 x=1∩y=0 x=1∩y=1 x=1
2 0.08 0.02 0.10 2 x=2∩y=0 x=2∩y=1 x=2
0.80 0.20 y=0 y=1

P(x=1∩y=1)= P(x=0∩y=1)=
P(x=2)= P(x=0|y=0)=
P(y=0)= P(y=1|x≤1)=
Conditional distribution of X when Y=0, say.
Conditional distribution of Y when X=1, say.
The definition of expectation extends naturally to E[g(X,Y)]=∑ g(x, y)P(X = x ∩ Y = y). Note that the joint
probabilities are used for the weight here. If, in case g(x, y)=g 1 ( x ) + g2 (y), then the computation can be
simplified to using marginal probability distributions.

Review:If, and only if, P(X=i ∩ Y=j) =P(X=i)P(Y=j) ∀i, j, then we say that X and Y are independent.
(Independent is a strong property between two rv’s.)

Obviously the following example is not about two independent rv’s. Let’s look into the relationship revealed
by the joint distribution.
Example: X P(X=x) xP(X=x) x2 P(X=x)
0 0.70 0 0
1 0.20 0.20 0.20 E[X]=0.40
2 0.10 0.20 0.40 σ 2 {X } =0.60-0 . 402
E[X]=0.40 2 =0.44
0.60= E[ x ]

Y P(Y=y) yP(Y=y) y 2 P(Y=y)


E[Y]=0.2
0 0.8 0 0
1 0.2 0.2 0.2 σ 2 {Y } =0.2-0 . 22
0.2 0.2 =0.16
Definition:Covariance of X and Y is
σ XY =¿ {X,Y}=cov(X,Y)=E[(x-E[X])(y-E[Y])]=E[XY]−E[X]E[Y].
Definition:Correlation coefficient of X and Y is
σ {x , y }
ρ xy = σ { x } σ { y } .
This signed number ρ XY lies between -1 and 1. The sign says the nature of the correlation. When ρXY > 0,
we say that X and Y are positively correlated, negatively correlated otherwise. The magnitude is interpreted
as the level of correlation. Heuristically, a number closer to 1 means that the pattern is tight, while a number
closer to 0 means that the pattern is loose. When ρXY =1, it means that Y=aX+b, where a > 0. When ρXY =-1, it
means that Y=aX+b, where a < 0. When ρXY =0, it means no linear association between X and Y is present.
Random variables X and Y are said to be uncorrelated in this case. The difference between being
independent and uncorrelated is interesting. It will be demonstrated with a number of examples.
By the way, the following table shows that different symbols will be used interchangeably.
Description Notations
Mean of random variable X. E[X], μ X
2 2
Variance of random variable X. Var(X), σ X, σ {X}
Standard deviation of random variable X. σ X, σ {X}
Covariance of random variables X and Y. Cov(X, Y), σ X Y , σ {X,Y}
Correlation coefficient of random variables X and Y. ρX Y, ρ {X,Y}

Example:
Y Y Y
0 1 0 21 2 0 1 2
X 0 0.0 0.05 0.25
0 0.1 0. 0.1 0 0.2 0.05 0
1 5
1 0.0 0.30 0.05 1 0.1 0. 0.1 1 0.0 0.30 0.05
5 2 5
2 0.2 0.05 0.0 2 0.1 0. 0.1 2 0 0.05 0.25
5 1
E[X]= E[Y]= {X,Y}= ________ ________ ________
{X}= {Y}= ρ XY = ________ ________ ________

(-1)(-1) (-1)0 (-1)1


(x-E[X])(y-E[Y])之表列 0(-1) 00 01
1(-1) 10 11
Y
0 1 2
X 0 0.09 0.12 0.09 0.3 {X,Y}=
1 0.12 0.16 0.12 0.4 ρ XY =
2 0.09 0.12 0.09 0.3
0.3 0.4 0.3
You now can see that being positively correlated means _____________________.
Being negatively correlated means _____________________
Even with fixed marginal probabilities, uncorrelatedness can be achieved in more than one way. But being
independent can only be one case only, and this case is also one of being uncorrelated. Therefore we say that
independence implies uncorrelatedness but NOT vice versa.
Exercise:
CDF’s

(1)1-3 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

{
1 for x>30,
8x
F(x)= for 0≤x≤30,
30+7x
0 for x<0.

1 What is P(X  20)? (16/17=.9412)


2 What is P(15  X  25)? (200/205-120/135=.0867)
3 What is P(X  20X  10)? ((1-16/17)/(1-8/10)=.2941)

(2)1-3 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

F(x)=1- e -x/20 for x>0.

1 What is P(X  20)? (.6321)


2 What is P(15  X  25)? (.18586)
3 What is P(X  20X  10)? (.60653)

(3)1-3 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

{
1 for x>28,
x-12
F(x)= for 12≤x≤28,
28-12
0 for x<12.

1 What is P(X  18)? (6/16=.375)


2 What is P(17  X  22)? (5/16=.3125)
3 What is P(X  22X  18)? (0.6)

Expected values, Mean and variance


1-2 A branch office of a delivery company recorded the number of packages brought in by individual
customers to formulate the following distribution table.
x 1 2 3
P(X = x) 0.5 0.3 0.2

1 What is the mean of the random variable X? (1.7)


2 What is the variance of the random variable X? (0.61)
Bivariate dist

1(26%) Warren Inc., one of the major manufacturers of TV sets in the country, is making production plans for
the coming season. Let the random variables X and Y denote forecast sales in million dollars in the coming
season for TV set models A and B, respectively. The joint probability distribution table is as follows.

Y
X 1 2 3 4
1 0.080 0.070 0.070 0.060
2 0.075 0.070 0.050 0.075
3 0.050 0.060 0.070 0.080
4 0.035 0.050 0.080 0.025
a(4%) What is P(X2Y2)?
b(12%) Compute the means and standard deviations of X and Y.
c(10%) Compute the covariance and the correlation coefficient of X and Y.
2(12%)The joint probability distribution table of random variables X and Y is given as follows.
Y
X 1 2 3
1 0.27 0.21 0.05
2 0.14 0.12 0.04
3 0.08 0.07 0.02
The following is also given.
Random variable Mean Variance
X 1.64 0.5704
Y 1.62 0.4556
a(6%) Compute the covariance {X, Y} of random variables X and Y. (2.68-1.64x1.62=0.0232)
b(6%) Compute the correlation coefficient {X, Y} of random variables X and Y. (0.0455)

Formulas:
Def. E[X+a]=E[X]+a
σ { X + a }=σ { X }
2 2

Def. E[cX]=cE[X]
σ { cX }=c σ { X }
2 2 2

σ { c1 X 1 , c 2 X 2 } =c 1 c 2 σ { X 1 , X 2 }

Def. E[X±Y]=E[X]±E[Y]
σ { X ± Y }=σ { X }+ σ { Y } ± 2 σ { X ,Y }
2 2 2

General linearity goes


E[aX ± bY ]=aE[X] ±bE[Y]
σ { aX ± bY }=a σ { X } +b σ { Y } ±2 abσ { X ,Y }
2 2 2 2 2

If, in addition, X and Y are independent, then σ 2 { aX ± bY }=a2 σ 2 { X } +b2 σ 2 { Y }


We will see pretty soon the case where there are n iid rv’s X 1 , X 2 , … , X n , then
n
E[c 1 X 1+ c 2 X 2+ …+c n X n ¿=c 1 E[ X 1 ]+c 2 E[ X 2 ]+…+ c n E [ X n ]= μ ∑ c i
i=1

If, further, the population mean is μ. And


n
σ 2 { c 1 X 1 +c 2 X 2+ …+c n X n } =c 21 σ 2 { X 1 }+ c 22 σ 2 { X 2 } +…+c 2n σ 2 { X n }=σ 2 ∑ c 2i
i=1

If, further, the population variance is σ 2.


Probability distributions, popular families.
Not everyone knows that almost all numbers around us have their own particular kind of distribution.
We want to know the distribution for obvious reasons. This can be done by either learn from what has
been done or explore for ourselves. How to determine probability distribution from scratch is important. It
is accepted that there are two ways, subjective and objective ways. They require the same thing: counting.
So we start with the famous principles of counting.

Let’s look at two examples:


Example 1.Five cards are dealt. What is the probability of getting a flush? That is, all 5 cards are of the
same suit.

¿( All5 same suit hands )


=
4 ∙ 13
5 ( )
=0.00198 . ¿
¿ ( All possible hands) 52
5 ( )
Eample 2. Two fair dice are tossed. It is known that the total is greater than 6. What is the probabibility
that at least one of the dice show a number less than 6?

(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)


(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) ¿( All red except the blue) 21−1
=
(3, 1) (3, 2) (3, 3) (3, 4) )3, 5) (3, 6) ¿ (All red ) 21
(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)
(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)
(6, 1) (6, 2) (6, 3) (6,4) (6, 5) (6, 6)

There are some basic principles of counting:


1. Principle of multiplication.
n!
n Pk =
2. Number of different permutation (n−k )!
n!
n C k=
3. Number of different combination k !(n−k )!
n C k can also be denoted as
n
( k)
, read as “n choose k”.

Families of probability distributions. They come in two groups, discrete and continuous.
(1) Discrete type
Discrete Uniform Distribution
Bernoulli(p)
It is denoted by X ~ Bernoulli(p), 0 and 1 are the possible values for X. The distribution is used to model
any trial with only two possible outcomes. The outcomes are denoted by Success (S) and Failure (F).
The rv X is the number of S, thus X=1 means getting a Success, and X=0 a Failure. The distribution
table, or function, goes
X P(X=x)
0 1-p E[X]= p and σ²{X}=p(1-p) can be computed.
1 p
When n identical Bernoulli trials are independently repeated, the resulted rv,s are called a Bernoulli
process, and the sum of them gives rise to a popular distribution, the Binomial distribution.

Binomial (n, p)
The sum of a Bernoulli process has a Binomial (n, p) distribution where n is the number of repetitions, and
the p is the overall success rate. The sum X is the total number of successes out of n trials. The
probability function is

P ( X=x ) =( nx) p (1− p)


x n−x
, x=0, 1,…, n.

Following is a part of Bin (n, p) probability function table. Notice the special correspondence of
probabilities between p and 1-p.
n p 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 x n
6 0 .5314 .3771 .2621 .1780 .1176 .0754 .0467 .0277 .0156 6
1 .3543 .3993 .3932 .3560 .3025 .2437 .1866 .1359 .0938 5
2 .0984 .1762 .2458 .2966 .3241 .3280 .3110 .2780 .2344 4
3 .0146 .0415 .0819 .1318 .1852 .2355 .2765 .3032 .3125 3
4 .0012 .0055 .0154 .0330 .0595 .0951 .1382 .1861 .2344 2
5 .0001 .0004 .0015 .0044 .0102 .0205 .0369 .0609 .0938 1
6 .0001 .0002 .0007 .0018 .0041 .0083 .0156 0 6
7 0 .4783 .3206 .2097 .1335 .0824 .0490 .0280 .0152 .0078 7
1 .3720 .3960 .3670 .3115 .2471 .1848 .1306 .0872 .0547 6
2 .1240 .2097 .2753 .3115 .3177 .2985 .2613 .2140 .1641 5
3 .0230 .0617 .1147 .1730 .2269 .2679 .2903 .2918 .2734 4
4 .0026 .0109 .0287 .0577 .0972 .1442 .1935 .2388 .2734 3
5 .0002 .0012 .0043 .0115 .0250 .0466 .0774 .1172 .1641 2
6 .0001 .0004 .0013 .0036 .0084 .0172 .0320 .0547 1
7 .0001 .0002 .0006 .0016 .0037 .0078 0 7
8 0 .4305 .2725 .1678 .1001 .0576 .0319 .0168 .0084 .0039 8
1 .3826 .3847 .3355 .2670 .1977 .1373 .0896 .0548 .0312 7
2 .1488 .2376 .2936 .3115 .2965 .2587 .2090 .1569 .1094 6
3 .0331 .0839 .1468 .2076 .2541 .2786 .2787 .2568 .2188 5
4 .0046 .0185 .0459 .0865 .1361 .1875 .2322 .2627 .2734 4
5 .0004 .0026 .0092 .0231 .0467 .0808 .1239 .1719 .2188 3
6 .0002 .0011 .0038 .0100 .0217 .0413 .0703 .1094 2
7 .0001 .0004 .0012 .0033 .0079 .0164 .0312 1
8 .0001 .0002 .0007 .0017 .0039 0 8
n 0.90 0.85 0.80 0.75 0.70 0.65 0.60 0.55 0.50 p
二項分配 Binomial(n, p)的累積機率 P(X≤ x ¿(CDF cannot be flipped as the pmf)
n p 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50
6 0 0.5314 0.3771 0.2621 0.178 0.1176 0.0754 0.0467 0.0277 0.0156
1 0.8857 0.7764 0.6553 0 0.4201 0.3191 0.2333 0.1636 0.1094
2 0.9841 0.9526 0.9011 0.534 0.7442 0.6471 0.5443 0.4416 0.3438
3 0.9987 0.9941 0.9830 0 0.9294 0.8826 0.8208 0.7448 0.6563
4 0.9999 0.9996 0.9984 0.830 0.9889 0.9777 0.9590 0.9309 0.8907
5 1.0000 1.0000 0.9999 6 0.9991 0.9982 0.9959 0.9918 0.9845
6 1.0000 0.962 0.9998 1.0000 1.0000 1.0001 1.0001
4
0.995
4
0.999
8
1.000
0
7 0 0.4783 0.3206 0.2097 0.133 0.0824 0.0490 0.0280 0.0152 0.0078
1 0.8503 0.7166 0.5767 5 0.3295 0.2338 0.1586 0.1024 0.0625
2 0.9743 0.9263 0.8520 0.445 0.6472 0.5323 0.4199 0.3164 0.2266
3 0.9973 0.9880 0.9667 0 0.8741 0.8002 0.7102 0.6082 0.5000
4 0.9999 0.9989 0.9954 0.756 0.9713 0.9444 0.9037 0.8470 0.7734
5 1.0001 1.0001 0.9997 5 0.9963 0.9910 0.9811 0.9642 0.9375
6 1.0002 1.0001 0.929 0.9999 0.9994 0.9983 0.9962 0.9922
7 5 1.0001 1.0000 0.9999 0.9999 1.0000
0.987
2
0.998
7
1.000
0
1.000
1
8 0 0.4305 0.2725 0.1678 0.100 0.0576 0.0319 0.0168 0.0084 0.0039
1 0.8131 0.6572 0.5033 1 0.2553 0.1692 0.1064 0.0632 0.0351
2 0.9619 0.8948 0.7969 0.367 0.5518 0.4279 0.3154 0.2201 0.1445
3 0.9950 0.9787 0.9437 1 0.8059 0.7065 0.5941 0.4769 0.3633
4 0.9996 0.9972 0.9896 0.678 0.9420 0.8940 0.8263 0.7396 0.6367
5 1.0000 0.9998 0.9988 6 0.9887 0.9748 0.9502 0.9115 0.8555
6 1.0000 0.9999 0.886 0.9987 0.9965 0.9915 0.9818 0.9649
7 1.0000 2 0.9999 0.9998 0.9994 0.9982 0.9961
8 0.972 1.0000 1.0000 1.0001 0.9999 1.0000
7
0.995
8
0.999
6
1.000
0
n 0.90 0.85 0.80 0.75 0.70 0.65 0.60 0.55 0.50
If Y~ Binomial(n, p), then E[Y]=np and σ²{Y}=np(1-p).
( An easy way to show it is that Y= x 1 , x 2 ,…, x n where E[ x i ]= p and σ²{ x i }=p(1-p).
x
While i ’s are indep., we thus have E[Y]=np and σ²{Y}=np(1-p).)
Let’s try some calculation.
a. X~Bin(20,0.2) P(X=4)=
b. X~Bin(20,0.2) P(X≥4)=
c. X~Bin(20,0.7) P(X=15)=
d. X~Bin(20,0.7) P(X≥15)=
This is good time to let you know how useful CDF’s really are.

Binomial Theorem and application.


n
n!
(a+ b)n=∑ ax bn− x.
x=0 x ! ( n−x ) !
The Pascal Triagle.
5 8 13
Example 1: What is the coefficient of the term x y in the expansion of (x+y) ?
5 4 12
Example 2: What is the coefficient of the term x y in the expansion of (x+y-2) ?

Hypergeometric dist.

P (Y = y )=
( y n− y )
NS
)( N F

, where y=a, a+1,…, b, a=max(0, n-N ), b=min(N , n).


F S

( Nn )
The distribution involves picking n items from a collections of N items in which
N S are successes and
N F are Failures. That is N S + N F =N. The rv Y is for the number of Successes out of the n picked. The
NS NS NS
N −n
parameters are E[Y]=n N and σ²{Y}=n N (1- N ) N −1 .
Geometric dist.
Suppose we stop as soon as we pick a Success during a Bernoulli process. The number of picks Y is said to
1
1− p
y−1
have a Geometric distribution. The probability function is P(Y=y)= p(1− p) ,y=1,2,…,E[Y]= p ,σ²{Y}= p2
. Note that p is ________________.
It is good practice trying to calculate the parameters of the distribution.

E[Y]= ∑ yp ( 1− p ) y −1= p (1+2 (1− p)+3(1−p )2 +⋯)= 1p


Let S=1+2(1-p)+3(1-p)²+…
-)(1-p)S= (1-p)+2(1-p)²+…
1 1
pS=1+(1-p)+ (1-p)²+… = p ,S= p2 .
1
∑ y 2 p ( 1− p ) y −1 = p( 1+4 ( 1− p )+9( 1− p )2 +⋯)= p2 − p2
Now E[Y²]=
Let S=1+4(1-p)+9(1-p)²+…
-)(1-p)S= (1-p)+4(1-p)²+…
pS=1+3(1-p)+ 5(1-p)²+…
-)(1-p) pS= (1-p)+3(1-p)²+…
p²S=1+2(1-p)+ 2(1-p)²+…
2
2 1
p²S= p -1 S= p3 - p2
2 1 1 1 1 1− p

Thus σ²{Y}=E[Y²]-(E[Y])² = p
2
p - p = p - p = p2
2 2

Negative binomial dist.


Same as the Geometric Distribution except that we stop as soon as we pick the kth Successes. Let’s try
with some real numbers.
Suppose k = 2. Suppose k = 3.

X What happen? Probability x What happen? Probability

2 3

3 4

4 5

5 6

6 7

7 8

8 9

The probability function is

(
P(Y=y)= k −1
)
y −1 p (1−p )
k y −k

,y= k, k+1,…
k( 1− p )
k
2
The parameters are E[Y]= and σ²{Y}= p
p

Poisson distribution
(Poisson, 1781 ~ 1840, Galois, 1811 ~ 1832)
The rv X is usually used to denote number of occurrences of a certain event during a given range which can
μx
e−μ
either be in space or in time. If X~Poisson(µ), then P(X=x)= x ! , x= 0,1,2,…. The mean is E[X]= µ and
the variance is σ²{X}=µ. Note that µ is the mean occurrence counts. It can be interpreted in a number of
ways.
We should not be concerned that there is no upper limit to the rv Y since the probability will vanish fairly
reasonably quick.
Let’s compute the probability functions for μ=5 .
x P(X=x)

0
1

One special feature: The sum of two independent Poisson rv’s will be again Poisson with a mean the sum of
the means of the component distributions. That is, if independent,

Poisson ( μ1)+Poisson ( μ2)¿Poisson ( μ1 + μ 2).

Continuous Distributions
In continuous case, probability is evaluated in intervals as areas. There is no probability mass at any single
point, that is P(X=x)=0 for all x. So from now on, P(X< x)=P(X≤x), that is, “less than” is the same as “less than
or equal to” for all similar cases.
The distribution is represented by a function, the pdf, and the area under the function curve on a specified
interval [a, b] is evaluated for the corresponding probability P(a≤X≤b).
The required condition for pdf’s.
Condition 1: ______________________________
Condition 2: ____________________________________

Uniform distribution, U[a, b]


1
Features:p.d.f.:X~U[a, b] f ( x )= b−a a≤ x≤b
(b −a )2
1 a=b σ 2 {X }=
b−a E[X]= 2 12
a b
例:一隧道常 2000 公尺,車禍發生機率均一致,設 r.v. X 表車禍發生處距隧道南端入口之距離,則 P(1000≤X≤1750)=?

Normal distribution, X~N(,s²)


特色:對稱、鐘型。
2
1 −( x−μ )
用途: p.d.f.: f ( x )= exp ⁡( )
√2 π σ 2σ2

E[X]= σ 2 {X } =
m
Let X~ N(, ²) in any general case, finding P(a≤X≤b) is one work. We transform any given normal rv
x −μ
with standardization to get the Z-score, that is, Z= σ , and Z~N(0,1) according to a theorem. We
calculated and prepare the the CDF of N(0, 1) which is enough for us to deal with all normal cases.
Say, we have X~N(55, 20), what is P(48≤X≤63)=?
48−55 63−55
P(48≤X≤63)= P( √20 ≤X≤ √ 20 )=P(_____< Z < ______)=_________
Standardization will enable us to find probabilities regarding any, any normal random variable at all.
Calculate probabilities.
Let Z~N(0,1), find the following probabilities.
a. P(Z≤1.62)= b. P(Z≥1.03)=
c. P(Z≤-0.89)= d. P(Z≥-2.02)=
e. P(-0.1 ≤Z ≤1.22)= f. P(0.03 ≤Z ≤1.83)
Calculate percentiles. Let Z(a) be the ath percentile of N(0, 1), that is, P(Z ≤Z(a))=a.
Let Z~N(0,1), find the following percentiles.
a. Z(0.7580)= b. Z(0.2420)=
c. Z(0.9750)= c. Z(0.0250)=

Exponential distribution, X~Exp(λ)


特色:只有正值。
用途:壽命、等候時間。
− λx
p.d.f.: f ( x )=λe x>0
λ is the ___________________________________________________
−λa
It is known that P( X ≤a )=1−e
P ( a≤ X ≤b )=e− λb− e− λa
1 1
2
E[X]= λ σ {X } = λ 2
Note that the exponential distribution give us the following vivid contrasts to the Normal distribution. (1) It
is completely skewed to the right. There will not be any negative numbers possible. (2) The CDF is
extremely easy to use. We don’t need a table to figure out the probabilities. (3) There are two
parameterization, one with λ , the mean occurrence rate, and the other with μ, the mean time, which is
really intriguing.
Example 1: A light bulb is said to have an exponential life time with a mean of 500 hours. What is the
probability that this light bulb is still alive after 800 hours?

Example 2: The time between arrivals of a bus at the bus stop is exponential with an arrival rate of 2.5 per
half an hour. Sam is waiting for the bus now. What is the probability that Sam gets on to a bus
within 30 minutes?
Example 3: What is the Q3 of Exp(0.25)? Exp(0.1)? Exp(1.2)?

Special relationship between Exponential and Poisson.


A series of indistinguishable occurrences along the time axis, a process, can be called a Poisson process if
conditions were satisfied. The conditions are
(1) __________________________________________
(2) ___________________________________________
(3) __________________________________________
Then
(1) The inter-arrival time will be distributed as Exp( λ ), where λ is ____________________.
(2) The number of occurrences over an interval of length L will follow a Poisson distribution with mean=
_________.
Poisson Process Application
1 Ming is at a bus stop waiting for a bus to go downtown. There are two lines, Metro-A and Metro-B. The
arrival patterns are Poisson. The average inter-arrival times of them are 15 and 20 minutes, respectively.
It is also know that the processes are independent. Assume now that Ming can take metro-A as well as
Metro-B. What is the probability that Ming gets on a bus within the next 10 minutes? .6886

2 The flow of cars entering Tunghai University through the IBA entrance during weekdays can be thought of
as a Poisson process with the intensity of =20 cars per hour. Let X be the number of cars that enter the
IBA entrance during the period from 2:30pm to 3:50pm this coming Thursday. What is the probability
P(22 X < 26)? .2646
3 Assume that the random variable X has an exponential distribution. It is also known that the third quartile
of this distribution is 24. What is P(X  4.8)? .2421
4-5 The Chicago Cubs, the major league baseball team, just opened a ticket office downtown Chicago. It was
found that the sequence of arrivals of the ticket buyers at the office is a Poisson process of the rate of 45
per hour.
4 Within a randomly selected 4-minute period, what is the probability that more than 2 arrivals at the office
were observed? .4232
5 Suppose one ticket buyer just left the office. What is the probability that the next buyer comes into the
office no later than 1.5 minutes from now? .6753

Part I Let X N(0, 1),


1.P(X < 0.28)= (1), P(X < 2.04)=(2), P(X > 1.22)=(3),
2.P(X < −¿1.02)=(4), P(X > −¿0.72)=(5), P(X > −¿2.01)=(6).
3.P(X < 1.88)=(7), P(X > 0.56)=(8), P(−0.74 ≤ X ≤ 1.29 ¿=(9).
4.Now P(X < a)=0.9306, P(X > b)=0.4483, then a=(10), and b=(11).
5.Now P(X < a )=0.0202, P(X >b )=0.5910, then a=(12), and b=(13).
6.Now P(−¿a < X< a)=0.9328, P(−¿b < X < b)=0.2206, then a=(14), and b=(15).
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
Part II:
1-2 The monthly miscellaneous expenditure in US$ of Century Inc., a construction company, is known to be
a normal random variable X.

1 If it is known that  = 8000,  = 900, P(X  8800)=p, and P(7400  X  9000)=q, What is 2p+q?

2 What is the 68th percentile, namely x(0.68), of the distribution?


3 It is given that E[X 2 ]=50.5, μX =7. What is σ2 { 2X+3 } ?
4 It is given that E[X 2 ]=41, E [ Y2 ] =33, μX =6, μY =5, and E [ XY ] =38. What is σ 2 { 2X-5Y } ?

5-6 Warren Inc., one of the major manufacturers of TV sets in the country, is making production plans for the
coming season. Let the random variables X and Y denote forecast sales in million dollars in the coming
season for TV set models A and B, respectively. The joint probability distribution table is as follows.
Y
X 1 2 3 4
1 .12 .13 .06 .05
2 .07 .09 .08 .07
3 .05 .05 .11 .12
5 What is P(X2Y2)?
6 What is E[XY]?
7-8 The means and variances listed in the following table are calculated from the joint probability distribution
table of random variables X and Y.
Random variable Mean Variance
X 3 0.7
Y 2 0.6
7 Suppose E[XY]=6.60, what is the covariance {X, Y} of random variables X and Y.
8 Suppose E[XY]=5.40, what is the correlation coefficient {X, Y} of random variables X and Y.
9 There is this normal population with mean 40 and standard deviation 10. Find the maximum possible

value which is less than 90% of the population.

10 Fifteen people signed up for the Taipei Super Marathon, 2018. Eight are Taiwanese, others are foreign
nationals. Everyone is well-prepared to win. What is the probability that at least 3 out of the best 5 runners
are Taiwanese?
11-12 The Chicago Cubs, the major league baseball team, just opened a ticket office downtown Chicago. It was
found that the sequence of arrivals of the ticket buyers at the office is a Poisson process of the rate of
λ=16 arrivals per hour.
11 Within a randomly selected 20-minute period, what is the probability that no more than 2 arrivals at the
office were observed?
12 Suppose one ticket buyer just left the office. What is the probability that the next buyer comes into the
office no later than 10 minutes from now?

13 Assume that we have a huge bunch of packaged tube socks. It is known that 44% are white, 17% are
black. The others are of assorted colors which will be called “colored” socks here for convenience. Ming
picks up, randomly, 6 pairs of socks from the bunch. What is the probability that there are no more than
2 pairs of colored socks out of the 6 picked?

14 There is this normal population with mean 333.4 and standard deviation 140. Find the maximum

possible value which is less than the top 11.70% of the population.

15 There is this normal population with mean μ and standard deviation σ . It is also given that P(X>

1210)=.1469, and P(X> 830)=.8023. What is the 33 th percentile of the distribution?

16 It is known that the 20th and 80th percentiles of a uniform distribution U[a, b] are 17 and 41, respectively.
What is the standard deviation of this distribution?
17-20 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

F(x)=1- e -x/20 for x>0.

17 What is P(X  20)?


18 What is P(15  X  25)?
19 What is P(X  20X  10)?
20 What is the 70th percentile of the distribution?

21-24 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

{
1 for x>30,
8x
F(x)= for 0≤x≤30,
30+7x
0 for x<0.

21 What is P(X  20)?


22 What is P(15  X  25)?
23 What is P(X  20X  10)?

24 What is the 70th percentile of the distribution?

25-28 The shelf life of 8GB memory disk of a certain brand, in days, is considered a continuous random
variable X. The cumulative distribution function (CDF) F(x) is defined as follows.

{
1 for x>28,
x-12
F(x)= for 12≤x≤28,
28-12
0 for x<12.

25 What is P(X  18)?


26 What is P(17  X  22)?
27 What is P(X  22X  18)?
28 What is the 70th percentile of the distribution?

Part III:

1 It is given that the random variable X follows a Bernoulli distribution with the parameter p= 0.53. That is,

P(X=1)=p and P(X=0)=1-p. What is the variance of X?

2 What is the coefficient of the term a 3 b5 in the expansion of (a-2b)8 ?

3 What is the coefficient of the term a 4 b4 in the expansion of (a-b-2) 9?

4 What is the coefficient of the term a 2 b5 c 4 in the expansion of (a-b+2c)11?


5 It is known that the 30th and 70th percentiles of a uniform distribution U[a, b] are 7 and 15, respectively.
What is the standard deviation of this distribution?
6 A basketball player has a free throw rate of 0.9, and each free throw is independent of the others. The
point he is going to score after 10 consecutive free throws is most likely to be distributed as which of
the following distributions?
(A) (Poisson distribution) (B) (Normal distribution)

(C) (Hypergeometric distribution) (D) (Binomial distribution)

7 Let X 1 , X2 ,…, X100be 100 random variables taken from Bernoulli(p) and they are independent. Let Y=

100

∑ Xi, which one of the following is incorrect?


i=1

(A) Y ~ Binomial(100, p) (B) Pr(Y=100)=(1-p) 100


(C) E[Y] = 100p (D) Var(Y) =100p(1-p)
8 Which of the following properties is NOT considered necessary for being a probability density function,

pdf?

(A) Must be continuous. (B) Must be non-negative. (C) Total area under the function must be 1.

9 Let X be a random variable, and symbols E and V are used for expected value and variance of the random

variable. Which of the following is not correct?

(A) E[3X]= 3E[X] (B) V(X+12)= V(X) (C) E[X+12]= E[X]+12 (D) V(2X+1)= 2V(X)+1

10 Let X and Y be random variables, and symbols E and V are used for expected values and variances of the
random variables. Suppose that Y=aX+b, which of the following is not correct?
(A) E[Y]= aE[X]+b (B) V(Y)=a 2V(X)

(C) If V(Y)=36, and V(X)=4, then a=3 (D) If V(X)=4, and a=3, then V(Y)=36

11 Random variables X 1 , X2 , and X3 are independent U[0,1] random variables. What is E[( X1 -2 X2 + X3 ) 2 ¿
?
(A) -0.46 (B) 0 (C) 0.5 (D) 1.46

Keys

Part I
1 .6103 2 .9793 3 .1112
4 .1539 5 .7642 6 .9778
7 .9699 8 .2877 9 .6719
10 1.48 11 0.13 12 -2.05
13 -0.23 14 1.83 15 0.28
Part II
.1867*2+.6151=.9885 8423 6 60
(38/49=.7755) (5.18) 0.6 -0.92582
(40-1.282x10=) .5734 .09924 .9305
.5651 500 912 Sqrt(133.33)=11.55
(.6321) (.18586) (.60653) 24.079
(16/17=.9412) (200/205-120/135=.0867) ((1-16/17)/(1-8/10)=.2941) 210/31=6.77
(6/16=.375) (5/16=.3125) (0.6) 23.2
Part III
1 (var(X)=p(1- 2 (-1792) 3 ((-1260) 4 (-110,880)
p)=.53x.47=.2491)
5 (5.774) 6 (D) 7 (B) 8 (A)
9 (D) 10 (C) 11 (C)

Special application of normal to binomial

When n is larger, the calculation of binomial probabilities can be tedious. Work load is not exactly the
concern but the precision is. With the help of modern powerful computing machines, it is no longer a
serious difficulty. But in terms of illustrating approximating mechanism, it is still a plausible piece of work.

It will be illustrated with a plot to show you how to find the approximate probability of P(X=10) where X~
Bin(40, 0.32). The corresponding mean and standard deviation can be calculated and give us the normal
counterpart N( μ=np , σ 2=np (1− p) ¿=¿ N(12.8, 8.704). The area under the curve on [9.5, 10.5] will be
used to approximate the original probability P(X=10)我們用區間[9.5, 10.5]中常態曲線下方面積當作 X=10 之機率近似值,乍看之
下好像並沒有太大好處,讓我們看下一小題:

yn1
0.14

0.13

0.12

0.11

0.10

0.09

0.08

0.07

0.06

0.05

0.04

0.03

0.02

0.01

0.00

8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5 16.0 16.5 17.0

x
Now we want to find P(12  X  15). It takes four solid steps to finish the job. With normal approximation,
one step is all you need. Furthermore, the normal approximation to the binomial is known to be very
reliable. What can we ask for more when it comes to approximation?

P ( 12≤ X ≤ 15 ) ≈ P
( 11.5−12.8
√8.704
≤Z≤
√ 8.704 )
15.5−12.8
=P (−0.44 ≤ Z ≤ 0.92 )

=0.4912.

ym1
0.14

0.13

0.12

0.11

0.10

0.09

0.08

0.07

0.06

0.05

0.04

0.03

0.02

0.01

0.00

8.0 8.5 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5 16.0 16.5 17.0

x
4-13 Binomial(40, 0.32). Find the following: (1). P(X  10), (2). P(12  X  15).(Exact. 0.09015, 0.48474,
Approx. 0.0863, 0.4912.)

(CDF of Binomial(40, 0.32))


x x x x
P(X¿ x ) P(X¿ x ) P(X¿ x ) P(X¿ x )

1 0.00000 8 0.06846 15 0.82086 22 0.99923


2 0.00004 9 0.13026 16 0.89346 23 0.99975
3 0.00024 10 0.22041 17 0.94169 24 0.99993
4 0.00114 11 0.33612 18 0.97070 25 0.99998
5 0.00417 12 0.46771 19 0.98650 26 1.00000
6 0.01250 13 0.60108 20 0.99431 27 1.00000
7 0.03152 14 0.72213 21 0.99781 28 1.00000
x<-0:800 x<-0:800
x<-(x-400)*0.01 x<-(x-400)*0.01
x<-12.8+2.9503*x x<-12.8+2.9503*x
curve(dnorm(x,12.8,2.9503),6,15,main="Find P(X=10)") curve(dnorm(x,12.8,2.9503),9,17,main="Find P(X=12, 13, 14, 15)")
grid() grid()
abline(h=0) abline(h=0)
px<-0:20 dd<-0:20
px<-9.5+0.05*px x12<-11.5+0.05*dd;x13<-12.5+0.05*dd;x14<-13.5+0.05*dd;x15<-
qx<-dnorm(px,12.8,2.9503) 14.5+0.05*dd
qx[1]<-0 y12<-c(0,rep(dbinom(12,40,0.32),19),0)
qx[21]<-0 y13<-c(0,rep(dbinom(13,40,0.32),19),0)
polygon(px,qx,density=10,angle=45,col=2) y14<-c(0,rep(dbinom(14,40,0.32),19),0)
py<-0:20;py<-9.5+0.05*py y15<-c(0,rep(dbinom(15,40,0.32),19),0)
qy<-c(0,rep(0.09,19),0) px<-0:80
polygon(py,qy,density=10,angle=10,col=3) px<-11.5+0.05*px
qx<-dnorm(px,12.8,2.9503)
qx[1]<-0
qx[81]<-0
polygon(px,qx,density=10,angle=45,col=2)
polygon(x12,y12,density=10,angle=10,col=3)
polygon(x13,y13,density=10,angle=10,col=3)
polygon(x14,y14,density=10,angle=10,col=3)
polygon(x15,y15,density=10,angle=10,col=3)

You might also like