random variables
DESCRIPTION
Random Variables. Intro to discrete random variables. Random Variables. “A random variable is a numerical valued function defined over a sample space” What does this mean in English? If Y rv then Y takes on more than 1 numerical value Sample space is set of possible values of Y - PowerPoint PPT PresentationTRANSCRIPT
statistical processes 1
Random Variables
Intro to discrete random variables
statistical processes 2
Random Variables
“A random variable is a numerical valued function defined over a sample space”
What does this mean in English?
If Y rv then Y takes on more than 1 numerical value
Sample space is set of possible values of Y
What are examples of random variables?
Let Y face showing on die ={1,2, …, 6}
statistical processes 3
VariablesA Simple Taxonomy
Variables
Random Variables Deterministic variables
Discrete random variables
Continuousrandom variables
Variables arebut models
Variables arebut models
statistical processes 4
Random VariablesA Simple Example
Variables model physical processes
Let S sales; C costs; P profit
P = S - C
Suppose all variables deterministic S = 25 and C = 15, P = 10
Suppose S is a rv = {25, 30} What is P?
RVs may be used just as deterministic variables
How shall we describe the behavior of a rv?
statistical processes 5
Developing RV Standard ModelsDistribution Functions
Distribution functions assign probability to every real numbered value of a rv
Probability Mass Function (PMF) assigns probability to each value of a discrete rv
Probability Density Function (PDF) is a math function that describes distribution for a continuous rv
Standard models convenient for describing physical processes
Example of PMF: Let T project duration (a rv)t1 = 4 weeks; p(T = t1) = p(t1) = 0.2
t2 = 5 weeks; p(T = t2) = p(t2) = 0.3
t3 = 6 weeks; p(T = t3) = p(t3) = 0.5
Note conventions!
Note conventions!
statistical processes 6
Characteristic Measures for PMFsCentral Tendency
Central tendency of a pmf
Mean or average
y all
)]([)( ypyyE
What is E(T) for project duration example?
= 4(0.2) + 5 (0.3) + 6(0.5) = 5.3 weeks
What if C = f(T), where C costs
Is C a random variable?
What is E(C)?
statistical processes 7
Mean of a Discrete RVInteresting Characteristics
Expected value of a function of y, a discrete rv
Let g(y) be function of y
Suppose C = g(T) = 5T + 3, find E(C)
E(C) = [5(4)+3]0.2 + [5(5)+3]0.3 + [5(6)+3]0.5 = 29.5
Let d = constant
E(d)= constant
E(dy)= dE(y)
E() is a linear operator
E(X + Y) = E(X) + E(Y), where X & Y are rv
y all
)]()([)]([ ypygygE
statistical processes 8
Random VariableVariance - A Measure of Dispersion
Variance of a discrete rv
Previously defined variance for population & sample
jy all
2j
22 )()-(y)( jypyE
1
)(
:Variance Sample
)()(
:Variance Population
1
2
2
1
2
1
2
2
n
yys
n
d
n
y
n
i
i
n
i
i
n
i
i
statistical processes 9
Mean and VarianceInterpretation
Mean
Expected value of the random variable
Variance
Expected value of distance2 from mean
22 )(
)(
yE
yE
statistical processes 10
Discrete Random VariablesUseful Models
Examine frequently encountered models
Be sure to understand
Process being modeled by random variable
Derivation of pmf
Use of Excel Calculating pmf Graphing pmf
statistical processes 11
Binomial Distribution FunctionSetting the Stage
Bernoulli rv
Models process in which an outcome either happens or does not
A binary outcome What are examples?
Formal description
Trial results in 1 of 2 mutually exclusive outcomes
Outcomes are exhaustive
P(S) = p ; P(F) = q ; p + q = 1.0
statistical processes 12
Probability Mass FunctionBernoulli RV
2)(
)(
1 y for p
0 yfor q)(
occur doesevent if S,or 1
occurnot doesevent if F,or 0
pqyVAR
pyE
yP
y
yHow can we derive these?
statistical processes 13
Deriving the mean and variance of a Bernoulli Random Variable
Deriving the mean of a rv:
ppppyypyE
yypyE
qp
ppyp
y
y
)1()0(0)1(1)()(
)()(
)0(
)1()1(
We know that
and
We also know that
So it follows that
statistical processes 14
Deriving the variance of a random variable
pqpppp
p
pp
ypyyE
)1(
)1(
)0()0()1()1(
)()(
22
22
2222
22222
statistical processes 15
Binomial DistributionProblem Description
Problem:
Given n trials of a Bernoulli rv, what is probability of y successes?
Why is y a discrete rv?
Simple example
Toss coin 3 times, find P(2 heads)
n = 3 ; y = 2
P(H, H, T) = (.5)(.5)(.5) = 0.125
Could also be (H,T,H) or (T, H, H)
P(2 heads) = 0.125 + 0.125 + 0.125 = 0.375
statistical processes 16
Binomial Distribution FunctionGeneralizing From Simple Example
Recall 2 heads in three tosses
How many different ways is this possible? Combination of three things taken two
at a time
3!1!2
!3
)!(!
!
2
3
nNn
N
Returning to the P(2 heads)
375.0)5.0()5.0(32
3 heads) P(2 212
qp
statistical processes 17
Binomial Distribution FunctionCreating the Model
Key assumption
Each trial an independent, identical Bernoulli variable
E(y) = np
Var(y) = npq
ynyqpy
n
P(y)
trialsBernoullin in successes of # y Let
y n
# of combinationsProbability of y successes
Probability of n - y failures
statistical processes 18
Binomial Distribution FunctionSimple Problem
Have 20 coin tosses
Find probability that will have 10 or more heads
Set up the problem and will then solve
Let n = 20 y = # of heads p = q = 0.50 Want p(y 10)
Will solve manually and using Excel
statistical processes 19
Binomial Example: Manual solution
But remember! This is just for y = 10. We must do this for y = 11, 12, …, 20 as well and then sum all the values!
176.0)756,184(
756,184!10!10
!20
10
20
P(y)
1010
qp
y
n
qpy
n yny
statistical processes 20
statistical processes 21
statistical processes 22
statistical processes 23
Multinomial DistributionGeneralizing the Binomial Distribution
Problem
Events E1, …, Ek occur with probabilities p1,
p2, …, pk . Given n independent trials
probability E1 occurs y1 times, … Ek occurs
yk times.
Why is this a more general case than the Binomial?
Can you describe an example?
statistical processes 24
Formula for MultinomialUnderstand Relationship to Binomial
kyk
yy
k
k
k
pppyyy
n
yyyp
yYyYyYp
...!,...,!,!
!
),...,,(
),...,,(
2121
21
21
21
This is calleda joint distribution.
Need to understand conventionNote there are k random variables
j = npj j2 = npjqj = npj(1-pj)
statistical processes 25
Extending the BinomialTwo Special Cases
Recall Binomial distribution
What problem does it model?
Given n independent trials, p = p(success)
Geometric distribution Define y as rv representing first
success
Negative Binomial Define y as rv representing rth success
statistical processes 26
Geometric Distribution
Recall problem statement for geometric
Suppose p = 0.2, what is p(Y=3)?
Only possible order is FFS
p(Y=3) = (.8)(.8)(.2)
Generalizing simple example
p(y) = pqy-1 ; = 1/p ; 2 = q / (p2)
What is implicit assumption about largest value of y?
statistical processes 27
Negative Binomial Distribution
2
1
1)(
p
rq
p
r
qpr
yyp ryr
ProblemHave series of Bernoulli trials, want probability of waiting until yth trial to get rth success
Let p = 0.5 & r = 2, do we getreasonable results?
statistical processes 28
HypergeometricAn Extension to the Binomial
Suppose have 10 transformers, know 1 is defective
p(defective) = 0.1
Let y = # of defectives in a sample of n
Suppose pick 3 transformers, find p(y=2)
Can I use the Binomial distribution???
Does the p stay constant through all trials??
statistical processes 29
Transformer Example
What do you note about example:
p(defective) changed during sampling process # of trials n large with respect to N What if N >> n ?
Would p(defective) change during
sampling process?
Process called sampling without replacement Binomial assumes infinite population OR
sampling with replacement. Why?
If we cannot use Binomial then what?
Hypergeometric Probability Distribution
statistical processes 30
Hypergeometric Distribution
n
N
y
r
ypynrN
)(
N # in populationn # in sampler # of Successes in populationy # of Successes in sample
1) Why is y a rv?2) What do we mean byp(y)?3) What is r/N ?
statistical processes 31
Poisson ProcessA Useful Model
In a Poisson process
Events occur purely randomly
Over long term rate is constant
What is implication of the above?
Memoryless process
What are some processes modeled as Poisson processes?
statistical processes 32
A Poisson Process is a Rate
# of cars passing a fixed point in one
minute
# of defects in an 8x8 sheet of plywood
statistical processes 33
Poisson Probability Distribution
2
!)(
y
eyp
y
Where,y # of occurrences in a given unit mean # of occurrences in a given unite 2.71828…
Note particularlyinteresting relationship
Note must be for the same unit of measure!
Why does thismake sense?
statistical processes 34
Discrete Random VariablesExcel Special Functions
SpecialFunctions
SpecialFunctionsExcel
HYPGEOMDISTBINOMDISTNEGBINOMDISTPOISSON
Are there others?
statistical processes 35
Class 3 Readings & Problems
Reading assignment
M & S Chapter 4 Sections 4.1 - 4.10
Recommended problems
M & S Chapter 4 59, 69, 84, 87, 88, 90, 96, 98, 100