Random Variables: Prof. Megha Sharma

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 35

Random Variables

Prof. Megha Sharma


DISCRETE RANDOM
VARIABLES
Random Variables
• Random Variables: Quantities whose values
are determined by the outcome of the
experiment.

• Discrete Random Variable: A random


variable that takes finite number of different
values
Random Variables: Example
Example: Three coins are tossed, suppose people are placing
bets on the number of heads obtained in these three tosses.

Then we are not so interested in the outcome of the tosses as such


but are interested in the number of heads that appear in these
tosses, which is a random variable.

Let X denote the number of heads in three tosses, then X can take
values 0, 1, 2, 3, and

P(X = 0) = P{(T,T,T)} = 1/8


P(X = 1) = P{(H, T, T), (T,H,T), (T,T,H)} = 3/8
P(X= 2) = P{(H, H, T), (H,T,H), (T,H,H)} = 3/8
P(X = 3) = P{(H,H,H)} = 1/8
Random Variable: Probability Distribution
• The collection of all possible values of the
random variable, X, and their probabilities is
called the Probability Distribution of X.
• Note that all these probabilities add up to 1.
• In our previous example of three coins tosses,
Value of the Probability
Random Variable X
0 1/8
1 3/8
2 3/8
3 1/8
Probability Distribution: Example
A saleswoman has scheduled two appointments
to sell encyclopedias. She feels that her first
appointment will lead to a sale with probability
0.3. She also feels that the second will lead to a
sale with probability 0.6 and that results from
the two appointments are independent. What is
the probability distribution of X, the number of
sales made?
Probability Distribution: Example
P(X =0) = P{no sale on first, no sale on second}
= P{no sale on first}*P{no sale on second}
= (1 - 0.3) * (1- 0.6) = 0.28

P(X=1) = P{no sale on first, sale on second} +


P{sale on first, no sale on second}
= (1-0.3) * 0.6 + 0.3 * (1-0.6) = 0.54

P(X=2) = P{sale on first, sale on second}


= 0.3*0.6 = 0.18
Expected Value
If X is a discrete random variable that takes on
one of the possible values x1, x2, …, xn, then the
expected value of X, denoted by E[X], is defined
by
n
E[ X ]   xi P[ X  xi ]
i 1

The expected value of X is a weighted average of


the possible values of X, with each value
weighted by the probability that X assumes it.

Also called the mean or expectation of X.


Expected Value
• Suppose X is equally likely to be 0 or 1, then
E[X] = ??
E[X] = 0*0.5+ 1*0.5 = 0.5

Note that X does not take the value 0.5!!

E[X] should be interpreted not as the value that we


expect X to have, but rather as the average value of
X in a large number of repetitions of the
experiment.
Expected Value: Example
Consider a random variable X that takes on
either the value 1 or 0 with respective
probabilities p and (1 – p). Find E[X].
E[X] = p

Bernoulli Random Variable!


Expected Value: Example
An insurance company sets its annual premium
on its life insurance policies so that it makes an
expected profit of 1% of the amount it would
have to pay out upon death. Find the annual
premium on a $200,000 life insurance policy
for an individual who will die during the year
with probability 0.02.
Expected Value: Example
Let A denote the annual premium, the profit of
the company will be
= A if the policyholder lives
= A – 200000, if the policyholder dies
So the expected profit,
E[Profit] = A * (1-0.02) + (A – 200000) * 0.02
But Expected profit = 0.01* 200000 = 2000
So, 2000 = A * (1-0.02) + (A – 200000) * 0.02
Therefore, A = $6000

Note E[X] has the same units as X!


Properties of Expected Values
• If X is a random variable with expected value
E[X]. If c is a constant, then
– E[cX] = cE[X]
– E[X+c] = E[X] + c
• Example: A married couple works for the same
employer. The wife’s Christmas bonus is a
random variable whose expected value is $1500.
– If the husband’s bonus is set to equal 80% of his
wife’s bonus, find the expected value of the husband’s
bonus. = 0.8 * 1500 = 1200
– If the husband’s bonus is set to equal $1000 more
than that of his wife, find the expected value of the
husband’s bonus. = 1500 + 1000 = 2500
Properties of Expected Values
• E[X+Y] = E[X] + E[Y]
• Example: The following are the annual incomes (in ‘000)
of 7 men and 7 women residents of a certain community:
Men Women
33.5 24.2
25.0 19.5
28.6 27.4
41.0 28.6
30.5 32.2
29.6 22.4
32.8 21.6

Suppose that a man and a woman are randomly chosen,


what is the expected value of the sum of their incomes?
Properties of Expected Values
• E[X] = (33.5 + 25 + 28.6 + 41 + 30.5 + 29.6 +
32.8)/7 = 221/7 = 31.571
• E[Y] = (24.2 + 19.5 + 27.4 + 28.6 + 32.2 +
22.4+ 21.6)/7 = 25.129
• E[X+Y] = E[X] + E[Y] = 56.700
Variance of Random Variables
• Consider three random variables U, V, W
defined as follows:
– U = 0 with probability 1

– V = -1 with probability 0.5


1 with probability 0.5

– W = -10 with probability 0.5


10 with probability 0.5

Note that E[U] = E[V] = E[W] = 0.


Therefore, we also need a measure of variability!
Variance
• If X is a random variable with expected value μ,
then the variance of X, denoted by Var(X), is
defined by
Var(X) = E[(X- μ)2]
= E[X2] – μ2

• Example: Let X be a random variable such that X =


1 with probability p and X = 0 with probability (1-
p). What is the variance of X?
Var(X) = E[X2] – μ2
E[X2] = 12 * P{X = 1} + 02 * P{X = 0} = p
μ2 = p2
Var (X) = p – p2 = p (1-p)
Properties of Variance
• Var(cX) = c2Var(X)
• Var(X + c) = Var (X)
• In general, Var(X + Y) ≠ Var (X) + Var (Y)

• Independent random variables:


Random variables X and Y are independent if knowing the
value of one of them does not change the probability of the
other

• If X and Y are independent random variables, then


Var (X+Y) = Var (X) + Var (Y)
• We can extend it to n independent random variables
as well!
Variance: Example
Determine the variance of the sum obtained
when a pair of fair dice is rolled.
–X be the value of the first die
–Y be the value of the second die
–Since X and Y are independent,
Var(X+Y) = Var(X) + Var(Y)

Var(X) = E[X2] – (E[X])2


= 91/6 – (7/2)2 = 35/12

Var(X+Y) = Var(X) + Var(Y) = 35/12 + 35/12 = 35/6


Standard Deviation
The standard deviation of a random variable X,
SD(X) = √Var(X)

Example: The annual gross earnings of a rock


singer are a random variable with an expected
value of $400,000 and a standard deviation of
$80,000. The singer’s manager received 15% of
this amount. Determine the expected value and
std. dev. of the amount received by the manager.
E[0.15X] = 0.15* E[X] = 0.15 * 400000 = 60000
SD(0.15X) = 0.15*SD(X) = 0.15 * 80000 = 12000
Binomial Random Variable
Suppose n independent subexperiments (or
trials) are performed, each of which results in
either a “success” with probability p or a
“failure” with probability (1-p).

If X is the total number of successes that occur


in n trials, then X is said to be a binomial
random variable with parameters n and p.

X can take values 0, 1, 2, …, n.


Binomial Random Variable
• Probability distribution of X
P{X = i} = nCi pi (1-p)(n-i)

• Example: Three fair coins are flipped. If the


outcomes are independent, determine the
probability that there are a total of i heads,
for i = 0, 1, 2, 3.
P{X = 0} = 3C0 0.50 (0.5)(3) = 0.125
P{X = 1} = 3C1 0.51 (0.5)(2) = 0.375
P{X = 2} = 3C2 0.52 (0.5)(1) = 0.375
P{X = 3} = 3C3 0.53 (0.5)(0) = 0.125
Properties of Binomial RV
• E[X] = np
• Var(X) = np(1-p)

• Example: Suppose that each screw produced


is independently defective with probability
0.01. Find the expected value and variance of
the number of defective screws in a shipment
of size 1000.
E[number of defectives] = 1000* 0.01 = 10
Var(number of defectives) = 1000* 0.01*0.99 = 9.9
CONTINUOUS RANDOM
VARIABLE
Continuous Random Variable
• Random variables that can take on any value in an
interval
– Example: time it takes to complete a job
– They take infinite possible values

• Probability Density Function (pdf)


– Denoted by f(x) such that f(x) ≥ 0
– Area between the graph of y = f(x) and the x-axis = 1
– P(a ≤ X ≤ b) = Area under the graph y = f(x) , x – axis, and x=a,
x=b

• P(a ≤ X ≤ b) = P(a < X < b)

• P(X = a) = 0 for any particular value “a”


Uniform Random Variable
A continuous random variable is said to be a
continuous uniform random variable in the
interval (a, b) if its set of possible values is this
interval and if its density curve is horizontal
line as shown in the figure below.

a b
Uniform Random Variable
• Determine the height of the density curve?
– Area = (b – a) * height = 1
– Height = 1/(b – a)

• What is P{X ≤ (a + b)/2}?


– P{X ≤ (a + b)/2} = area bounded by the pdf, the x
– axis, the line x = (a + b)/2, = ((a+b)/2 – a) *
1/(b – a)
= 1/2
Continuous RV
• Exponential Random Variables

• Log-normal Random Variables

• Etc.
Normal Random Variable
The probability density function of a normal random
variable X is determined by two parameters:
– expected value (μ)
– Standard deviation (σ)
1  ( x   ) 2 / 2 2
f ( x)  e
 (2 ) 1/ 2

• Bell shaped density curve, symmetric about the


expected value (μ)
– So P{X < μ} = P{X > μ} = 1/2

• The larger the value of σ, the flatter the pdf curve is.
Normal Random Variable
f(x)

0.34 0.34

0.135 0.135

0.024 0.024
x
μ - 3σ μ - 2σ μ - σ μ μ + σ μ + 2σ μ + 3σ

Some observations about a Normal random variable:


•Area between (μ – σ) and (μ + σ)  0.68
•Area between (μ – 2σ) and (μ + 2σ)  0.95
•Area between (μ – 3σ) and (μ + 3σ)  0.997
These observations allow us to get a quick feel about a data set.
N(μ,σ): An Example
Test scores on SAT verbal portion are normally
distributed with a mean score of 504. If the
standard deviation of scores is 84, then
–68% of the scores are between ….
(504 – 84 = 420) and (504 + 84 = 588)

–95% of the scores are between ….


(504 – 2 *84 = 336) and (504 + 2 *84 = 672)

–99.7% of the scores are between….


(504 – 3 *84 = 252) and (504 + 3 *84 = 756)
Computing the Probability
Given a probability density function f(x) of a
random variable bX, the probability P(a ≤ X ≤ b)
  f ( x )dx
a

Since computing P(a ≤ X ≤ b) for a normal


random variable is not straight forward, these
values are computed using Standard Normal
Variable and its probability table.
Standard Normal Variable
• Usually denoted by Z

• Z ~ N(0, 1), i.e. Z is a normally distributed


random variable with mean 0 and standard
deviation 1.
f(z)

-3 -2 0 1 2 3
-1
z
Standard Normal Probabilities

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy