Sunteți pe pagina 1din 65

ENCS 6161

Probability and Stochastic Processes


Concordia University
Course Material 3

Expected value of random variables


The expected value or mean of a discrete random variable
is defined as
= =

() =

( )

The expected value is defined if the above sum converges


absolutely, that is,
=

<

The expected value of a random variable does not exist if


for this random variable the above summation does not
converge.
[] corresponds to the average of in a large number of
observations of
2

Example 9: Mean of Bernoulli random


variable
= 0, 1
= 0 0 + 1 1 = 0 + =

Example 10: Mean of the random variable in


the 3-coin tosses (Example 1) (Binomial

random variable with = , = )

Let be the number of heads in three tosses of a


fair coin. Find .
3

()
=0

1
3
3
1
=0
+1
+2
+3
= 1.5
8
8
8
8
4

Example 11: Mean of a Uniform


Discrete Random Variable
= 0,1, , 1
1
=
,
= 0,1, 1

1
1
1
=
=

=0

=0

1
=
0 + 1 + + 1

1 1
1
=
=

2
2
5

Example 12
A player pays $1.50 to toss a coin 3 times, and
wins $1 if the number of heads is 2 and $8 if the
number is 3.
(a) Find the expected value of the reward .
(b) What is the expected value of the gain?

(a)

4 1
0 = , , , = =
8 2
3
1 = , , =
8
1
8 = =
8
=


{0,1,8}

= 0 0 + 1 1 + 8 8
1
3
1
11
=0
+1
+8
=
2
8
8
8
(b)

11 12
1
1.5 = 1.5 =

=
8
8
8
Thus, the player losses 12.5 cents on average per game.
7

Mean of a geometric random variable


= 1 ,

= 1,2,

=
=1

=1

(1)

=1

For a geometric series:


1
=
1
Differentiating
1
=
2
1

=0

(2)

=1

Letting = in (2) and using it in (1):


1
1
1
=
= 2=
2
1

Sample mean and expected value


Perform independent repetitions of an
experiment that generates . Record the
observed values 1 , 2 , , (), where
() is the observed value in the jth trail.
Let () be the number of time is
observed. Therefore,
()
=

is the relative frequency of


10

The arithmetic average or sample mean


1 + 2 ++
< > =

1 1 + 2 2 + + +
=

= 1 1 + 2 2 + + +
=

Since lim () = ( ) for all :

< > =

= []

Thus, we expect the sample mean to converge to the


expected value as becomes large
11

Expected value of functions of a


random variable
Let be a discrete random variable, and let = ().
Since is discrete, = () will also assume countable set
of values of the form ( ), where . We can denote
the set values assumed by () as 1 , 2 , . Now, consider
( ) =


: =

But
= =
: =

= =
=
12

( ) =

(1)

Thus, if = (), the expected value of ,


[], can be obtained from =
by replacing in it with .

13

Example 13
Let be a noise voltage that is uniformly
distributed in = 3, 1, +1, +3 with
1
= for . Find [], where = 2
4

14

Approach I:
= 1, 9

1 1 1
1 = 1, +1 = 1 + 1 = + =
4 4 2
1 1 1
9 = 3, +3 = 3 + 3 = + =
4 4 2
1
1
= 1 1 + 9 9 = 1
+9
=5
2
2
Approach II:
=

= 3

1
+ 1
4

1
+ 1
4

1
= 9+1+1+9 =5
4

1
+ 3
4

1
4

15

Let be defined as a function of the random variable :


= + +
where , and are real number, then, by (1):
= + +
=

+ +

= () +

(3)
16

From (3), the following results can be obtained


(i) = 0, = = 1
+ =
(ii) = = 0, =

+ ()

(4)

=
(iii) = 0, =

(5)

+ = +
(iv) = = 0

(6)

(7)
17

Example14
is noise voltage uniformly distributed in
= 3, 1, 1, 2 . The voltage is amplified
and shifted to obtained = 2 + 10, and then
square to produce = 2 = 2 + 10 2 . Find
[].

18

= 2 + 10 2 = 4 2 + 40 + 100
= 4 2 + 40 + 100
1
,
4

Since is uniformly distributed, =


.
= 3 3 + 1 1
+ 1 1 + 3 3
1
= 3 1 + 1 + 3 = 0
4
In Example 13, we obtained 2 = 5.
Therefore,
= 4 5 + 40 0 + 100 = 120

19

Variance of a random variable


Since the expected value of a random variable is a constant,
it is also denoted as = [].
The variance of a random variable is defined as the
expected value of 2 :
2 = = 2
=

( )

=
=1

The standard deviation of the random variable is defined


as square root of the variance:
= =

1
2

20

An expression for the variance can be obtained as


follows:
= 2
= 2 2 + 2
= 2 2 + 2
= 2 2 = 2 2
[ 2 ] is called the second moment of . The nth
moment of is defined as [ ].
+ = + + 2
= + 2
= 2
+ =
Thus, adding a constant to a random variable does not
affect the variance
21

= 2
= 2
= 2 2
= 2
Thus, scaling a random variable by scales
the variance by 2 and the standard deviation
by ||.
Let = , then
= 2
= [] 2 = 2 = 0
Thus, a constant random variable has a zero
variance.
22

Example 15
Find , where is the number of heads in
three tosses of a fair coin.

23

We have already obtained the mean of (Example 8):


=
= 0 0 + 1 1 + 2 2 + 3 3
1
3
3
1
= 0
+ 1 + 2 + 3 = 1.5
8
8
8
8
Now,
2 = 0 2 0 + 1 2 1 + 2 2 2
+ 3 2 3
1
3
3
1
= 0
+ 1 + 4 + 9 =3
8
8
8
8
2
3
3
2
2
= = 3
= = 0.75
2
4

24

Example 16: Variance of Bernoulli


random variable

= {0,1}
0 = 1 =
1 =
= = 0 1 + 1 =
2 = 0 2 1 + 1 2 =
2
= 2 = 2
= 1 =
25

Example 17: Variance of geometric


random variable
For a geometric random variable:
= 1
Consider the geometric series:

1
=

1
Differentiating (1) w.r.t.
1
1

= 1,2 3 ,
(1)

=0

Let =
1
1

(2)

=0

=
=1

26

=0

Differentiating (2) w.r.t. :


2
1

=
1

1
= 2=

( 1) 2

(3)

=0

Letting =
2
1

( 1)2

=
=0

Multiplying both sides by :

2
=
1 1
3
1
2
=
2

=0

2 1
=0

=0

2 1 2 + 2 + 1
1+
= 2+ =
=
= 2

2
2

2
1
+

2
2
= = 2
= 2

27

Conditional probability mass function


Let be an event that has a non-zero
probability, > 0. The conditional
probability mass function of given is
defined by the conditional probability:
= =
[ = ]
=
[]

28

Thus, the conditional probability of the event


= given is given by the probabilities of
the outcomes for which both = and
are also in , normalized by [].
=

1
=
[]

(1)

29

The set of events = = is a partition


of
= =
=
=

Thus, (1) becomes


[]
=
=1
[]
30

Most of the times, event is defined in terms


of , e.g., = > 10 or
= 5 10 .
=
=

= = = , if
= = , if
=

( )



31

Example18: Residual waiting times


Let be the time required to transmit a message,
where is a uniform random variable with
= 1, 2, . Assume that a message has
already been transmitting for time units, find
the probability that the remaining transmission
time is time units.

32

We are given that = > .


For + 1 + :
=+ >
+ > =
>
=+
=
>
1
=

1
=
, + 1 +

Thus, is equally likely to be any of the remaining


1
possible values. As increases,
increases implying that

the end of the message transmission becomes increasingly


likely.
33

Many random experiments have natural ways of


portioning the sample space into a union of
disjoint events 1 , 2 , , . Then, by using the
theorem on total probability:
= =
= = 1 1 + = 2 2
+ + =


=1

34

Example 19: Device lifetime


A production line yields two types of devices.
Type 1 devices occur with probability
Type 2 devices occur with probability 1
Type 1 devices work for short time and have lifetime that is
geometrically distributed with parameter .
Type 2 devices work relatively much longer and have lifetime
that is geometrically distributed with parameter .
Let be the lifetime of an arbitrary device. Find the pmf of X.
35

The random experiment that generates


involves selecting a device type and then
observing its lifetime. Partition the sets of
outcomes into event 1 consisting of those
outcomes in which the device is type 1, and
2 consisting of those outcomes in which the
device is type 2.
1 =
2 = 1
1 = 1 1 ,
= 1, 2,
2 = 1 1 ,
= 1, 2,
pmf using the theorem on total probability:
= 1 1 + 2 2
= 1 1 + 1 1 1 ,

= 1, 2, 36

Conditional expected value


Conditional expected value or conditional mean of given
is defined as
| = =

Conditional variance of given is defined as

| |
2

|
=1

2
= 2 | |
37

Property:

[ ]

()

=1

where is partitioned into union of disjoint events 1 , 2 , ,


proof:
=


=1

Using the theorem on total probability:


=

=1

=1


=1


=1

Similarly,

() =

() [ ]

()

=1
38

Example 20: Device Lifetime


Find (a) the mean, and (b) the variance for
device lifetime in the Example 19.

39

(a) By using (A):


= = |1 1 + |2 2
1 =
2 = 1
1 = 1 1 ,
= 1, 2,
1
|1 =

2 = 1 1 ,
= 1, 2,
1
|2 =

1
1
= + 1

40

(b) by using (B)


2 = [ 2 |1 ] 1 + [ 2 |2 ] 2
2
2
1 = 2

2
2
2 = 2

2
2
= 2 + 2 1

= 2 2
2
2
= 2 + 2 1

2
1
1

+ 1

41

Some important discrete random


variables
1. Bernoulli Random Variable
A single coin toss can be modelled as Bernoulli
random variable .
= 0, event does not occur
= 1, event does occur
= = 0,1
=
0 = = 1
1 =
42

Mean and variance ( already obtained):


= =
2 = = = 2
The variance is quadratic in , with value zero at
1
= 0 and = 1, and maximum value of
1
.
2

at = This agrees with intuition, since values


of close to 0 or to 1 imply a preponderance of
successes or failures, and hence less, variability in
the observed values. The maximum variability
1
occurs when = which corresponds to the case
2
that is most difficult to predict.
43

2. Binomial Random Variable


A random experiment is repeated independent times.
Let be the number of times a certain event occurs in
these trials. is then a random variable with range
= 0, 1, ,
= 1 + 2 + +
where is the indicator function for the event A in the jth
trial.
Thus, is the sum of the Bernoulli random variables
associated with each of the independent trials.
The pmf of is given by

= = =
1

= 0, 1, ,

is called binomial random variable and its distribution


(pmf) is called binomial distribution.
44

[ = ] is maximum at = + 1 ,
where denotes the largest integer that is
smaller than or equal to .
When + 1 is an integer, then the
maximum is achieved at and 1.
+ 1

=
, 0 = 1

+1 1

45

Mean of a binomial random variable

=
Since = 0 term is zero,

=
=0

=0

[] =

=1

!
1
! !

Cancelling between numerator and denominator,

!
=
1
1 ! !
=1

=
Letting k = j + 1,

=1
1

=
=0
1

=
=0

( 1)!
1 1
( 1)! !
1 !
1
! 1 !
1
1

Since the summation contains all the terms in a binomial pmf with parameters 1 and , it is equal to
1.
=
46

Variance of a binomial random variable

!
1
! !

=0

=
Let = + 1

!
1
1 ! !

=1

2 =

=0
1

1
=0

1
1

1
1

= 1 + 1 = +

2 = = 2
= = (1 )

= +

47

3.

Geometric random variable


= 1 ,

= 1,2,3,

1
=

= 2

The probability that can be obtained as

=
=1

=1

=
=1

1
=
1

= 1
(1)
Therefore,
> = 1 = 1 1 + = (2)
48

+ >
+ > =
>
+
=
>
>+1
=
>
Using (2):
+1
1
+ > =
=

= >1
=
49

The geometric random variable is the only


discrete random variable that satisfies the
memoryless property in the sense that if a
success has not occurred in the first j trials,
then the probability of having to perform at
least k more trials is the same as the
probability of initially having to perform at
least k trials.
The geometric random variable is used in
situations where we are interested in the time
(i.e., number of trials) that elapses between the
occurrence of events in a sequence of
independent experiments.
50

Sometimes we are interested in = 1,


the number of failures before a success occurs.
The random variable is also referred to as
the geometric random variable. The pmf of
is obtained as:
= = = = + 1 = = 0, 1,

The examples of the modified geometric


random variable are the number of
customers awaiting service in a queueing
system or the number of white dots between
successive black dots in a scan of a black-andwhite document.
51

4. Poisson random variable


In some applications, we are interested in counting the number of occurrences
of an event in a certain time period or in a certain region in space.
The Poisson random variable arises in situations where the events occur
completely at random in time or space.
1. Counts of emissions from radioactive substances
2. Counts of demands for telephone connections in a given time period
3. Counts of defects in a semiconductor chip.
The pmf for the Poisson random variable is given by


= = =

= 0, 1,

: average number of event occurrences in a specified time interval or region


in space.

For < 1, occurs at = 0.


For > 1, occurs at = , i.e., the largest integer
For a positive integer, occurs at = 1 and at
= .
52

= 0, 1,
!
The pmf of the Poisson random variable sums to unity

() =
=
= = 1
!
!
=0

Mean:
Taylor series expansion of

=0

=0

=
=0

Differential (1) w.r.t.

=
1
=

=0

=
=0

=0

=
!

= []
=0

Therefore,

=
53

Variance:
Differentiating (2) w.r.t.

=
=0

= 2

2
1
!

=0

2 =
=0

2
!

=0

2 = 2
2 = 2 +
=
= + =
54

Example 21: Queries at a call center


The number of queries, , arriving in seconds
at a call center is a Poisson random variable with
= , where is the average arrival rate in
queries/second. Assume that the arrival rate is 4
queries per minute. Find the probability of the
following events:
(a) More than 4 queries in 10 seconds
(b) Fewer than 6 queries in 2 minutes
55

(a)

= 10
1
= =
/
15
>4 =1 4
4

=1
=0

2
10 =
3
4

= 1
=0

= 6.33 104

2
2
3
3

(b)

= 2 60 = 120
1
= =
/ 120 = 8
15
5

<6 =
=0

=
=0

8 8
= 0.1
!
56

Example 22
The requests for telephone connections arrive at
a telephone switching office at a rate of calls
per second. It is known that the number of
requests in a time period is a Poisson random
variable. Find the probabilities that (a) there is
no call requests in seconds, and (b) there are
or more requests.

57

(a) let () be the random variable representing the


number of requests in seconds.
The average number of call requests in a t-second
period is = . For = = 0
0
=0 =
=
0!
(b)
=1 1
1

=1
=0
1

=1
=0

!
()

!
58

Let be the time until the occurrence of the


first event? What is the probability that > ,
that is, the probability that the first event
occurs after t seconds? Thus,
> =0
> =

59

Approximation of binomial random variable


One of the applications of the Poisson pmf is to approximate the binomial pmf in the
case where is very small and is very large. We now show that if is large and is
small such that = is finite, then the binomial probabilities can be approximated as

=
1

= 0, 1, 2, .

!
0 = 1

Since = , i. e. , =

0 = 1

+1 1 1
+1
= +1

+1
! !
+1 ! 1 !
=
=
!

+ 1 ! 1 ! (1 )
(1 )
! !

+1

=
=
=
+ 1

+ 1 1 ( + 1)(1 )
+1 1
60

+1
+1

+1

=
+1

0
1
1
+1

+1
+1 =
0
+1 !


=
0 =

!
!
Thus, the Poisson pmf is the limiting from of the
binomial pmf when the number of the Bernoulli
trials is made very large and the probability of
success is kept small, so that = is finite.
61

Example 23: Errors in Optical Transmission

An optical communication system transmits


information at a rate of 109 bits/second. The
probability of a bit error in the optical
communication system is 109 . Find the
probability of five or more errors in 1 second.

62

Each bit transmission corresponds to a


Bernoulli trial with a success corresponding
to a bit error in transmission. The probability
of errors in = 109 bits transmissions (in 1
s) is then given by the binomial probability
with = 109 , = 109
A Poisson approximation can then be used
with = = 109 109 = 1 success in 1 s
5 =1 <5
4

=1
=0

1 1
= 0.00366
!
63

Event occurrence in subintervals of a time period


Poisson random variable also arises in situations where
we can imagine a sequence of Bernoulli trails taking
place in time. Consider counting the number of event
occurrences in a T-second interval.
Divide the time interval into a very large number of
subintervals, .
A pulse in a subinterval indicates the occurrence of an
event. Each subinterval can be viewed as one in a
sequence of independent Bernoulli trials, if the
following assumptions hold:

64

1) At most one event can occur in a subinterval,


that is, the probability of more than one event
occurrence in a subinterval is negligible.
2) The outcomes in different subintervals are
independent.
3) The probability of an event occurrence in a
subinterval is = /, where is the average
number of events observed in the T-second
period.
The number of events in a T-second period is a
binomial random variable with parameters and
= / .
Thus, as , becomes a Poisson random
variable with parameter .

65

S-ar putea să vă placă și