You are on page 1of 30

Vishal Mishra (IBS, Hyderabad)

Random Variables : Basics

Experiment (a process that results in well defined outcomes)


Trial
Outcome
Sample Space
Event
Vishal Mishra (IBS, Hyderabad)

Random Variables
Definition: A random variables is used to numerically describe the outcomes of an experiment.
Experiment, Outcomes, Random Variable

Types of random variables:


Discrete: Finite number of values OR an infinite sequence of values (countably infinite)
Example: Tossing a coin 3 times (Number of heads), Inspecting the traffic at a
ticket/sales counter (number of customers arriving in peak hour)

Continuous: Any possible numerical value


Example: Inspecting the traffic at a ticket/sales counter (Time between
arrivals), Customer servicing (Time for complaint resolution), Manufacturing
of a bulb (QC)
Vishal Mishra (IBS, Hyderabad)

Random Variables

Experiment Random variable

Attending classes No. of classes attended


Playing matches in a tournament No. of wins
Participating in 100 m sprints Time taken to complete a race
Operations of a company Number of employees present
Operations of a company Productivity of employees (different measures)
Vishal Mishra (IBS, Hyderabad)

Probability Concepts
Definition: Numerical measure of the chance of occurrence of an
event.

Three approaches to Probability:


• Classical
• Relative Frequency
• Subjective

Key Characteristics of Probability:


0<= P(Ei) <= 1 where Ei is Event i
∑ P(Ei) = 1 for all i
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
An arrangement/description that depicts/describes the values of a random
variables along with the probabilities associated with those values.

Discrete Probability Distribution (discrete random variable)

Continuous Probability Distribution (continuous random variable)

The characteristics of probability apply for probability distribution of a random


variable too. So, for a discrete probability distribution, if Xi denotes ith value of
the random variable X and f(Xi) denotes the probability of a specific value i.e. ith
value, then

0< = f(Xi) <= 1 and


∑ f(Xi) = 1
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Example:

Frequency & Relative Frequency Distribution

S. No. Colour Type Frequency Relative Frequency

1 Blue 10 0.3333

2 Red 14 0.4667

3 Green 6 0.2
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Example:

Relative Frequency Distribution S. No. Colour Type Relative Frequency

1 10 0.3333

2 20 0.4667

3 30 0.2

S. No. Colour Type Probability


Probability Distribution 1 10 0.3333
(Discrete/Continuous?)
2 20 0.4667
(Properties?)
3 30 0.2
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Example:
Class Intervals (Marks) Frequency Relative Frequency

Frequency/Relative Frequency Distribution 10 to 18 5 0.166666667


18 to 26 5 0.166666667
26 to 34 10 0.333333333
34 to 42 7 0.233333333
42 to 50 3 0.1

Class Intervals (Marks) Probability


10 to 18 0.166666667
Probability Distribution 18 to 26 0.166666667
(Discrete/Continuous?) 26 to 34 0.333333333
(Properties?) 34 to 42 0.233333333
42 to 50 0.1
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Example: An urban survey of 1000 households of a metropolitan city for studying the number
of motor vehicles owned by a household Number of Vehicles Probability
0 0.15
(Discrete/Continuous?) 1 0.3
(Properties?) 2 0.25
3 0.2
4 0.1
Example: A study (of 50 workers ) to assess time taken for assembling a desktop computer in a
factory.
Time Taken (hour) Probability
<1 0.25
(Discrete/Continuous?) 1-2 0.45
(Properties?) 2-3 0.25
>3 0.05
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Uniform Distribution

Binomial Distribution

Poisson Distribution
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Uniform Distribution: When an experiment result in outcomes that are finite and are equally
likely.

e.g. Toss of a fair coin (Outcome: Head/Tail), Throw of a fair dice (Outcome: face with one of
the value out of 1, 2, 3, 4, 5, 6).

Probability function is f(X) = 1/n ; where n is the number of possible outcomes i.e.
the number of values, a random variable can take
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Uniform Distribution:

Probability function is f(X) = 1/n ; where n is the number of possible outcomes i.e.
the number of values, a random variable can take
X f(X)
Example: Number on the face of a fair dice 1 1/6
2 1/6
3 1/6
4 1/6
5 1/6
6 1/6
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Two key characteristics (parameters that describe a distribution)

Expected Value (Mean): E(X) = µ = ∑ [ Xi * f(Xi) ]

Variance: Var (X) = E(X - µ)2 = σ 2 = ∑ [ (Xi - µ) 2 * f(Xi) ]

Exercise: Calculate these values for the example of throw of a dice


Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Expected Value (Mean): E(X) = µ = ∑ Xi * f(Xi)

X f(X) X * f(X) (X-Mean)2 (X-Mean)2 * f(X)


Variance: Var (X) = ∑ (Xi - µ) 2 * f(Xi)
1 1/6 0.166667 6.25 1.041666667
2 1/6 0.333333 2.25 0.375
Exercise: Calculate these values for the 3 1/6 0.5 0.25 0.041666667
example of a throw of a dice 4 1/6 0.666667 0.25 0.041666667
5 1/6 0.833333 2.25 0.375
6 1/6 1 6.25 1.041666667

Mean 3.5 Variance 2.9167


Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution: Associated with an experiment consisting of a sequence of


identical and independent trials that result in two outcomes (for each trial) labelled as success
and failure such that the probability of success and failure is constant from one trial to the
other.
Example: 4 tosses of a fair coin

If n= number of trials; p = probability of success on each trial (probability of failure = 1-p);


x = number of successes in n trials

Then probability of x successes in n trials is given by Probability function,

𝑛!
f(x) = * px * (1-p) (n-x) ;
𝑥! 𝑛−𝑥 !

(Note: 1! = 0! =1) Where (n factorial OR factorial n), n! = n*(n-1)*(n-2)*(n-3)…


Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution: E.g. we want to find the probability of 1 head in 4


tosses of a fair coin

Here n= 4; p = ½ = 0.5; x = 1

Then probability of x successes in n trials is given by Probability function,

4!
f(1) = * (0.5)1 * (0.5) (4-1) ;
1! 4−1 !

= 4 * 0.5 * 0.125
= 0.25
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:
Binomial Probability Distribution: E.g. we want to find the probability of 1 head in 4 tosses of a
fair coin

Tree Diagram

Total no. of
outcomes
= 16

Outcomes with
Only 1 head
=4

Probability = 4/16 = 0.25


Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution:

Expected Value (Mean) : E(X) = µ = n * p

Variance: Var (X) = E(X - µ)2 = σ 2= n* p * (1-p)

For the earlier example, mean (no. of heads in 4 tosses) = 4 * 0.5 = 2


variance (no. of heads in 4 tosses ) = 4 * 0.5 *0.5 = 1
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution: E.g. Experiment is Four tosses of a fair coin, Outcome
of interest is Head

Using the original formulas for mean (E.V) and variance of a distribution

Expected Value: E(X) = µ = ∑ Xi * f(Xi)

Variance: Var (X) = E(X - µ)2 = σ 2 = ∑ (Xi - µ) 2 * f(Xi)


Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution:


x (no. of heads) Probability, f(x)

Expected Value: E(X) = µ = ∑ Xi * f(Xi) 0 0.0625

1 0.25
Variance: Var (X) = E(X - µ)2 = σ 2 = ∑ (Xi - µ) 2 * f(Xi)
2 0.375

3 0.25

4 0.0625
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution:


x (no. of heads) Probability, f(x)
f(x) (Probability)
0.4
0 0.0625
0.35

0.3
1 0.25
0.25

0.2 2 0.375
0.15

0.1 3 0.25
0.05

0
4 0.0625
0 1 2 3 4
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution:

Practice Problem: In a throw of a fair dice, one is interested in the outcome of an even
number. What is the probability that in 10 throws we will get an even number i) 2 times ii) 8
times iii) at least 3 times? What is the probability that we will get an odd number i) 2 times ii)
less than 2 times?
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Binomial Probability Distribution:


Practice Problem: In a throw of a fair dice, one is interested in the outcome of an even
number. What is the probability that in 10 throws we will get an even number i) 2 times ii) 8
times iii) at least 3 times? What is the probability that we will get an odd number i) 2 times ii)
less than 2 times?
Solution: p=0.5(for even number), n=10
f(x=2) = 0.044
f(x>=3) = f(x=3) + f(x=4) +…+ f(x=10) = 1 – [f(x=0)+f(x=1)+f(x=2)] = 1-0.0547 = 0.9453
(Since, f(x=0)+f(x=1)+f(x=2)+….+f(x=9)+f(x=10) = 1)
P=0.5 (for odd number), n=10
f(x=2) = 0.044
f(x<2) = [f(x=0)+f(x=1)] = 0.0107
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Poisson Probability Distribution: Associated with an experiment where one is interested in


number of occurrences in an interval (of time and space) such that the probability of an
occurrence is same for the intervals of same length, occurrence/non-occurrence in any interval
is independent of the occurrence/non-occurrence in another interval.

Example: no. of cars passing through a signal in a given hour; no. of telephone calls in a given
duration at a call centre

If µ = mean number of occurrences (observed from the past data) and x = number of
occurrences in an interval
Then probability of x occurrences

f(x) = (e-µ * µx) / x! ; where e (a mathematical constant)


= 2.71828
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Poisson Probability Distribution: E.g. Consider visitors on a web-site during sale hours. if
past data indicates that the mean number of such visitors in a given minute is 7, what is the
probability of 10 visitors landing on the web-site during a minute during sale hours? (Assume
that such visits follow a Poisson distribution)

Here µ = 7, x = 10
Then Poisson probability of 10 visitors
f(10) = (e-7 * 710) / 10!
= 0.071
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:
Poisson Probability Distribution: E.g. Consider visitors on a web-site during sale hours. if
past data indicates that the number of such visitors in a given minute is 7, what is the
probability of 10 visitors landing on the web-site during a minute during sale hours? (Assume
that such visits follow a Poisson distribution)
f(x) (Probability)
0.16

0.14

0.12

0.1

0.08

0.06

0.04

0.02

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 25 25
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:
Poisson Probability Distribution: Mean and Variance are same:

Expected Value (Mean) : E(X) = µ = Variance, Var (X)

Exercise: Past data shows that phone calls arrive at a call centre at the rate of 36 per hour. Find out

- The probability of receiving 45 calls per hour


- The probability of receiving 4 calls in a five minute interval
- The probability of receiving at least 4 calls in a five minute interval
- The probability of receiving at most 3 calls in a five minute interval
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Exercise: Past data shows that phone calls arrive at a call centre at the rate of 36 per hour. Find out

- The probability of receiving 45 calls per hour (mean = 36) : f(X=45) = 0.021
- The probability of receiving 4 calls in a five minute interval (mean = 3) : f(X=4) = 0.168
(36 per hour = 36 in 60 minutes. In 60 minutes there are 36 calls, thus, using unitary method no. of calls
in 5 minutes = (36*5)/60 = 3)
- The probability of receiving at least 4 calls in a five minute interval (mean = 3) : f(X>= 4) = 0.3528
(Since, f(x=0)+f(x=1)+f(x=2)+f(x=3)+f(x=4) + ……..+ = 1)

- The probability of receiving at most 3 calls in a five minute interval (mean = 3) : f(X<=3) = 0.6472
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Practice Problem: Past data indicates that the mean number of vehicles passing through a
signal during a minute is 5. If the occurrence of the vehicles follows Poisson distribution then
what is the probability that 10 vehicles will pass in a given minute through that signal.
Vishal Mishra (IBS, Hyderabad)

Probability Distributions
Discrete Probability Distributions:

Practice Problem: Past data indicates that the mean number of vehicles passing through a
signal during a minute is 5. If the occurrence of the vehicles follows Poisson distribution then
what is the probability that 10 vehicles will pass in a given minute through that signal.

Solution: µ = 5, x = 10
f(x = 10) = (e-5 * 510) / 10! = .0181

You might also like