Lecture 4
Lecture 4
Lecture 4
► 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
► 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
3. FX(x) is a probability
► 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.
► 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
► 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
► 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
► 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 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
► 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
► 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:
► 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
► 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: