You are on page 1of 21

# DISTRIBUTIONS/

RANDOM VARIABLES

Random Variables

36

## different numerical values with certain probabilities.

The probability models describe the random variables.
EXAMPLES

## Number of car crashes in Ahmedabad tomorrow

Amount of rainfall in India next month
Salary offered to a PGPX passout

Random Variables

37

## different numerical values with certain probabilities.

The probability models describe the random variables.
EXAMPLES

## Number of car crashes in Ahmedabad tomorrow

Amount of rainfall in India next month
Salary offered to a PGPX passout

38

## Takes finitely/countably many values: typically integers

All examples that we are going to look at in this class are

numbers of something:
Number of earthquakes in Japan in one year
Number of errors in each page of a text book
Number of heads in 1000 coin tosses

39

Formal Description
Value (x)

Probability (p(x))

p(2)

Total

p(1)

## The probability function above is called probability mass function (p.m.f.)

Values can, of course, be any other set of integers.

Distribution function

40

## looks like a step, and hence is called a step function.

Example
p(1) = 0.1, p(2) = 0.2 and p(5) = 0.7.
What is the distribution function?

41

Expectation

## random variable X taking values x1, x2, , xn with

probabilities p(x1), p(x2), , p(xn) is given by the
weighted average

E(X) xip(xi ).
n

i 1

Examples

42

## time I go to the store with probabilities 0.4 and 0.4,

respectively. The packets cost Rs.10 each. However,
sometimes, (with 0.2 probability,) there is a sale when
the packets are sold at Rs.8 per pack, when I buy 10
packs. What is my expected cost?

43

## 1. If X is a random variable, and a and b are two constants,

then
E(aX) = aE(X), E(b+X) = b+E(X).
E.g. If \$1 = Rs. a, then if expected salary of a PGPX passout
in US\$ is \$E(X), in Rs. it is Rs.aE(X). Then again, if everyone
is paid a joining bonus \$b, salary is \$(b+aE(X)).
2. If X and Y are two random variables, then
E(X+Y) = E(X) + E(Y).
E.g. Expected sum of salary of two friends is sum of their
expectations.

44

Variance

## The variance of a random variable measures its spread.

For a discrete random variable X, variance is given by

## the weighted average of the squared deviations from

the expectation
V(X) (xi - E(X)) p(xi ) xi2p(xi ) E(X)2
n

i1

i 1

45

## 1. If X is a random variable, and a and b are two constants,

then
V(aX) = a2V(X), V(b+X) = V(X).
2. If X and Y are two independent random variables, then
V(X+Y) = V(X) + V(Y).
Otherwise there will be a cross-term. Lets not bother about
that.

46

## possible outcomes, how do I obtain the probability

distribution of number of occurrences of what I want?

Examples:
Probability distribution of the number of double heads in
24 throws of two fair dice.
Probability distribution of number of children out of 100
randomly chosen kids of age 10 who have dropped out of
school.

47

## outcomes, say success and failure, with fixed

probabilities.
We get to define success!
A binomial random variable is the number of successes
(or failures) in a fixed number of independent Bernoulli
trials.

48

Binomial(n,p)

## n independent trials with probability of success p

X = number of success

n x
n x
P(X=x) = p (1 p) , x = 0, 1, 2, ..., n
x
E(X) = np

Var(X) = np(1-p)

p.m.f.

EXCEL: BINOMDIST(x,n,p,TRUE/FALSE)
c.d.f.

Example

49

Example

50

## one shot, and that there is no improvement in performance

over trials.
What is the probability distribution of the number of hits to the
yellow part in 10 trials?
What is the probability that yellow is not hit in any of the 10
attempts? What is the probability that at least 3 hits were
successful?

X+Y~Bin(n+m, p).

## of hits has distribution Bin(10,

0.1).
Try 5 more times. Number of
hits now has distribution Bin(15,
0.1).
Note: p has to be the same,
and independence is needed.

51

Poisson Distribution
Used to model rare events

52

## X = number of events: rate

e
P(X=x) =

x
x!

x = 0, 1, 2, ...

E(X) = , Var(X) =
EXCEL: POISSON(x,,TRUE/FALSE)

Example

53

## error in a page is 0.0001, independently of the other pages.

What is the probability that there are at least two errors in the
first 50 pages of the book? Assume a Poisson distribution.

54

## If X~Poisson(1) and Y~Poisson(2) are independent, then

X+Y~Poisson(1+2).

Example

55