Stochastic Process
Stochastic Process
Stochastic Process
Stochastic Process:
A random variable X (t) is said to be a stochastic process if X takes different values at different
points of time t. Here, X (t) indicates the states of the process.
A stochastic process is a family of random variables, {X(t) : t ∈ T}, where t usually denotes time.
That is, at every time t in the set T, a random number X(t) is observed.
(Note that X(t) need not change at every instant in time, but it is allowed to change at any time;
i.e. not just at t = 0, 1, 2, . . . , like a discrete-time process.)
1
Stochastic Process
State space: The state space, S, is the set of real values that X(t) can take. The state space S is the
set of states that the stochastic process can be in.
Every X(t) takes a value in ℝ, but S will often be a smaller set: S ⊆ ℝ. For example, if X(t) is the
outcome of a coin tossed at time t, then the state space is S = {0, 1}.
The state space S is discrete if it is finite or countable. Otherwise it is continuous.
2
Stochastic Process
>AIUB) is not "deterministic". In this simplistic example, your end point (AIUB) is
deterministic, but your route sequence is a stochastic process.
Stochastic processes have played a significant role in various engineering disciplines like power
systems, signal processing, manufacturing systems, automotive technology, semiconductor
manufacturing, communication networks, robotics, wireless networks etc. In communication
networks, unpredictability and randomness arise for several reasons. For one, connections come
in and leave randomly. At the time of connection establishment, circuit switched networks
typically need to find sufficient resources for the connection in the absence of which, a
connection is refused. For packet switched networks such as the internet, even though the above
constraint is not there, however, each packet is routed individually by the switches based on
current information available and can take a different path. Also, packets can be dropped if
sufficient resources are not available. In most networks, the packets that individual connections
pump into the network are of varying sizes (one packet may have a different size than the other
in each connection) and thus each packet holds the network for a varying (random) amount of
time. Moreover, the links can fail randomly and so reliability of the medium is also an issue.
From the perspective of the user, the total time needed to transmit, say a file, should be the least
possible. Whereas processing, transmission and propagation delays of packets are not significant
in general, queuing delays are. The latter depend on the size of packets and also the number of
connections operational at a given time. Stochastic processes are thus crucially used in the
design, analysis and control of networks. Control in networks can be broadly classified under
four heads - admission control, routing, flow and congestion control, and resource allocation.
Designing good control strategies requires a good knowledge of stochastic control, parameter
estimation, simulation-based optimization, queuing theory, learning theory etc., for all of which
stochastic processes form the key ingredient.
Another area where stochastic processes have applications is in the area of neuroscience.
Analysis of EEG signals from the brain makes intensive use of stochastic processes. Among the
awesome repertoire of tasks that the human brain can accomplish, one of the more fascinating
ones is how the electrical activity of millions of brain cells (neurons) is translated into precise
sequences of movements. One of the greatest challenges in applied neuroscience is to build
3
Stochastic Process
prosthetic limbs controlled by neural signals from the brain. The ultimate goal is to provide
paralytic patients and amputees with the means to move and communicate by controlling the
prosthetic device using brain activity. Scientists and engineers are slowly getting closer to
building such devices thanks to studies revealing a strong connection between the activity of
neurons in the brain's cerebral cortex and the movements of limbs. To realize the above goal of
building prosthetic limbs, one tool which plays a critical role is the theory of stochastic
processes.
Counting Process:
A stochastic process {N(t), t ≥ 0} is said to be a counting process if N(t) represents the total
number of events that have occurred up to time t.
4
Stochastic Process
Markov Property:
The processes can be written as {X0, X1, X2, . . .}, where Xt is the state at time t. The processes
that have a crucial property in common:
Xt+1 depends only on Xt.
It does not depend upon X0, X1, . . . , Xt−1.
Let {X0, X1, X2, . . .} be a sequence of discrete random variables. Then {X0, X1, X2, . . .} is a
Markov chain if it satisfies the Markov property:
P (Xt+1 = s |Xt = st …, X0 = s0) = P (Xt+1 = s |Xt = st),
for all t = 1, 2, 3, . . . and for all states s0, s1, . . . , st, s.
A stochastic process in state i moves to state j with associated probabilities 𝑝𝑖𝑗 such that 𝑝𝑖𝑗 ≥ 0
and ∑∞
𝑗=0 𝑝𝑖𝑗 = 1. Such a stochastic process is called Markov process. The parametric space of
the above discussed Markov process is discrete and hence this process is called Markov Chain.
The matrix describing the Markov chain is called the transition matrix. It is the most important
tool for analyzing Markov chains.
5
Stochastic Process
Notes:
1. The transition matrix P must list all possible states in the state space S.
2. P is a square matrix (N × N), because Xt+1 and Xt both take values in the same state space S
(of size N).
3. The rows of P should each sum to 1:
This simply states that Xt+1 must take one of the listed values.
4. The columns of P do not in general sum to 1.
6
Stochastic Process
WAIT
0.99
IDLE LOOP
STATE
S0
USER
SYSTEM 0.01
SUPERVISOR
SUPERVISOR
0.02 0.90
SUPERVISOR 0.02
STATES
S1 S2
0.01
0.92 0.01 0.01
0.04 0.09
PROBLEM
STATE S3
USER
0.98 PROGRAMS 7
Stochastic Process
Construct a transition probability matrix and calculate states probabilities and mean recurrence
time.
Solution:
To State
S0 S1 S2 S3
S0 0.99 0.01 0 0
From S1 0.02 0.92 0.02 0.04
State S2 0 0.01 0.90 0.09
S3 0 0.01 0.01 0.98
Transition Probability Matrix
So,
𝑃0 = 0.99𝑃0 + 0.02𝑃1
𝑃1 = 0.01𝑃0 + 0.92𝑃1 + 0.01𝑃2 + 0.01𝑃3
𝑃2 = 0.02𝑃1 + 0.90𝑃2 + 0.01𝑃3
𝑃3 = 0.04𝑃1 + 0.09𝑃2 + 0.98𝑃3
1 = 𝑃0 + 𝑃1 + 𝑃2 + 𝑃3
Equilibrium state probabilities can be computed by solving system
of equations. So we have:
𝑃0 = 2/9, 𝑃1 = 1/9, 𝑃2 = 8/99, 𝑃3 = 58/99
Mean Recurrence Time
𝑡𝑟𝑗 = 1⁄𝑃𝑗
𝑡𝑟0 = 50 / (2/9) = 225ms
𝑡𝑟1 = 50 / (1/9) = 450ms
𝑡𝑟2 = 50 / (8/99) = 618.75ms
𝑡𝑟3 = 50 / (58/99) = 85.34ms
8
Stochastic Process
Example 7.1
9
Stochastic Process
Example 7.2
Which states are transient, recurrent and absorbing with each other?
Ans:
• Transient states: {1, 2}
• Recurrent states: {0} {3}
• Absorbing states: {0} {3}
The transition of the process can occur after k steps, where (𝑝𝑖𝑗 )(𝑘) is the transition probability
from i to j in k steps.
Dean of FST in AIUB states his intention to give a promotion by the end of next semester to the
employee P. And P forwards the same message to Q, who further gives the news to R and so on.
In such scenario there is a probability p that a person will replace the answer from yes to no
while conveying the message to the next person and a probability y that the person will change
the answer from no to yes.
10
Stochastic Process
Marketers use Markov Chain to predict brand switching behavior within their customers. Let us
take the case of Detergent Brands. Some consumers might be using “Tide”, Some would be
using “Surf Excel”, Others would be using something else. In this case a Brand Marketer would
be interested in knowing what is the probability of a consumer to switch to using “Surf Excel”
next month in case he is using “Tide” this month. He would be interested in knowing what is the
probability of a customer to continue using “Tide” next month in case he is using “Tide” in the
current month, etc. Using Markov chain helps them get the probability of each of the cases thus
helping them predict brand switching behavior.
Markov chain can also be explained with the example of a frog in a pond jumping from lily pad
to lily pad with the relative transition probabilities. Lily pads in the pond represent the finite
states in the Markov chain and the probability is the odds of frog changing the lily pads.
Google Page Rank: The entire web can be thought of as a Markov model, where every web
page can be a state and the links or references between these pages can be thought of as,
transitions with probabilities. So basically, irrespective of which web page you start surfing on,
the chance of getting to a certain web page, say, X is a fixed probability.
Typing Word Prediction: Markov chains are known to be used for predicting upcoming words.
They can also be used in auto-completion and suggestions.
Subreddit Simulation: Surely, you’ve come across Reddit and had an interaction on one of their
threads or subreddits. Reddit uses a subreddit simulator that consumes a huge amount of data
containing all the comments and discussions held across their groups. By making use of Markov
chains, the simulator produces word-to-word probabilities, to create comments and topics.
Text generator: Markov chains are most commonly used to generate dummy texts or produce
large essays and compile speeches. It is also used in the name generators that you see on the web.
11
Stochastic Process
Poisson process:
A counting process {N(t), t ≥ 0} is said to be a Poisson process if event N(t) occurs at Poisson
rate λ and follows:
N(0) = 0.
N(t) increases independently.
The number of events in any interval of length t is Poisson distributed with mean λt
𝒆−𝝀𝒕 (𝝀𝒕)𝒏
𝑃[𝑁(𝑡 + 𝑠) − 𝑁(𝑠) = 𝑛] = ; 𝑛 = 0, 1, 2, … , ∞.
𝒏!
12
Stochastic Process
Example 7.4: A communication system sends the digits 0 and 1 as a mode of communication.
The digit sent from the center reaches to the destination after several steps as it is sent. A digit 0
sent from the center reaches to the next step as zero with probability 0.4. Find the probability that
the digit 0 sent from the center will reach to the destination at 5th stage.
𝑝00 𝑝01 0.4 0.6
Solution: The transition probability matrix: 𝑃 = [𝑝 𝑝 ]=[ ]. To reach the
10 11 0.6 0.4
4
destination at 5th step, it needs further (5-1) = 4 steps. Thus, we need 𝑃00 𝑖𝑛 𝑃4 .
Example 7.5: Signals sent from a station reach its goal at Poisson rate 𝜆 = 5 per hour. Find the
probability that the elapsed time between the entrance of 5th and 6th signal is (i) more than 1 hour,
(ii) less than 0.5 hour, (iii) 0.5 to 1 hour. Find the expected time until the 9th signal reaches its
goal.
Solution: Let T be the elapsed time between the entrance of (n −1)th and nth signal and Sn be the
waiting time until the nth signal reaches to the destination.
i. 𝑃(𝑇 > 1) = 𝑒 −𝜆𝑡 = 𝑒 −5×1 = 0.00674
1
1
ii. 𝑃 (𝑇 < ) = 1 − 𝑒 −𝜆𝑡 = 1 − 𝑒 −5×2 = 0.91792
2
13
Stochastic Process
iii. 𝑃(0.5 < 𝑇 < 1) = 𝑒 −𝜆𝑡1 −𝑒 −𝜆𝑡2 = 𝑒 −5×.5 −𝑒 −5×1 = 0.08208 - 0.00674 = 0.07534
𝑛 9
E (Sn) = 𝜆 = 5 = 1.8 ℎ𝑜𝑢𝑟
Example 7.6: Emails enter to a cybercafé after several stages. An email sent from a cybercafé
reaches to the next stage with probability 0.7. Find the probability that an email sent from cyber
cafe reaches to another cybercafé to the address at 4th stage.
14
Stochastic Process
Exercise 7
7.1. Write down some examples of stochastic process and counting process.
15
Stochastic Process
7.4. Customers enter to a mobile repairing shop from 9 – 10 and from 10 – 11 with
probability 0.6. Customers also enter to the shop from 10 – 11 but not from 9 – 10 with
probability 0.8. Find the probability that the customers will enter to the repairing shop up
to 2 PM starting from 9 AM.
7.5. Customers enter to a mobile repairing shop from 9 – 10 and from 10 – 11 with
probability 0.6. Customers also enter to the shop from 10 – 11 but not from 9 – 10 with
probability 0.4. Find the probability that the customers will enter to the repairing shop up
to 1 PM starting from 9 AM.
7.6. E. mails enter to a cybercafé at a Poisson rate λ = 2 per minute. Find the probability that
the elapsed time between the entrance of 10th and 11th mail is (i) more than 1 minute, (ii)
less than 2 minutes, (iii) between 1 to 2 minutes.
16
Stochastic Process
7.7. The customer enters to a bank at Poisson rate λ = 25 per hour. Find the probability that
the elapsed time between the entrance of 10th and 11th customer is (i) less than 2 minutes,
(ii) more than 5 minutes, (iii) 3 to 5 minutes.
7.8. E-mails enter to a cybercafé at a Poisson rate λ = 2 per minute. Find the expected time
until the entrance of 10th mail.
7.9. The customer enters to a bank at Poisson rate λ = 25 per hour. Find the expected time
until the entrance of 50th customer.
7.10 Consider a communication system which transmits the digits 0 and 1 through several stages.
At each stage the probability that the same digit will be received by the next stage, as
17
Stochastic Process
transmitted, is 0.75. What is the probability that a 0 that is entered at the first stage is received as
a 0 by the 5th stage?
7.11 Now consider a Markov chain with the following state transition diagram
iii) Is state 2 accessible from state 0? b) Is state 0 accessible from state 2? c) Is state
1 accessible from state 0? d) Is state 0 accessible from state 1? e) Which states
communicate with each other?
Sample MCQ
1. Customers enter to a cyber cafe from 9 – 10 am and from 10 – 11 am with probability 0.6.
Customers also enter to the shop from 10 – 11 am but not from 9 – 10am with probability 0.8.
Find the probability that the customers will enter to the cyber cafe up to 12 pm starting from 9
am.
2. E.mails enter to a server after several stages . An e.mail sent from a server reaches to the next
stage with probability 0.4 . Find the probability that an e.mail sent from server reaches to another
server to the address at 4th stage.
18
Stochastic Process
3. Telephone calls enter to a hospital at a Poisson rate = 2 per minute. Find the probability that
the elapsed time between the entrance of 11th and 12th call is more than 1 minute.
4. Telephone calls enter to a hospital at a Poisson rate = 2 per minute. Find the probability that
the elapsed time between the entrance of 11th and 12th call is less than 2.
5. Telephone calls enter to a hospital at a Poisson rate = 2 per minute. Find the probability that
the elapsed time between the entrance of 11th and 12th call is between 1 to 2 minutes.
6. Telephone calls enter to a hospital at a Poisson rate = 3 per minute. Find the expected time
until the entrance of 15th call. 2 points
19