Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Random variable

INSTRUCTOR: DR. AQSA ASLAM


EMAIL: AQSA.ASLAM@NU.EDU.PK
Random variable

► A random variable is a mapping from the sample space Ω to the set of real numbers
► A random variable is a function or rule that produces numbers from the outcome of a random experiment
► Random variables represented by boldface, i.e., X, Y, etc.,
► while individual or specific values of the mapping X are denoted by X(ω).
► Three types of Random variable (X):
► Mixed
► Discrete
► Example Rolling a die

► Continuous
► Example Gaussian distribution
Example: Discrete Random Variable

► Consider a random variable I defined as the size of an IP packet rounded up to closest kilobyte.
► I assumes values from the domain D = {1,2,3,..., 64}. This set is both mutually exclusive and exhaustive.
► Mutually exclusive the random variable cannot simultaneously take on more than one value
► Exhaustive the random variable cannot assume a value that is not an element of D

► The underlying sample space S is the set of potential packet sizes and is therefore identical to D. The probability
associated with each value of I is the probability of seeing an IP packet of that size in some collection of IP
packets, such as a measurement trace.
Example: Continuous Random Variable

► Consider a random variable T defined as the time between consecutive packet arrivals at a port of
a switch (also called the packet inter-arrival time).
► Although each packet’s arrival time is quantized by the receiver’s clock, so that the set of inter-arrival times are
finite and countable, given the high clock speeds of modern systems, modelling T as a continuous random
variable is a good approximation of reality. The underlying sample space S is the subset of the real line that
spans the smallest and largest possible packet inter-arrival times.
► As in the discrete example, the sample space is identical to the domain of T.
Random variable

► In most scientific and technological applications:


► Measurements and observations are expressed as numerical quantities.
► Traditionally, numerical measurements or observations that have uncertain variability each time they are repeated are called
random variables.
► Typically denote numerical-valued random quantities by uppercase letters such as X and Y.
► The advantage of working with numerical quantities is that we can perform mathematical operations on them such as:
► X +Y
► XY
► max(X,Y)
► min(X,Y)
Example of Random Variable

► In a telephone channel the signal X is corrupted by additive noise Y


► In a wireless channel, the signal X is corrupted by fading (multiplicative noise).
► If X and Y are the traffic rates at two different routers of an Internet service provider, it is desirable to have these rates
less than the router capacity (c); i.e., we want max(X,Y) ≤ c.
► If X and Y are sensor voltages, we may want to trigger an alarm if at least one of the sensor voltages falls below a
threshold v; e.g., if min(X,Y) ≤ v.

Operations on random variables


Probabilities involving random variables

► A real-valued function X(ω) defined for points ω in a sample space Ω is called a random variable.
► Random variables are important because they provide a compact way of referring to events via their numerical
attributes.
► For example, if X models the number of visits to a website,
► It is much easier to write P(X > 1000) than to write P(number of visits > 1000)
Cumulative Distribution Function (cdf)

► The cumulative distribution function, CDF, or cumulant is a function derived from the probability density
function for a continuous random variable.
► It gives the probability of finding the random variable at a value less than or equal to a given cutoff
► A few examples of ranges: [0, 1], [0, ∞), (−∞, ∞), [a, b].
► Let us denote the probability of the event X ≤ x, where x is given, as P(X≤ x)
► Definition
The cumulative distribution function (CDF) of random variable X is defined as

F (x)=P(X≤x), for all x∈ R.


X
Cumulative Distribution Function (cdf)

► The cdf has the following properties:


1. This property show that FX(-∞) includes no possible events

2. This property show that FX(∞) includes possible events

3. FX(x) is a probability

4. FX(x) is a non decreasing function

5. It is easy to prove since probability is given


Example of cdf

► Consider a discrete random variable D that can take on values {1, 2, 3, 4, 5} with probabilities {0.2, 0.1,
0.2, 0.2, 0.3} respectively. The latter set is also the probability mass function of D. Because the domain
of Dis totally ordered, we com-pute the cumulative density function F(D) as F(1) = 0.2, F(2) = 0.3, F(3) =
0.5, F(4) = 0.7, F(5) = 1.0.
Probability Density Function (pdf)

► The probability density function (PDF) of a continuous (or discrete) random variable is a function which
can be integrated (or summed) to obtain the probability that the random variable takes a value in a given
interval.
► In many cases, we are not interested in the actual value taken by a random variable, but in the probabilities
associated with each such value that it can assume.
► Consider a discrete random variable that assumes distinct values D = {x1, x2,..., xn}.
► We define the value p(xi) to be the probability of the event that results in assuming the value xi
► The function p(Xd3), which characterizes the probability that will take on each value in its domain is called the
probability mass function of 3.
► It is also sometimes called the distribution of Xd.
Probability Density Function (pdf)

► Computation
Discrete Probability Models

► Standard some discrete distributions that frequently arise when studying networking problems.
► Bernoulli distribution
► Binomial distribution
► Geometric distribution
► Poisson distribution
Bernoulli Distribution

► A discrete random variable X is called a Bernoulli random variable if it can take only two
values, 0 or 1, and its probability mass function is defined as
p(0) = 1-p and p(1) = p.
► We can think of X as representing the result of some experiment,
► with X=1 being ‘success,’ with probability p.
► The expected value of a Bernoulli random variable is p and variance is p(1-p).
Bernoulli Distribution

► Simpler words, a Bernoulli random variable is the simplest kind of random variable. It can take on two
values, 1 and 0. It takes on a 1 if an experiment with probability p resulted in success and a 0 otherwise.

► Let us denote the outcome of ith trial as 0 (failure) or1 (success)


► Let X be a Bernoulli random variable with:
► P(X =1) =p
► P(X =1) =1- p
► Then the probability mass function (PMF) of X is given by
Bernoulli Distribution

► Parameter of the Bernoulli distribution

Probability mass function of the


Bernoulli distribution
Example: Bernoulli Distribution

► We introduce the idea of Bernoulli distribution of a random variable at this point by


looking at a single transmission and we note that the outcome of a single transmission (the
random variable X) is either a success or a failure.
► The probability that a transmission fails is p
► Depend on various factor

• Good model for a binary data source whose output is 1 or 0.


• In telecommunications, this distribution can be a model for the loss phenomena
• due to punctual transmission channel noise.
Example: Bernoulli Distribution

► Some example uses include:


► A coin flip
► A random binary digit
► whether a disk drive crashed
► Whether someone likes a Netflix movie
Binomial Distribution

► Consider a series of n Bernoulli experiments where the result of each experiment is independent of the others.
► We would naturally like to know the number of successes in these n trials.
► This can be represented by a discrete random variable X with parameters (n, p)and is called a binomial
random variable.
► The probability mass function of a binomial random variable with parameters (n, p) is given by:

► If we set q = 1-p, then these are just the terms of the expansion (p + q)n
► The binomial distribution has various applications
Binomial Distribution

► Parameter of the Binomial distribution


Example: Binomial Distribution

► Consider a local area network with 10 stations. Assume that, at a given moment, each node can be active
with probability p= 0.1.
► What is the probability that:
1. one station is active p(1)
2. five stations are active p(5)
3. all 10 stations are active? p(10)

► Solution:
► Assuming that the stations are independent, the number of active stations can be modelled by a binomial distribution
with parameters (10, 0.1).
Example: Binomial Distribution

► Solution:
► Assuming that the stations are independent, the number of active stations can be modelled by a binomial
distribution with parameters (10, 0.1).
► Using below formula:

► p(1) = 0.38
► p(5) = 1.49*103
► p(10) = 1*10-10
Example: Binomial Distribution

► Some other example of binomial distribution:


► A dice is tossed four times. A “success” is defined as rolling a 1 or a 6. The probability of success is 1/3.
► What is P(X = 2)?
► What is P(X = 3)?
Example: Binomial Distribution

► Consider a phenomenon, say, the current packet being sent to a target networking interface if0.
► Assume that the packets are independent and come from the same background.
► For a sequence of n packets, the decision “route the current packet to if0” can be modeled by B(p) and the number
of packets which are actually routed to if0 can be modeled by B(n, p), the binomial distribution with parameters (n,
p).
Geometric Distribution

► The geometric distribution is related to Bernoulli trials. A geometric random variable


represents the number of Bernoulli trials required to achieve the first success.
► Consider a sequence of independent Bernoulli experiments, as before, each of which
succeeds with probability p.
► Unlike earlier, where we wanted to count the number of successes, we want to compute the
probability mass function of a random variable X that represents the number of trials before
the first success.
► Such a variable is called a geometric random variable and has a probability mass function:

► The expected value of a geometrically distributed variable with parameter p is 1/p.


Geometric Distribution

► The mean and variance of the geometric distribution are:

• The geometric distribution is somehow related to binomial distribution.


• They are both based on independent Bernoulli trials with equal probability of success p.
• Geometric random variable is the number of trials required to achieve the first success, whereas a binomial
random variable is the number of successes in n trials.
Example: Geometric Distribution

► Consider a link that has a loss probability of 10% and that packet losses are independent (although this is
rarely true in practice). Suppose that when a packet gets lost this is detected and the packet is
retransmitted until it is correctly received.
► What is the probability that it would be transmitted exactly one, two, and three times?

Solution:
Assuming that the packet transmissions are independent events,
we note that the probability of success = p = 0.9.
Therefore, p(1) = 0.10* 0.9 = 0.9; p(2) = 0.11* 0.9 = 0.09; p(3) = 0.12* 0.9 = 0.009. Note the rapid decrease in the
probability of more than two transmissions, even with a fairly high packet loss rate of 10%. Indeed, the expected number of
transmissions is only 1/0.9.
Example: Geometric Distribution

► The geometric distribution also has many applications.


► It can be used to model the number of re-transmissions of a packet within a connection-oriented communication
(every packet must be successfully received) through a transmission channel with loss.?
Poisson Distribution

► The Poisson distribution is widely encountered in networking situations, usually to model the arrival of
packets or new end-to-end connections to a switch or router.
► A discrete random variable X with the domain {0, 1, 2, 3,...} is said to be a Poisson random variable with
parameter λ if, for some λ >0:

► The Poisson distribution (which has only a single parameter λ) can be used to model a binomial distribution
with two parameters (n and p) when n is ‘large’ and p is ‘small.’
► In this case, the Poisson variable’s parameter λ corresponds to the product of the two binomial parameters (i.e. λ =
nBinomial* pBinomial).
► The Poisson distribution,arises when the number of such independent trials is large, and the probability of success
of each trial is small.
► The expected value of a Poisson distributed random variable with parameter λ is also λ.
Poisson Distribution

► Poisson distribution is commonly used in engineering to model problems such as:


► Queueing (birth-and-death process or waiting on line),
► Radioactive experiments, the telephone calls received at an office,
► The emission of electrons from a cathode,
► Natural hazards (earthquakes, hurricanes, or tornados).
Example: Poisson Distribution

► Consider an endpoint sending a packet on a link. We can model the transmission of a packet by the
endpoint in a given time interval as a trial as follows:
► if the source sends a packet in a particular interval,
► we will call the trial a success

► If the source does not send a packet,


► we will call the trial a failure.

► When the load generated by each source is light, the probability of success of a trial defined in this manner, which
is just the packet transmission probability, is small.
► Therefore, as the number of endpoints grows, and if we can assume the endpoints to be independent, the sum of their loads
will be well-modelled by a Poisson random variable.
Example: Poisson Distribution

► Consider a link that can receive traffic from one of 1000 independent endpoints. Suppose that each node
transmits at a uniform rate of 0.001 packets/second.
► What is the probability that we see at least one packet on the link during an arbitrary one second interval?
Solution:
Given that each node transmits packets at the rate of 0.001 packets/second, the probability that a node transmits a packet in any one-second interval is p Binomial =
0.001.

Thus, the Poisson parameter λ = 1000*0.001 = 1. The probability that we see at least one packet on the link during any one-second interval is therefore using
below formula:

Using above formula, there is a 64% chance that, during an


arbitrary one-second interval, we will see one or more packets
on the link.
Example: Poisson Distribution

► Some other examples:


► No: of vehicles arriving at a parking lot in one week
► No: of gamma rays hitting a satellite per hour
► No: of cookies sold at a bake sale in 1 hour
Continuous Probability Models

► Standard continuous distributions


► Uniform distribution
► Gaussian or Normal distribution
► Exponential distribution
► Power Law distribution
Uniform distribution

► This distribution, also known as rectangular distribution


► It is very important for performing pseudo random number generation used in simulation
► It is also useful for describing quantizing noise that is generated in pulse-code modulation(PHY).
► It is a distribution in which the density is constant.
► It models random events in which every value between a minimum and maximum value is equally likely.
Uniform distribution

► A random variable X is said to be uniformly randomly distributed in the domain [a,b] if its density function
f(x) = 1/(b-a)
► when x lies in [a,b] and is 0 otherwise.
► The expected value of a uniform random variable with parameters a,b is (a+b)/2.
► A random variable X has a uniform distribution if its PDF is given by:
Uniform distribution

► The mean and variance are given by:

► Also, if Y = Asin X, where X is a uniformly distributed random variable,


► the distribution of Y is said to be sinusoidal distribution.
► A special uniform distribution for which a = 0, b = 1, called the standard uniform distribution
► It is very useful in generating random samples from any probability distribution function.
Uniform distribution

► PDF for a uniform random variable


Gaussian or Normal distribution

► This distribution, also known as normal distribution


► It is the most important probability distribution in engineering.
► It is used to describe phenomena with symmetric variations above and below the mean μ.
► A random variable X with Gaussian distribution has its PDF of the form:
Gaussian or Normal distribution

► Mean and variance parameter:

Gaussian distributions for different values of the mean and


variance. PDF for an Gaussian random variable
Exponential distribution

► The exponential distribution is the continuous analogue of the geometric distribution.


► The geometric distribution measures the number of trials until the first success.
► The exponential distribution arises when we are trying to measure the duration of time before some event happens
(i.e. achieves success).
► It is used to model the time between two consecutive packet arrivals on a link.
► It is frequently used in simulation of queueing systems
► To describe the inter-arrival or inter-departure times of customers at a server.
► An important property of the exponential distribution is that, like the geometric distribution, it is memoryless and, in
fact, it is the only memoryless continuous distribution.
► Intuitively, this means that the expected remaining time until the occurrence of an event with an exponentially distributed
waiting time is independent of the time at which the observation is made.
Exponential distribution

► A random variable X is exponentially distributed with parameter λ


► where λ>0 if its density function

► The mean and the variance of X are is given by:


Example: Exponential distribution

► Suppose that a switch has two parallel links to another switch and packets can be
routed on either link. Consider a packet A that arrives when both links are already in
service. Therefore, the packet will be sent on the first link that becomes free. Suppose
this is link 1. Now, assuming that link service times are exponentially distributed,
which packet is likely to finish transmission first: packet A on link 1 or the packet
continuing service on link 2?
Power law distribution

► A random variable described by its minimum value xmin and a scale parameter α>1 is
said to obey the power law distribution if its density function is given by:

► A widely-studied example of power-law distribution is the random variable that


describes the number of users who visit one of a collection of websites on the Internet on
any given day.
► Traces of website accesses almost always show that all but a microscopic fraction of
websites get fewer than one visitor a day: traffic is mostly garnered by a handful of
well-known websites.
References

❑ Chen, Ken. Performance evaluation by simulation and analysis with applications to


computer networks. John Wiley & Sons, 2015. part-3
❑ Sadiku, M. N., & Musa, S. M. (2013). Performance analysis of computer networks (Vol.
1). Cham, Switzerland: Springer. Chapter- 2
❑ Obaidat, Mohammed S., and Noureddine A. Boudriga. Fundamentals of performance
evaluation of computer and telecommunication systems. John Wiley & Sons, 2010.
Chapter- 2
❑ Some part of the lecture is mixture of multiple articles

You might also like