0% found this document useful (0 votes)
5 views15 pages

Chapter Two

Chapter 2 discusses random variables and probability distributions, defining a random variable as a function that assigns a real number to each outcome of an experiment. It explains the distribution function, which gives the probability that a random variable is less than or equal to a certain value, and introduces density functions for continuous random variables. The chapter also covers properties of distribution functions and provides examples of both discrete and continuous random variables.

Uploaded by

emag
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)
5 views15 pages

Chapter Two

Chapter 2 discusses random variables and probability distributions, defining a random variable as a function that assigns a real number to each outcome of an experiment. It explains the distribution function, which gives the probability that a random variable is less than or equal to a certain value, and introduces density functions for continuous random variables. The chapter also covers properties of distribution functions and provides examples of both discrete and continuous random variables.

Uploaded by

emag
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

Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Chapter- 2
Random Variables and probability distribution

2.1. The random variable concept

Statistics is concerned with making inferences about populations and population characteristics.
Experiments are conducted with results that are subject to chance. So far, we dealt with outcomes of
experiments and their collections, which we called events. In this chapter we shall assign a number X()
to every outcome  of our experiment. We shall thus define a function X() whose “independent variable”
 will not be a number, but an element of the set S; this function will be called random variable.

We are given an experiment E whose outcomes  are various objects belonging to the certain event S. To
every  we now assign according to some rule a number, X(). The number could be the gain or loss in a
game of chance, the voltage of a random source, the cost of a manufactured part, or any other numerical
quantity that is of interest in the performance of the experiment. We thus have established a relationship
between the elements  of the set S and certain numbers.

Definition: A real random variable X is a real function whose domain is the space S [i.e, a process of
assigning a real number X() to every outcome  of the experiment E and such that:

The set {X ≤ x} is an event for any real number x.

The probability of the events {X = +∞} and {X = -∞} equals zero:

P { X=+ ∞ }=P { X=−∞ }=0

Example 2.1: Our experiment is the rolling of a die. With f1,f2,…, f6 its 6 faces, we take

X(f1) = 10 , X(f2) = 20 , ... , X(f6) = 60 ,

The value X ( f i )=10 i of the random variable so constructed could be our gain if f i shows in a game of
dice.

Example 2.2: A telephone call occurs at random in the interval (0,T). The space S consists of all numbers
t in this interval. We define the random variable X(t) as follows: with (t 1,t2) an interval included in (0,T),
we take

X (t)= {
1if t 1 ≤t ≤t 2
0 otherwise

Thus our random variable takes only the values of 0 and 1.

2.2. The distribution function

Given a real number x, the set {X ≤ x}, consisting of all outcomes  such that X() ≤ x, is an event. Its
probability P{X ≤ x} is a number depending on x; that is, it is a function of x. This function will be
denoted by

Department of civil engineering, AAU Page 1


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

F x (x)

And will be called the distribution function (or distribution) of the random variable X.

Definition: The distribution function of the random variable X is the function

F x ( x ) =P { X ≤ x }

defined for any number x from -∞ to ∞.

Thus, for a given x, F x (x) equals the probability of the event {X ≤ x} considering of all outcomes  such
that X() ≤ x. For brevity, we shall also say that F x (x) equals the probability that X ≤ x.

Example 2.3: Our experiment is tossing a coin:

S = {h,t} P{h} = p P{t} = q

We define the random variable X by

X(h) = 1 X(t) = 0

And we shall determine its distribution function F (x).

If x ≥ 1, then { X ≤ x } is the certain event because

X ( h )=1≤ x X ( t )=0≤ x

Therefore;
F ( x )=P { X ≤ x }=P { h ,t }=1

If 0 ≤ x<1 , then { X ≤ x }={t } because

X ( h )=1> x X ( t )=0 ≤ x

Therefore;
F ( x )=P { X ≤ x }=P { t }=q

Finally if x <0, then { X ≤ x } is the impossible event; hence

F ( x )=0

{
1 for x ≥1
Thus F ( x )= q for 0 ≤ x< 1
0 for x <0

Example 2.4: In the fair-die experiment we define the random variable X by,

X ( f i )=10 i

Department of civil engineering, AAU Page 2


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

as in Example 2.1. Since P ( f i) =1/6 we can easily conclude that the distribution function F(x) is a
staircase function as in Fig below, with steps equal to 1/6.

As an illustration we give below some values of F(x):

F ( 35 )=P { X ≤35 }=P { f 1 , f 2 , f 3 } =3/ 6

F ( 20 )=P { X ≤20 }=P { f 1 , f 2 } =2/6

F ( 100 )=P { X ≤ 100 }=P { f 1 , f 2 , f 3 , f 4 , f 5 , f 6 }=1

Example 2.5: A telephone call occur at random in the interval (0,T), and the probability of the event {t1≤
t ≤ t2} is given by

t 2−t 1
P { t 1 ≤ t ≤ t 2 }=
T

A random variable is defined by X ( t )=t

Here t has a double meaning. It is the outcome of our experiment (time of call) and the value of the
random value at this outcome. In other words, the random variable has as domain and range the interval
(0, T). We shall find its distribution function.

If x >T , then { X ≤ x } for any t in the above interval

{ X ≤ x }={ 0 ≤ t ≤T }=S
Hence;
F ( x )=P { 0 ≤ t ≤ T } =1

If 0 ≤ x ≤ T , then { X ≤ x } because

{ X ≤ x }={ 0 ≤ t ≤T }
Hence;
x
F ( x )=P { 0 ≤ t ≤ T } =
T

Finally if x <0, then { X ≤ x } is the empty set

F ( x )=0

Department of civil engineering, AAU Page 3


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

{
1 for x >T
x
Thus F ( x )= for 0 ≤ x ≤ T is a ramp function.
T
0 for x< 0

Properties of distribution functions:

F(-∞) = 0 F(+∞) = 1

It is a non decreasing function of x:

F ( x 1 ) ≤ F ( x 2) for x 1< x2

It is continuous from the right:

F¿

2.3. The density Function

dF (x )
The derivative f ( x )= of the distribution function F(x) is called density function of the random
dx
variable X (it is also known as frequency function). Since F(x) might not have a derivative for every x,
one distinguishes several types of random variable.

Definition: if a sample space contains a finite number of possibilities or an unending sequences with as
many elements as there are whole numbers it is called a discrete sample space.

Definition: if a sample space contains an infinite number of possibilities equal to the number of points on
a line segment, it is called a continuous sample space.

A random variable is called a discrete random variable if its set of possible outcomes is countable. When
a random variable can take on values on a continuous scale, it is called a continuous random variable.

a. Random variables of continuous type

Although the probably distributions of a continuous random variable cannot be presented in tabular form,
it can be stated as a formula. Such a formula would necessarily be a function of the numerical values of
the continuous variable X and as such will be represented by the functional notation f(x). In dealing with
continuous variables, f(x) is usually called the probability density function, r simply the density function
of X. Since X is defined over a continuous sample space, it is possible for f(x) to have a finite number of
discontinuities. However most density functions that have practical applications in the analysis of
statistical data are continuous and some examples are given in fig below. A probability density function is
constructed so that the area under its curve bounded by the x axis is equal to 1 when computed over the
range of X for which f(x) is defined.

Department of civil engineering, AAU Page 4


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Definition: The function f(x) is a probability density function for the continuous random variable X,
defined over the set of real numbers R, if

1. f ( x ) ≥ 0 , for x ∈ R

2. ∫ f ( x ) dx=1,
−∞

b
3. P ( a< X < b )=∫ f ( x ) dx ,
a

Example 2.6: Suppose that the error in the reaction temperature, in oC, for a controlled laboratory
experiment is a continuous random variable X having the probability density function

{
x2
f ( x )= 3 −1< x <2
0 elsewhere

I. Verify condition 2 of the above definition


II. Find P(0 < X ≤ 1)

Solution
∞ 2 2
x
∫ f ( x ) dx=∫ 3
dx =1
−∞ −1

1 2
x
P ( 0< X ≤ 1 )=∫ dx=1/9
0 3

The distribution function for the example 2.6 , F(x) is:

{
0 x ≤−1
3
F ( x )= x +1 −1 ≤ x <2
9
1, x≥2

Department of civil engineering, AAU Page 5


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

The probability;

2 1 1
P ( 0< X ≤ 1 )=F ( 1 ) −F ( 0 ) = − =
9 9 9

Example 2.7 Our experiment is the random selection of a system. The selected system is put into
operation at t = 0 and fails sometime later. The time of failure t is considered as an experimental outcome.
We assume that the probability P{t1 ≤ t ≤ t2} that the system fails in the interval (t1,t2) is given by:
t2 ∞
P { t 1 ≤ t ≤ t 2 }=∫ α ( t ) dt ; where α (t ) is a known function satisfying ∫ α ( t ) dt =1.
t1 0

The random variable X is so defined that: X ( t )=t

It has as domain and range the positive real axis. Clearly,

{ x 1 ≤ X ≤ x 2 }={ x 1 ≤ t ≤ x 2 }
Hence;
x2 x2

P { x 1 ≤ X ≤ x 2 } =∫ f ( x ) dx=∫ α ( t ) dt for any x1 and x2,


x1 x1

Therefore:

f ( x )=α (x )

b. Random variables of discrete type

Suppose now that the distribution function F(x) of the random variable X is of a staircase form with
discontinuities at the points xi. We then say that X is of discrete type. Denoting by pi the jump of F(x) at
the point xi, we have

P { X =xi } = pi=F ( x i ) −F ¿

Where

∑ pi =¿ F ( ∞ )−F (−∞ )=1 ¿


i

as in examples 2.3 and 2.4. It is easy to see that if X is of discrete type then, for a specific x, its
distribution function is given by the sum

F ( x )=∑ P { X=x i }i such that x i ≤ x


i

Where the summation extends over all i such that, x i ≤ x .

Department of civil engineering, AAU Page 6


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Definition: The set of order pairs (x, f(x)) is a probability function, probability mass function, or
probability distribution of the discrete random variable X if, for each possible outcome x,

1. f ( x ) ≥ 0 ,
2. ∑ f ( x )=1 ,
x

3. P ( X=x ) =f ( x ) ,
Example 2.8: If a car agency sells 50% of its inventory of a certain foreign car equipped with airbags,
find a formula for the probability distribution of the number of cars with airbags among the next 4 cars
sold by the agency.

Solution: Since the probability of selling an automobile with airbags is 0.5, the 24 =16 points in the
sample space are equally likely to occur. Therefore the denominator for all probabilities and also for our
function is 16. The event of selling x models with air bags and 4-x models without air bags can occur in

( 4x ) ways, where x can be 0, 1, 2, 3, or 4. Thus the probability distribution f ( x )=P ( X =x ) is

f ( x )=
( x)
4
for x=0 ,1 , 2 ,3 , 4.
16

The distribution function (cumulative distribution) can be determined using direct calculation of the
probability distribution; f(0) = 1/16, f(1) = 1/4, f(2) = 3/8, f(3) = 1/4, and f(4) = 1/16 , Therefore,

F ( 0 )=f ( 0 )=1/16

F ( 1 ) =f ( 0 ) + f (1)=5/16

F ( 2 ) =f ( 0 ) + f ( 1 )+ f (2)=11/16

F ( 3 )=f ( 0 )+ f ( 1 ) +f ( 2 ) + f (3)=15 /16

F ( 4 ) =f ( 0 ) + f ( 1 )+ f ( 2 ) + f ( 3 )+ f (4)=16 /16

Hence;

Department of civil engineering, AAU Page 7


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

{
0 for x< 0
1
for 0 ≤ x <1
16
5
for 1 ≤ x< 2
F ( x )= 16
11
for 2 ≤ x< 3
16
15
for 3 ≤ x < 4
16
1 for x ≥ 4

2.4. Examples of distribution and density function

The random variables discussed so far were defined on specific experiments. In this section we shall talk
about random variables having this distribution or that density function without specifying the underlying
experiment. To do so we should know that, given a function G(x), we can construct a suitable experiment
in which a random variable is so defined that its distribution equals G(x). The following subtle theorem
shows that this is always possible provided G(x) has the stated properties of distribution functions.

Existence theorem: Given a function G(x) such that

G (−∞ )=0 G ( ∞ )=1 lim G ( x )=1


x→ ∞

G ( x 1) ≤ G ( x2 ) if x 1 < x 2

G¿

We can find an experiment E and a random variable X defined on E such that its distribution function
F(x) equals the given function G(x).

We shall now list a number of distribution and density functions that appear often in applications. Their
origin will be explained in subsequent sections.

Normal: we say that a random variable is normally distributed if its density function is a Gaussian curve
2

f ( x )= A e−α x α >0

Since;



π
∫ e−α x =
2

−∞ α

We conclude from the above that, A=


√ α
π

Department of civil engineering, AAU Page 8


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

For reasons that will be explained in chapter 3, the constant α is written in the form α =1/2 σ 2 . Thus

1 −x 2
/2 σ 2
f ( x )= e
σ √2 π

With a shift in the x axis we obtain the general normal density

1 −¿¿ ¿
f ( x )= e
σ √2 π

The corresponding distribution function is given by:


x
1 x−η
F ( x )= ∫ f ( y ) dy = +erf
−∞ 2 σ

Where erf x is error function defined as:


x
1
∫ e− y /2 dy ¿
2

erf x=¿ ⁡
√2 π −0
From the above relations it follows that:

x 2−η x 1−η
P { x 1 ≤ X ≤ x 2 } =F ( x 1 )−F ( x 2 ) =erf −erf
σ σ

Example 2.9 The random variable X is normally distributed with η=1000∧σ=50 . Find the probability
that X is between 900 and 1050.

1050−1000 900−1000
P { x 1 ≤ X ≤ x 2 } =erf −erf =erf 1+ erf 2=0.819
50 50

Department of civil engineering, AAU Page 9


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Poisson: If a random variable X is of discrete type, taking values at the points 0,1,… n, …., with
k
−a a
P { X=k }=e k=0 , 1 , … a>0
k!

Then we say that it has a Poisson distribution with parameter the positive constant a. Its density is
sequence of impulses

ak
f ( x )=e−a ∑ δ (x−k )
k =0 k!

If a < 1, then P{X = k} is maximum for k = 0. If a > 1 but not an integer, then P{X = k} is maximum for k
= [a]; if a, is an integer, then we have two maxima for k = a and k = a – 1.

Department of civil engineering, AAU Page 10


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Example 2.10: Our experiment is the random selection of points on the time axis with uniform density .
A single outcome  of this experiment is a specific set of points. We define the random variable X such
that its value X() equals the total number of pints in a given interval (0,t o). Hence, X takes only integral
values 0,1,2,…, and the event { X = k} is the event {k points in (0,to)}. Its probability is given by;
k
−λt o ( λ t o)
P { X=k }=e k=0 ,1 , 2 ,…
k!

We have thus constructed a Poisson-distributed random variable with parameter

a=λ t o

Binomial If X of lattice type taking values at the points k = 0, 1, 2, …, n with

k ()
P { X=k }= n p q p +q=1
k n−k

We say that it has a binomial distribution. Its density


n

()
f ( x )=∑ n pk q n−k δ(x−k)
k=0 k

is a sequence of impulses. P{X = k} is maximum for k = [(n+1)p] if (n+1)p is not an integer; if (n+1)p is
an integer, we have two maximum at km1 = (n+1)p and km2 = (n+1)p – 1.

Example 2.11 We toss a coin n times. A single outcome is a particular sequence 1 2 … n of heads and
tails. We define X so that X(1 2 … n) equals the number of heads in that sequence

X(1 2 … n) = k k heads

Thus { X = k} is the event {k heads in n tossings}, and its probability is given by:
k
P {X =k }= n p q
k ()
n−k

Uniform: If the density function of a random variable X is a rectangular pulse

{
1
for x 1 ≤ x ≤ x 2
f ( x )= x 2−x 1
0 elsewhere

We say that X is uniformly distributed in the interval (x 1 , x2). Thus X is of continuous type, and its
distribution function is a ramp.

Example 2.12: A resistor r is a random variable uniformly distributed between 900 and 1100 ohms. We
shall determine the probability that r is between 950 and 1050 ohms.

Department of civil engineering, AAU Page 11


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

1050 1050
1
P { 950 ≤ r ≤ 1050 }= ∫ f ( r ) dr = ∫ dr=0.5
950 200 950

Gamma The gamma density is given by


b −cx
f ( x )= A x e U ( x)

Where U(x) = is the unit step function

{
U ( x )= 1 x ≥ 0
0 x <0

The constants b > 0, c > 0 are arbitrary parameters, and A is such that
∞ ∞
A
1=∫ A x e dx= b+1 ∫ y e dy
b −cx b −y

0 c 0

The last integral is the well-known gamma function



Γ ( b+1 )=∫ y e dy
b −y

Hence
b+ 1
c
A=
Γ (b+1)

If b = n is an integer, Γ ( b+1 )=n ! as is well-known. The function f(x) is maximum for x = b/c.

Beta The beta density is given by

{
b c
f ( x )= A x (1−x ) 0 ≤ x ≤ 1
0 elsewhere

It can be shown that,


1
Γ (b+ 1) Γ (c+1)
∫ x b (1−x)c dx= Γ (b+ c+2)
0

The right hand side of the above equation is known as the beta function B(b+1, c+1), Where

Γ ( b ) Γ (c )
B ( b , c )=
Γ (b+ c)

f ( x ) is maximum for x = b/(b+c).

Hence

Department of civil engineering, AAU Page 12


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

Γ (b+c +2)
A=
Γ (b+1)Γ (c +1)

Other common densities include:

Laplace

α
f ( x )= e−α |x|
2

Cauchy

α/ π
f ( x )= 2 2
α +x

Rayleigh

x − x /2 α2 2

f ( x )= 2
e U (x)
α

Maxwell

f ( x )= √ 2 x 2 e−x / 2 α U (x )
2 2

α3 √π

2.5. Conditional distributions and densities

Conditional distributions and densities will appear in several places. We recall from conditional
probability that, with m an event such that,

P (m)≠ 0

The conditional probability of A assuming m, is given by

P( A ∩m)
P( A ¿)=
P (m)

In this section we shall express A and m or both in terms of the random variable X.

Definition of F(x\m) and f(x\m). The conditional distribution F(x\m) of the random variable X, assuming
m, is defined as the conditional probability of the event {X ≤ x}:

P { X ≤ x , m}
F ( x ¿ )=P { X ≤ x ¿ }=
P(m)

Where { X ≤ x , m} is the event consisting of all outcomes ζ such that

X ( ζ ) ≤ x∧ζ ∈ m

Department of civil engineering, AAU Page 13


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

i.e the set product of the events { X ≤ x } and m. All properties of ordinary distribution apply also to
F ( x ¿ ). We thus have;

F ( ∞ ¿ ) =1 F (−∞ ¿ )=0

P {x 1< X ≤ x 2 , m}
and; F ( x 2 ¿ )−F ( x 1 ¿ ) =P { x 1< X ≤ x 2 ¿ }=
P(m)

We now assume that X is of continuous type. Its conditional density f(x\m) is defined as the derivative of
F(x\m) and it has all the properties of the ordinary densities; e.g.,

∫ f ( x ¿ ) dx=F ( ∞ ¿ )−F ( F−∞ ¿ ) =1


−∞

Example 2.12: In the fair die experiment the random variable X is defined by

x ( f i ) =10i i=1 , … ,6

With m = {f2, f4, f6} the event {even}, we shall determine F(x\m).

Solution:
If x ≥ 60, then
{ X ≤ x , m }= { f 2 , f 4 , f 6 }
Hence,
P {f 2 , f 4 , f 6 }
F ( x ¿ )= =1
P(m)
If 40 ≤ x < 60, then
{ X ≤ x , m }= { f 2 , f 4 }
Hence,
2
P {f 2 , f 4 } 6
F ( x ¿ )= =
P(m) 3
6
If 20 ≤ x < 40, then
{ X ≤ x , m }= { f 2 }
Hence,

Department of civil engineering, AAU Page 14


Chapter2: Random Variables and probability distribution CENG 2007-2009/2010

1
P {f 2 }6
F ( x ¿ )= =
P(m) 3
6
Finally if x < 20, then
{ X ≤ x , m }=0
Hence,
F ( x ¿ )=0

Department of civil engineering, AAU Page 15

You might also like