0% found this document useful (0 votes)
55 views

Stochastic Processes and Random Variables Random Variables: Sobia Jangsher Institute of Space Technology (IST)

This document defines and provides examples of different types of discrete random variables, including: - Discrete random variables that take on countable values. - Probability mass functions that give the probability of each value. - Cumulative distribution functions and their properties. - How to calculate the expected value and variance of discrete random variables. - Specific examples like Bernoulli random variables which model binary experiments, and binomial random variables which count successes in a collection of Bernoulli trials.

Uploaded by

jagga ustad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Stochastic Processes and Random Variables Random Variables: Sobia Jangsher Institute of Space Technology (IST)

This document defines and provides examples of different types of discrete random variables, including: - Discrete random variables that take on countable values. - Probability mass functions that give the probability of each value. - Cumulative distribution functions and their properties. - How to calculate the expected value and variance of discrete random variables. - Specific examples like Bernoulli random variables which model binary experiments, and binomial random variables which count successes in a collection of Bernoulli trials.

Uploaded by

jagga ustad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

Stochastic Processes and Random Variables

Random Variables

Sobia Jangsher
Institute of Space Technology (IST)

September 20, 2017

1 / 87
Random Variables

Definition of Random Variable

A random variable is a mapping from an outcome of a random experiemnt


to a real number
X : S > SX R (1)

2 / 87
Random Variables

Definition of Random Variable

X : S > SX R (2)

3 / 87
Random Variables

Types of Random Variables

Discrete random variables: Have countable (finite or infinite) image


E.g. Sx = {0, 1, 2, 3}
Continuous random variables: Have uncountable image
E.g. Sx = [0, 1]
Mixed random variables: Have both continuos and discrete part in
there image
E.g. Sx = {0} [1, 2]

4 / 87
Discrete Random Variables

Discrete Random Variable

5 / 87
Discrete Random Variables

Probability Mass Function


For a discrete random variable, the probability mass function (pmf) provides
the probability of a particular point in the sample space of a discrete random
variable. For a set Sx = {a0 = 0, a1 = 1, a2 = 2, a3 = 3, a4 = 4, a5 = 5},
the probability mass function is

pX (ak ) = P{X = ak }, k = 0, 1, 2, 3, 4, 5 (3)

6 / 87
Discrete Random Variables

Properties of pmf

0 pX (ak ) 1
P
ak SX pX (ak )

7 / 87
Discrete Random Variables

Cummulative Distributive Function

The cummulative distributive function (cdf) of a random variable X is


defined as the probability of the event {X x}:

FX (x) = P[X x], < x < + (4)

8 / 87
Discrete Random Variables

Properties of cdf

0 FX (x) 1 < x < +


a b => FX (a) FX (b)

9 / 87
Discrete Random Variables

Properties of cdf

limx> FX (x) = 0
limx> FX (x) = 1
FX (xi+1 ) = FX (xi ) + pX (xi+1 )

10 / 87
Discrete Random Variables

Expected Value of a Discrete Random Variable

The expected value, expection or mean of a discrete RV is the average


value of the random variable.
What is the average value of a random variable whose image is
SX = {1, 6, 7, 9, 13}?

11 / 87
Discrete Random Variables

Expected Value of a Discrete Random Variable

What is the average value of a random variable whose image is


SX = {1, 6, 7, 9, 13}?
If your answer is 7.2 then you assumed that all of the values in the rvs
image have equal weights
1 1 1 1 1
1 + 6 + 7 + 9 + 13 = 7.2 (5)
5 5 5 5 5

12 / 87
Discrete Random Variables

Expected Value of a Discrete Random Variable


Expectation assigns appropiate weights to each value in the RVs
image.
Expectation is computed by using the probability of each point in the
RVs image as the weight of that point.
Hence the expectation of the random variable given below is

E {X } = 1 0.4 + 6 0.3 + 7 0.1 + 9 0.1 + 13 0.1 = 5.1 (6)

13 / 87
Discrete Random Variables

Expected Value of a Discrete Random Variable

Mathematically, the expected value of a discrete random variable is


X
E {X } = X = ak P{X = ak } (7)
ak SX

14 / 87
Discrete Random Variables

Variance of a Random Variable

Variance of a RV is a measure of the amount of variation of a RV


around its mean.
Intuitively, which of the following discrete RVs has a higher variance?

15 / 87
Discrete Random Variables

Variance of a Random Variable

Intuitively, which of the following discrete RVs has a higher variance?


qX (x) has a higher varaince because it varies more around its mean
than pX (x)

16 / 87
Discrete Random Variables

Variance of a Random Variable

Mathematically, the variance of a discrete RV is defined as:


X
var (X ) = X2 = (ak E {X })2 P{X = ak } (8)
ak SX

17 / 87
Discrete Random Variables

Variance of a Random Variable

var (X ) = (1 3.87)2 0.5 + (6 3.87)2 0.4 + (7 3.87)2 0.033


+(9 3.87)2 0.033 + (13 3.87)2 0.033 = 9.91

var (X ) = (1 5.2)2 0.4 + (6 5.2)2 0.2 + (7 5.2)2 0.2


+(9 5.2)2 0.1 + (13 5.2)2 0.1 = 15.36
18 / 87
Discrete Random Variables

Standard Deviation of a Random Variable

Mathematically, the standard deviation of a discrete RV is defined as:


sX
X = (ak E {X })2 P{X = ak } (9)
ak SX

19 / 87
Discrete Random Variables

Discrete Uniform Random Variables

A discrete uniform RV, has a finite image and all the elements of the
image have equal probabilities

What is is the expected value and the standard deviation of this


random variable?

20 / 87
Discrete Random Variables

Bernoulli Random Variables

A Bernoulli RV is defined on a single event A


It is based on an experiment called Bernoulli trial
The experiment is performed, the event happens or does not happen
Thus, the sample space of a Bernoulli RV is binary.

21 / 87
Discrete Random Variables

Bernoulli Random Variables

Typical examples of Bernoulli Rvs in communication


Transmit a bit over a wireless channel
outcomes
-0 bit is received error free
-1 bit is received with error
Transmit a packet over the internet
outcomes
-0 packet received
-1 packet not received

22 / 87
Discrete Random Variables

Bernoulli Random Variables


Sample space of a Bernoulli RV, I, is binary
Both outcomes are mapped to real numbers, I (A) = 1 and I (Ac ) = 0
are used to represent a Bernoulli RVs outcome
The pmf of I is:
P{I = 1} = p
P{I = 0} = 1 p

23 / 87
Discrete Random Variables

Bernoulli Random Variables

Consider the experiement of a fair coin toss. What is the expeceted


value and the variance of this Bernoulli RV?

24 / 87
Discrete Random Variables

Bernoulli Random Variables

Consider a binary symmetric channel with probability of bit-error 0.1


What is the expeceted value and the variance of this Bernoulli RV?

25 / 87
Discrete Random Variables

Bernoulli Random Variables

Consider a binary symmetric channel with probability of bit-error 0.1


What is the expeceted value and the variance of this Bernoulli RV?

26 / 87
Discrete Random Variables

Bernoulli Random Variables


Consider a binary symmetric channel with probability of bit-error 0.1
What is the expeceted value and the variance of this Bernoulli RV?
The event of interest is bit error :
=> P{I = 1} = 0.9 and P{I = 0} = 0.1
E {I } = 1 0.9 + 0 0.1 = 0.9
Var {I } = (1 0.9)2 0.9 + (0 0.9)2 0.1 = 0.09

27 / 87
Discrete Random Variables

Binomial Random Variables

Consider a collection of n independent Bernoulli trials


A Binomial RV is the total number of occurrences of an event A in this
independent Bernoulli collection
Send n bits, count the number of bits that are received with errors
Send n packets, count the number of packets that are not lost

28 / 87
Discrete Random Variables

Binomial Random Variables

Consider a collection of n independent Bernoulli trials


A Binomial RV is the total number of occurrences of an event A in this
independent Bernoulli collection
Send n bits, count the number of bits that are received with errors
Send n packets, count the number of packets that are not lost

29 / 87
Discrete Random Variables

Binomial Random Variables

If Ij (A) = 1 and Ij (Ac ) = 0, j = 1, 2, . . . n, are used to represent the


outcomes of the Bernoulli trials then the Binomail Random variable, X,
is
Xn
X = Ij
j=1

What is the image of X?

30 / 87
Discrete Random Variables

Binomial Random Variables

If Ij (A) = 1 and Ij (Ac ) = 0, j = 1, 2, . . . n, are used to represent the


outcomes of the Bernoulli trials then the Binomail Random variable, X,
is
Xn
X = Ij
j=1

What is the image of X?

SX = {0, 1, 2, . . .}

31 / 87
Discrete Random Variables

Binomial Random Variables

P{Ij (A) = 1} = p and P{Ij (A) = 0} = 1 p


Then, the binomial RV is defined as:
n
X
X = Ij
j=1

The pmf of a binomial RV is


 
n k
P{X = k} = p (1 p)nk
k

32 / 87
Discrete Random Variables

Binomial Random Variables

The pmf of a binomial RV X is:


 
n k
b(k; n, p) = X = P{X = k} = p (1 p)nk
k

This pmf gives a probability that exactly k out of n trial Bernoulli trials
were successes.
Be careful about the definition of a success

33 / 87
Discrete Random Variables

Binomial Random Variables

Consider a binary symmetric channel with probability of bit error p.


Find the probability that a packet of n bits is received with one or more
errors?
P{Ij = 1} = 0.1 and P{Ij = 0} = 0.9, j = 1, 2, . . . , n
Then, the probability that a packet is received with errors is

P{(X = 1) (X = 2) . . . (X = n)}

34 / 87
Discrete Random Variables

Binomial Random Variables

Consider a binary symmetric channel with probability of bit error p.


Find the probability that a packet of n bits is received with one or more
errors?

P{Packet with errs} = P{(X = 1) (X = 2) . . . (X = n)}


= P{X = 1} + P{X = 2} + . . . + P{X = n}
   
n 1 n1 n 2
= p (1 p) + p (1 p)n2 + . . .
1 2
 
n n
+ p (1 p)nn
n
Xn
= p i (1 p)ni
i=1

35 / 87
Discrete Random Variables

Binomial Random Variables

Consider a binary symmetric channel with probability of bit error p.


Find the probability that a packet of n bits is received with one or more
errors?
X n
P{Packet with errs} = p i (1 p)ni
i=1

Another easier way

P{Packet with errs} = P{X > 0} = 1 P{X < 0} = 1 P{X = 0}


 
n 0
= 1 p (1 p)n0
0

36 / 87
Discrete Random Variables

Normal Approximation of a Binomial RV

When n becomes large, computations using binomial becomes


unmangeable
For large n, the normal approximation of a binomial RV is

(k np)2
 
1
b(k; n, p) = P{X = k} = p exp
2np(1 p) 2np(1 p)

This approximation is also called Laplace Approximation

37 / 87
Discrete Random Variables

Geometric Random Variables

A Geometric RV, M, is the number of Bernoulli trials until the first


occurence of an event A
The experiment is stopped as soon as event A is observed
The image of a geometric RV is infinite but countable
Sx = {1, 2, 3, . . .}

38 / 87
Discrete Random Variables

Geometric Random Variables

The pmf of a Geometric RV, Z, is

pz (k) = P{Z = k} = (1 p)k1 p (10)

OR
pz (k) = P{Z = k} = (1 p)k p (11)
Depending on whether the success trial is included in the total count or
not.

39 / 87
Discrete Random Variables

Geometric Random Variables

40 / 87
Discrete Random Variables

Connection between Geometric and Binomial Random


Variables

Can we find the probability of a Geometric RV using the Binomial RV


For Geometric
P{Z = k} = (1 p)k1 p (12)
For Binomial  
n k
P{Z = k} = p (1 p)nk (13)
k

41 / 87
Discrete Random Variables

Connection between Geometric and Binomial Random


Variables

Can we find the probability of a Geometric RV using the Binomial RV


 
k 1
P{X = 1} = p (1 p)k1
1

P{X = 1}
k
 = p 1 (1 p)k1 = P{Z = k}
1

42 / 87
Discrete Random Variables

Connection between Geometric and Binomial Random


Variables

In k bernoulli trials, there are k ways in which you can have 1 success
and k 1 failures
Since the Binomial random variable counts succeses and failures, it
sums and considers all the k outcomes together

43 / 87
Discrete Random Variables

Connection between Geometric and Binomial Random


Variables

For K = 4, a Binomial RV X jointly considers the outcomes 0001, 0010,


0100, 1000

P{X = 1} = P{(0001) (0010) (0100) (1000)}

P{X = 1} = P{(0001)} + P{(0010)} + P{0100)} + P{1000)}


Since the underlying Bernoulli trials are independent:
For Geometric RV, we are intrested only in one of these outcomes 0001

=> P{Z = 1} = P{X = 1}/k

44 / 87
Discrete Random Variables

Memoryless Property

Geometric RV satisfies the memoryless property


Memoryless property is satisfied when

P{Z = j + k/Z k} = P{Z = j} (14)

This property is called the Markov Property

45 / 87
Discrete Random Variables

Memoryless Property

Memoryless property is satisfied when

P{Z = j + k/Z k} = P{Z = j} (15)

For Geometric RV, RhS of the above equation is

P{Z = j} = (1 p)j p (16)

46 / 87
Discrete Random Variables

Memoryless Property

To prove that the geometric RV satisfies the memoryless property, we


need to show that

P{Z = j + k/Z k} = (1 p)j p (17)

Expand the LHS using the definition of conditional probability

P{Z = j + k Z k}
P{Z = j + k/Z k} =
P{Z k
P{Z = j + k}
=
P{Z K }
(1 p)j+k p
=
(1 p)k p + (1 p)k+1 p + (1 p)k+2 p + . . .

47 / 87
Discrete Random Variables

Memoryless Property

(1 p)j+k p
P{Z = j + k/Z k} =
(1 p)k P + (1 p)k+1 p + (1 p)k+2 p + . . .
(1 p)j+k p
=
(1 p)k ((1 p)0 p + (1 p)1 p + (1 p)2 p + . .
(1 p)j+k p
=
(1 p)k
= (1 p)j p

48 / 87
Discrete Random Variables

Memoryless Property

Geometric RV is the only discrete RV that satisfies the memoryless


property
Because of the memoryless property, the Geometric RV can be thought
of as the number of failures between two successes

49 / 87
Discrete Random Variables

Poisson Random Variables


A Poisson RV, N, is the number of occurences or arrivals of an event A
in a time interval of fixed length
The Poisson RV assumes that:
- The average number of arrivals per time interval, denoted by ,
known as the expected arrival rate.
- The arrivals are independent of each other

50 / 87
Discrete Random Variables

Poisson Random Variables

Poisson RV can be understood through the Binomial RV


Let us decide the fixed Poisson time interval into n very small sub
intervals of length T
- T is so small that only one arrival is possible within each
sub-interval

51 / 87
Discrete Random Variables

Poisson Random Variables

Now the experiment can be treated as Binomial RV where a success


corresponds to the presence of an arrival in a sub-interval
Given that is the average arival rate, what is the probability of
success (success corresponds to an arrival)?

52 / 87
Discrete Random Variables

Poisson Random Variables


Now the experiment can be treated as Binomial RV where a success
corresponds to the presence of an arrival in a sub-interval
Given that is the average arival rate, what is the probability of
success (success corresponds to an arrival)?

P{success} = p = (18)
n

53 / 87
Discrete Random Variables

Poisson Random Variables


Now the experiment can be treated as Binomial RV with parameter
/n
 
n
P{X = k} = b(k; n, /n) = (/n)(1 /n)nk
k
n!
= (/n)k (1 /n)nk
(n k)!k!
n k + 1 k n k
   
nn1n2
= ... 1 1
n n n n K! n n

54 / 87
Discrete Random Variables

Poisson Random Variables

Now the experiment can be treated as Binomial RV with parameter


/n
lim P{X = k} = lim b(k; n, /n)
n n

k
n 
n k + 1 k
 
nn1n2
= lim ... 1 1
n n n n n K! n n

55 / 87
Discrete Random Variables

Poisson Random Variables

Thus, for large n, the Binomial pmf approaches the Poisson pmf

lim P{X = k} = lim b(k; n, /n) = exp ()
n n k!
This is called the Poisson approximation of Binomial random variable.

56 / 87
Discrete Random Variables

Poisson Random Variables

In general, the pmf of a Poisson random variable is



P{N = k} = exp ()
k!
Here is the average arrival rate

57 / 87
Discrete Random Variables

Poisson Random Variables

58 / 87
Discrete Random Variables

End of Discrete Random Variables

59 / 87
Continuos Random Variables

Continuous Random Variables

Continuous random variable has uncountable image.

60 / 87
Continuos Random Variables

Probability Density Function (pdf) of Continuous Random


Variable
The pdf of a continuous random variable , fX (x) is a continuous function of
x SX
Properties of pdf
fX (x) 0, x
+
R
fX (x)dx = 1

61 / 87
Continuos Random Variables

Probability Density Function (pdf) of Continuous Random


Variable
Properties of pdf
P{a X b} = P{a X < b} = P{a < X b} = P{a < X < b}
Rb
P{a X b} = fX (x)
a

62 / 87
Continuos Random Variables

Cummulative Distributive Function (CDF) of Continuous


Random Variable
The CDF of a continuous RV is computed by integrating the pdf
Zt
Fx (t) = P{X x} = fX (x)dx (19)

Conversely, we also have
d
fX (x) = FX (t) (20)
dx

63 / 87
Continuos Random Variables

Properties of a CDF of a Continuous Random Variable

0 FX (x) 1, < x < +


a b => FX (a) FX (b)
limx FX (x) = 0
limx FX (x) = 1
P{X = a} = P{a X a} = 0
a+ 2
 
R
P{a 2 X a 2 } = fX (x)dx fX (a)
a 2

P{a X b} = P{a X < b} = P{a < X b} = P{a < X < b}


P{a X b} = FX (b) FX (a)

64 / 87
Continuos Random Variables

Expected Value of Continuous Random Variable

The expected value of a continuos RV is


+
Z
E {X } = X = xfX (x)dx (21)

65 / 87
Continuos Random Variables

Variance of Continuous Random Variable

The variance of a continuos RV is


+
Z
var {X } = X2 = (x X )2 fX (x)dx (22)

66 / 87
Continuos Random Variables

Exponential Random Variable

An Exponential RV measures the inter-arrival time between two


occurrences of an event
Recall that Poisson distribution counts the total number of arrivals
In that sense, the Exponential RV is the inter-arrival time between two
Poisson arrivals.

67 / 87
Continuos Random Variables

Exponential Random Variable

Exponential RV is the inter-arrival time between two Poisson arrivals


Remembering the definition of a Poisson RV, what should be the
expected inter-arrival time for an exponential RV, E?

68 / 87
Continuos Random Variables

Exponential Random Variable

Exponential RV is the inter-arrival time between two Poisson arrivals


Remembering the definition of a Poisson RV, what should be the
expected inter-arrival time for an exponential RV, E?
1
E {E } =

69 / 87
Continuos Random Variables

Exponential Random Variable

An exponential RV is the inter arrival time between two Poisson arrivals


Lets look at a sub-interval (0, t]of a Poisson window
On average, how many arrivals will take place in the (0,t] subinterval?

70 / 87
Continuos Random Variables

Exponential Random Variable

On average, how many arrivals will take place in the (0,t] subinterval?
t
Arrivals in the (0, t] sub-interval= T
In other words, t arrivals will take place in a (0, T ] subinterval per
window T

71 / 87
Continuos Random Variables

Exponential Random Variable


t arrivals will take place in a (0, t] subinterval per window T
t 0

T exp (t/T )
P{E > t} = P{N = 0} = = exp (t/T )
0!
=> FE (t) = 1 exp (t/T )
d
fE (t) = FE (t) = exp (t/T )
dt T

72 / 87
Continuos Random Variables

Exponential Random Variable


Considering a window of T = 1 unit time, the probability density
function and cummulative distributive functions of an Exponential RV
are:
d
fE (t) = FE (t) = exp (t/T )
dt T

FE (t) = 1 exp (t/T )


Like the Poisson RV, the exponential RV is characterized by a single
parameter

73 / 87
Continuos Random Variables

Exponential Random Variable

Exponential RV is a limiting case of a Geometric RV


Like the Geometric RV, the Exponential RV also possess the
memoryless Markov property

P{E > j + k/E k} = P{E > j} (23)

It can be shown that Exponential RV is the only continuous RV with


memoryless proerty

74 / 87
Continuos Random Variables

Exponential Random Variable

LHS = P{E > j} = 1 P{E j}


= 1 (1 exp (j))
= exp (j)
P{E > j + k E k}
RHS = P{E > j + k/E k} =
P{E k}
P{E > j + k} 1 FE (E j + k)
=
P{E k} 1 FE (E < k)
1 (1 exp ((j + k)) exp (j) exp (k)
= =
1 (1 exp (k)) exp (k)
= exp (j)

75 / 87
Continuos Random Variables

Erlang Distribution
Consider a system that has r different stages each of which is
exponentially distributed
When r phases of this system have identical exponential distributions
then the resulting probability distribution is called r-state Erlang
The density and distribution functions of an Erlang RV are:
r t r 1 exp (t)
fR (t) =
(r 1)!
r
X (t)k
FR (t) = 1 expt
k!
k=1

76 / 87
Continuos Random Variables

Gamma Distribution

If we denote the number of stages r as , and let this parameter take


non-integral values, we get the Gamma, , distribution geiven below:

t 1 exp (t)
f (t) = (24)
()!
R
Here () = x 1 exp xdx and > 0
0
and are called shape and scale parameters, respectively.

77 / 87
Continuos Random Variables

Gamma Distribution

78 / 87
Continuos Random Variables

Gamma Distribution

If we plug in = 1 in gamma distribution, we get exponential RV

t 1 exp (t)
f (t) = > f (t) = exp (t) (25)
()!

79 / 87
Continuos Random Variables

Gamma Distribution

Useful properties of Gamma distribution


() = ( 1)( 1)
() = ( 1)!
( 21 ) = ()( 1)
p

R 1 ()
x exp (x)dx =
0

80 / 87
Continuos Random Variables

Uniform Distribution

A Uniform RV has a uniform distribution over an interval [a, b]

fU (x) (26)

This distribution is also called the Rectangular distribution.

81 / 87
Continuos Random Variables

Uniform Distribution

82 / 87
Continuos Random Variables

Gaussian or Normal Distribution

Gaussian or Normal Distribution is by far the most famous continuous


distribution
It has the famous bell-shaped curve which can be used to approximate
many other distributions

83 / 87
Continuos Random Variables

Gaussian or Normal Distribution

The Gaussian RV is defined as


 2 !
1 1 x
fN (x) = exp (27)
2 2

The Gaussian distribution is completely characterized by its mean and


variance and is generally written as

N(, 2 )

A Gaussian distribution with zero mean and unit variance is called a


standard normal distribution.

84 / 87
Continuos Random Variables

Gaussian or Normal Distribution

85 / 87
Continuos Random Variables

Gaussian or Normal Distribution

The CDF of a Gaussian RV does not have a closed form


Zx  !
1 x0 2

1
FN (x) = exp dx 0 (28)
2 2

86 / 87
Continuos Random Variables

Gaussian or Normal Distribution

Gaussian distribution does not deviate from its mean by more than 3
standard deviations 99.7% of the times

87 / 87

You might also like