Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Lecture5 - Random Variable - 0923

Uploaded by

九.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lecture5 - Random Variable - 0923

Uploaded by

九.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

DOTE 2011 | Fall 2024

@ CUHK Business School

Statistical Analysis for Business Decisions


Random Variable

Yunduan Lin
Assistant Professor
Department of Decisions, Operations and Technology
CUHK Business School
Agenda

Statistical Analysis for Business Decisions

01 Random variable
o Probability mass function
o Mean
o Variance

02 Discrete random variable


o Uniform distribution
o Bernoulli distribution
o Binomial distribution
o Poisson distribution
Random Variable - Definition

Random Variable

A function that assigns numbers to the outcomes.

​Why?
o Sample space for tossing a coin ten times is large
o Using a random variable reduces the complexity
o Much easier to work (numbers rather than sets)

Support of Random Variable

The set of numbers to be assigned by the random variable


Discrete Random Variable - Definition

Discrete Random Variable

o The support is finite (or countably finite)


o Naturally arises when the number of outcomes in the sample space is also finite

Example: Tossing a coin once


o Sample space S={H,T} where H is head and T is tail
o Let X be a random variable of total number of heads
o X=1 when we have a head, or X(H)=1
o X=0 when we have a tail, or X(T)=0
o Support of X is {0,1}
Discrete Random Variable - Example
Example: Tossing a coin twice

o Sample space S={HH,HT,TH,TT} where H is head and T is tail


o Let X be a random variable of total number of heads
o Then X=0 means TT, X=1 means HT or TH, and X=2 means HH.
o Formally, X(TT)=0, X(TH)=X(HT)=1, and X(HH)=2.
o Support of X is {0,1,2}
Probability Mass Function - Definition

Probability Mass Function (PMF) Random Variable

A specific value (number)

Example: Tossing a fair coin once


o Sample space S={H,T}
o Let X be a random variable of total number of heads
o Consider two cases: X(H)=1 and X(T)=0.
x 0 1
P(x) ½ ½

o P(0)=Pr(X=0)=Pr(T)=½
o P(1)=Pr(X=1)=Pr(H)=½
Cumulative Distribution Function - Definition

Cumulative Distribution Function (CDF)

Example: Tossing a fair coin once


o Sample space S={H,T}
o Let X be a random variable of total number of heads
o Consider two cases: X(H)=1 and X(T)=0.
x 0 1
P(x) ½ ½
F(x) ½ 1
o F(0)=P(0)=½
o F(1)=P(0)+P(1)=1
Properties
Properties: Tossing a fair coin once
x 0 1
From probability rules, P(x) ½ ½
o By Axiom 1,
o By Axioms 2 and 3, F(x) ½ 1

Since

o
o
o
o
Properties - Example
Example: Tossing a fair coin twice
o Sample space S={HH,HT,TH,TT}
o Let X be a random variable of total number of heads
o Consider four cases: X(HH)=2, X(HT)=1, X(HT)=1, X(TT)=0.
x 0 1 2
P(x) 1/4 1/2 1/4
F(x) 1/4 3/4 1

o P(0)=Pr(TT), P(1)=Pr(HT)+Pr(TH), P(2)=Pr(TT)


o F(0)=P(0), F(1)=P(0)+P(1), F(2)=P(0)+P(1)+P(2)
Properties - Example
Example: Rolling a fair dice
o Sample space S={1,2,3,4,5,6}
o Let X be a random variable of the face value
o Consider six cases:
x 1 2 3 4 5 6
P(x) 1/6 1/6 1/6 1/6 1/6 1/6
F(x) 1/6 1/3 1/2 2/3 5/6 1
Expectation - Definition

Expectation

Weighted average with probability as weights:

Example: Meaning of expectation


o Consider we toss a fair coin once, and let X be the number of heads
o The PMF for random variable X is: P(0)=P(1)=1/2
o Suppose we repeat the toss one million times, we should see approximately half a million heads
and half a million tails. In other words, for the random variable X, we can see half a million 1 and
half a million 0.
o Then, what is the mean (average) of the one million observations of the random variable?
Expectation - Example
Example: Rolling a fair dice
o Let X be a random variable of the face value

x 1 2 3 4 5 6
P(x) 1/6 1/6 1/6 1/6 1/6 1/6
F(x) 1/6 1/3 1/2 2/3 5/6 1

o Expected value of X is
Expectation - Property

Linear property of expectation


Let a and b be constants, let X be random variables.

Example: Let X be the price of a stock.


x 1 2 3
P(x) 1/4 1/2 1/4
Expected value of X is

What is the expected value of portfolio that has 100 shares of stock X and 300 dollars of cash?
Expectation - Property

Linear property of expectation


Let a and b be constants, let X be random variables.

We will just show the last one,

Definition of expectation Based on the axioms of probability


Variance - Definition

Variance

Expected squared difference from mean

Example: Rolling a fair dice x 1 2 3 4 5 6


o Let X be the face value of the dice. P(x) 1/6 1/6 1/6 1/6 1/6 1/6
o Recall that
F(x) 1/6 1/3 1/2 2/3 5/6 1
o The variance can then be derived as
Variance - Example
Example: Toss a fair coin twice
o Sample space S={HH,HT,TH,TT}
o Let X be a random variable of total number of heads
x 0 1 2
P(x) 1/4 1/2 1/4
F(x) 1/4 3/4 1

o The expectation is

o The variance is
Variance - Property

Useful formula for variance


Let a and b be constants, let X be random variables.

Example: Let X be the price of a stock. x 1 2 3


P(x) 1/4 1/2 1/4

Recall that expected value of X is 2, the variance is

What is the variance of portfolio that has 100 shares of stock X and 300 dollars of cash?
Variance - Property

Useful formula for variance


Let a and b be constants, let X be random variables.

First of all, we have

Linear property of expectation


We will just show the last one,

Definition of variance
Properties for Sum

Expectation of the sum


Expectation of the sum is the sum of expectations

Let X and Y be random variables.

By linear property of expectation, we have

The following two equations hold Total probability rule


Properties for Sum

Variance of the sum

Let X and Y be random variables.


If X and Y are independent, then we have

If X and Y are NOT independent, we have


Properties for Sum

Note that
Properties for Sum - Example
Example:

Suppose the mean return and variance for stock X are 0.1 and 0.05. Those for stock Y are 0.05 and
0.01. Consider a portfolio Z that equally divided between two stocks. That is, Z = 0.5X +0.5Y.

o Expectation of the portfolio is

o If the two stocks are independent, variance of the portfolio is


Uniform Distribution - Definition

Uniform distribution
Every possible value of X is equally likely

o Support of X: {x1, …, xn}

o Probability mass function


x x1 ... xn
P(x) 1/n ... 1/n

Example:
o Number of heads tossing a fair coin
o Face value of rolling fair dice
Bernoulli Distribution - Definition

Bernoulli distribution

o Two outcomes: failure or success


o Probabilities of success and failure: p and 1-p
o Random variable X: number of success
o Support of X: {0,1}
o Pr(X=1)=p and Pr(X=0)=1-p
o Probability mass function
x 0 1
P(x) 1-p p

Example:
o Tossing a coin (fair/unfair)
o Running an experiment with binary outcomes
Bernoulli Distribution - Property

Bernoulli distribution

o Probability mass function

o Mean

o Variance

Intuition:
o mean: more successes with a higher p
o variance: lowest when most successes/failures (under
extreme values of p: p=0 or p=1), highest when most
uncertain (p=1/2)
Bernoulli Distribution - Property

o Expectation

o Variance
Binomial Distribution - Definition

Binomial distribution

o n independent Bernoulli trials


o Each trial has a success probability p
o Random variable X: number of successes
o Support of X: {0,1, …, n}
o Using combinatorics, we know

Intuition:
o First, consider the probability that we have first x successes followed by n−x failures.
o Since each trial is independent, the probability of the union of these outcomes would simply the
multiplication of each outcomes px(1−p)n-x
o Next, there are nCx ways to rearrange these successes and failures. For example, another
extreme cases is that we have n−x failures followed by x successes.
Binomial Distribution - Property

Binomial distribution

o Probability mass function

o Mean

o Variance

Intuition:
o Binomial X is the sum of n independent Bernoulli.
o The mean and variance of X are simply n times of mean and
variance of a Bernoulli random variable.
Binomial Distribution - Property

Let X1, …, Xn are n independent Bernoulli random variables.


Then X=X1+…+Xn is a binomial random variable.

o Expectation

o Variance
Binomial Distribution - Example
Example:

A restaurant owners found that 30% of customers like spicy food.

o What is the probability that out of five randomly chosen customers, 2 of them like spicy food?

Note that we have n=5, x=2 and p=0.3

o What is the probability that out of five randomly chosen customers, no more than 2 of them like
spicy food?
Binomial Distribution - Example
Example: Marketing campaign

A company launches a marketing campaign to promote a new product to targets 10,000 potential
customers. The company estimates that the probability of a customer making a purchase is 0.05.

o Using the binomial distribution, the company can calculate the probability of achieving a specific
number of purchases (e.g., 500)

Note that we have n=10000, x=500 and p=0.05

This information can be used to assess the potential success of the campaign.
Binomial Distribution - Example
Example: Quality control

In a quality control inspection, the company randomly selects a sample of items from a production
batch. Let’s say the sample size is 100 and the overall defect rate in the batch is known to be 0.02.

o Using the binomial distribution, the company can determine the probability of finding a certain
number of defective items (e.g., 5) in the sample.

Note that we have n=100, x=5 and p=0.02

This information help the company assess the quality of the production batch.
Binomial Distribution - Example
Example: Employee Turnover

A company wants to analyze its employee turnover rate. Based on historical data, it is known that
the annual turnover rate is 0.10 (or 10%). The company currently has 200 employees.

o Using the binomial distribution, the company can calculate the probability of a specific number of
employees leaving the company in a given year (e.g., 20).

Note that we have n=200, x=20 and p=0.1


Binomial Distribution - Example
Example: Quality Assurance

A software development company performs a series of tests on its latest software release. Each test
has a success rate of 0.95, and there are 20 tests in total.

o Using the binomial distribution, the company can calculate the probability of passing a specific
number of tests (e.g., 18 out of 20) and assess the overall quality of the software.

Note that we have n=20, x=18 and p=0.95


Binomial Distribution - Example
Example: Inventory Management

A retail store receives a shipment of 500 items from a supplier. Based on historical data, it is known
that the defect rate of items from this supplier is 0.03.

o Using the binomial distribution, the company can calculate the probability of a specific number of
defective items (e.g., 10) in the shipment.

Note that we have n=500, x=10 and p=0.03

This information helps the store determine appropriate actions for inventory management,
such as returning or repairing the defective items.
Poisson Distribution - Definition

Poisson distribution

o Partition a period of time with n intervals


o Each internal has an independent Bernoulli trial
o Each trial has success probability p
o Random variable X: total number of successes
o Support of X: {0, 1, 2, …, n}
o Probability mass function

o When n is very large and p is very small, the probability mass function becomes
Poisson Distribution - Property

Poisson distribution
Denote and
o Support of X: {0, 1, ...}
o Probability mass function

o Mean

o Variance

Intuition:
o Usage: arrival of customers over a period of time
o Different from binomial, we have mean = variance
• Var(X) = np(1−p) ≈ np because 1−p ≈ 1.
Poisson Distribution - Property

Note that

o Expectation

o Variance
Poisson Distribution - Example
Example:

The number of customers for a restaurant each hour follows Poisson distribution with mean 5.

o What is the probability that exactly 2 customers will arrive in next hour?

Note that we have


Poisson Distribution - Example
Example: Call center application

A call center receives an average of 50 calls per hour.

o Using the Poisson distribution, the company can calculate the probability of receiving a specific
number of calls (e.g., 60) in a given hour.

Note that we have

This information can help in staffing decisions, resource allocation, and estimating
customer wait times.
Poisson Distribution - Example
Example: Website visitors

A website experiences an average of 500 visitors per day.

o By applying the Poisson distribution, the company can calculate the probability of having a
certain number of visitors (e.g., 600) on a specific day.

Note that we have

This information can be used for capacity planning, server allocation, and website
performance optimization.
Poisson Distribution - Example
Example: Manufacturing Process

A manufacturing process produces an average of 2 defects per day.

o By applying the Poisson distribution, the company can calculate the probability of having a
specific number of defects (e.g., 3) on any given day.

Note that we have

This information can aid in quality control, identifying process improvements, and setting
customer expectations.
Poisson Distribution - Example
Example: Insurance claims

An insurance company receives an average of 5 claims per day for a particular type of coverage.

o By applying the Poisson distribution, the company can calculate the probability of receiving a
specific number of claims (e.g., 3) in a given day.

Note that we have

This information can aid in premium pricing, risk assessment, and claims management.
A Feedback Form for the Entire Term

https://docs.google.com/forms/d/e/1FAIpQLSfsEgnMFLypI_KW6GF7j_FXtVY5E4Jrmf2P_BDwaG8GXWDc0A/viewform?usp=sf_link

You might also like