Khan Academy - Statistics and Probability - Unit 9 RANDOM VARIABLES

RANDOM VARIABLES

PART 1 Discrete random variables

PART 2 Combining random variables 

PART 3 Binomial random variables

PART 4 Geometric random variables

PART 5 Law of large numbers

PART 6 Poisson distribution 

 


PART 1 Discrete random variables

1. Random variable: is a set of possible numerical values determined by the outcome of a random experiment. It’s a way to map/quantify outcomes of random processes to numbers

  • [Eg] Define a random variable X, where X= \begin{cases} 1, \quad head\\ 0, \quad tail \end{cases}

2. Random variable vs. Traditional algebra variable

(1) Random variable is usually denoted as capital letter, such as X; traditional algebra variable is usually denoted as lower case, such as x

(2) We can assign values/variables to traditional variables or solve the values for them; whereas random variables can take lots of values with different probabilities, and it makes much sense to talk about the probability of a random variable equaling to a value, the probability of a random variable less than/greater than a value, or the probability of a random variable having some properties 

3. Types of random variable — discrete vs. continuous

(1) Discrete random variable: has a countable number of possible values. The number of values can be finite and infinite, but we can list the values that a random variable could take on

(2) Continuous random variable: can take all values in a given interval. We can’t count the number of possible values and can’t list the values.

[Eg1] X= \begin{cases} 1, \quad head\\ 0, \quad tail \end{cases}

  • X_1 is discrete variable

[Eg2] X_2 is exact mass of a random animal selected at the New Orleans zoo.

  • X_2 is continuous variable.

[Eg3] X_3 is the year a random student in the class was born 

  • X_3 is discrete variable.

[Eg4] X_4 is the number of ants born tomorrow in the universe

  • X_4 is discrete variable.

[Eg5] X_5 is the number of ants born tomorrow in the universe

  • X_5 is discrete variable

[Eg6] X_6 is the exact winning time for the men’s 100m dash in 2016 Olympics

  • X_6 is continuous variable

[Eg7] X_7 is the winning time for the men’s 100m dash in 2016 Olympics rounded to the nearest hundredth

  •  X_7 is discrete variable

4. Expected value of discrete random variable 

(1) Assume a discrete random variable X can take x_1, x_2, ...x_p with the probability of p_1,p_2,...p_n, respectively. The expected value of X is E(X)=\mu_X=\sum_{i=1}^nx_ip_i=x_1p_1+x_2p_2+...x_np_n 

(2) Expected value uses probability to tell us what outcomes to expect in the long run.

[EXERCISE] John just bought a brand new cell phone and is considering buying a warranty. The warranty costs 200 euros and is worth 1000 euros if his phone breaks. John estimates that there is a 10% chance of his phone breaking. Find the expected value of buying the warranty.

[ANSWER]

  • If the cell phone breaks, the value of the warranty is 1000-200=800, with 10% probability
  • If the cell doesn’t phone break, the value of the warranty is -200=-200, with 90% probability
  • So the expected value is 800\times 10\%+(-200)\times 90\%=-100 

5. Variance and Standard deviation of discrete random variable 

Assume a discrete random variable X can take x_1, x_2, ...x_p with the probability of p_1,p_2,...p_n, respectively. 

(1) The variance of X is \begin{aligned} Var(X)&=\sum_{i=1}^n(x_i-\mu)^2p_i=(x_1-\mu)^2p_1+(x_2-\mu)^2p_2+...(x_n-\mu)^2p_n\\ &=E(X^2)-\mu^2 \end{aligned}

(2) Standard deviation of X is \sigma_X=\sqrt{Var(X)}

6. Probability density function: 见Unit04-Modeling data distribution-Part 7

(1) Probability density function(PDF) is used to describe the probability of the outcomes for continuous random variable

(2) Probability mass function(PMF) is used to describe the probability of the outcomes for discrete random variable 

7. Impact of transforming random variables — scaling and shifting

Assume k is a constant and X is a random variable with mean being \mu_X and standard deviation being \sigma_X, then

(1) the impact of shifting: Y=X+k

  • \mu_Y=\mu_X+k
  • \sigma_Y=\sigma_X

(2) the impact of scaling: Z=kX

  • \mu_Z=k\mu_X
  • \sigma_Z=k\sigma_X

 


PART 2 Combining random variables 

1. Effect on mean, standard deviation, and variance

We can form new distributions by combining random variables. If we know the mean and standard deviation of the original distributions, we can use that information to find the mean and standard deviation of the resulting distribution.

  • we can combine means directly
  • we can variances/standard deviations when the random variables are independent

 

Mean

Variance

Adding: T=X+Y

\mu_T=\mu_X+\mu_Y

\sigma_T^2=\sigma_X^2+\sigma_Y^2

Subtracting: D=X-Y

\mu_D=\mu_X-\mu_Y

\sigma_D^2=\sigma_X^2+\sigma_Y^2

  • Make sure that the variables are independent or that it’s reasonable to assume independence, before combining variances.
  • Even when we subtract two random variables, we still add their variances; subtracting two variables increases the overall variability in the outcomes.
  • We can find the standard deviation of the combined distributions by taking the square root of the combined variances.

2. Why independence matters for variance of sum

Assume X is the number of hours a random selected person slept yesterday and Var(X)=4

Assume Y is the number of hours a random selected person was awake yesterday and Var(Y)=4

  • If X and Y are independent, then Var(X+Y)=Var(X)+Var(Y)=4+4=8
  • But, actually X and Y are not independent and X+Y=24h; therefore Var(X+Y)=0\ne8

3. Combining normal random variables 

When we combine variables that each follow a normal distribution, the resulting distribution is also normally distributed.

 


PART 3 Binomial random variables

1. Binomial variables: a binomial random variable X represents the number of successes in n repeated trials of a Bernoulli experiment. Conditions that make a random variable be a binomial random variable:

(1) the outcome of each trial can be classified as either success or failure

(2) each trial is independent of the others

(3) there is a fixed number of trials

(4) the probability p of success on each trial remains constant

2. 10% rule of assuming “independence” between trials

If the sample size is less than or equal to 10% of the population, then we can assume that each trial is independent of the others

[EXERCISE] A division of a company has over 200 employees, 48% of which are male. The company is going to randomly select 10 of these employees to attend a conference. Let Z= the number of male employees chosen. Is Z a binomial variable? Why or why not?

A. Each trial isn’t being classified as success or failure, so Z is not a binomial variable

B. There is no fixed number of trials, so Z is not a binomial variable

C. The trials are not independent, so Z is not a binomial variable

D. This situation satisfies each of the conditions for a binomial variable, so Z has a binomial distribution 

[ANSWER] D is the correct answer

A. False. It’s a success when the person chosen is a male, and failure when the person chosen is not a male.

B. False. The number of trials is fixed at 10 employees.

C. False. Even though they are being sampled without replacement, the sample size of 10 employees is less than 10% of the population size, so we can consider the trials independent.

D. True. It satisfies 4 conditions for a random variable being a binomial random variable: (1) Each trial has two outcomes(male or not); (2) Results of each trial can be considered independent because of the 10% rule; (3) There is a fixed number of trials, which is 10 employees; (4) The probability of success is the same for each trial, which is 40%, because of the 10% rule.

3. Binomial distribution 

(1) Definition: the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in n Bernoulli trials

(2) If a random variable X follows the binomial distribution with parameters n\in N and p\in [0,1], then we write X\sim B(n,p)

(3) Probability mass function: if X\sim B(n,p), the probability of getting exactly k successes in n independent Bernoulli trials is f(k,n,p)=P(k;n,p)=P(X=k)=C_n^kp^k(1-p)^{n-k}  

(4) Cumulative distribution function: F(k;n,p)=P(X\le k)=\sum_{i=0}^kC_n^ip^i(1-p)^{n-i}

4. Why binomial distribution important?

For a lot of discrete processes, one might assume that the underlying distribution is a binomial distribution, and it is the sum of any events that have only two outcomes which are pretty frequent.

5. Normal distribution vs. Binomial distribution 

(1) Normal distribution describes continuous data which have a symmetric distribution, with a characteristic “bell” shape

(2) Binomial distribution describes the distribution of binary data from a finite sample

(3) Binomial distribution is a discrete version of normal distribution; as you get more and more trials, the binomial distribution is going to approach the normal distribution(the normal distribution can be used as an approximation to the binomial distribution)

(4) A common rule of thumb is that the normal approximation works well when np>5 and n(1-p)>5.

6. Bernoulli distribution

(1) Definition: is a discrete probability distribution for a single Bernoulli trial

(2) Expected value for Bernoulli distribution: E(X)=p

(3) Variance for Bernoulli distribution: Var(X)=p(1-p)

7. Bernoulli distribution vs. Binomial distribution

(1) The Bernoulli distribution represents the success or failure of a single Bernoulli trial

(2) The Binomial distribution represents the number of successes and failures in n independent Bernoulli trials

(3) Expected value

  • Bernoulli distribution: E(X)=p
  • Binomial distribution: E(X)=np

(4) Variance 

  • Bernoulli distribution: Var(X)=p(1-p) 
  • Binomial distribution: Var(X)=np(1-p)

 


PART 4 Geometric random variables

1. Geometric random variable vs. Binomial random variable

(1) Binomial random variable: must follow the following conditions: 

  • the outcome of each trial can be classified as either success or failure
  • each trial is independent of the others
  • there is a fixed number of trials
  • the probability p of success on each trial remains constant

[Eg] X is the number of 6 after 12 rolls of fair die, X is binomial random variable 

  • It is asking “How many successes in finite number of trials?”

(2) Geometric random variable: must follow the following conditions: 

  • the outcome of each trial can be classified as either success or failure
  • each trial is independent of the others
  • the probability p of success on each trial remains constant

[Eg] Y is the number of rolls until get 6 on fair die, Y is geometric random variable

  • It is asking “How many trials until success?”

2. Geometric distribution: the probability distribution of the number(X) of Bernoulli trials needed to get one success

(1) Expected value: E(X)=\frac{1}{p}

(2) Variance: Var(X)=\frac{1-p}{p^2}  

3. Probability mass function and Cumulative distribution function for Geometric distribution 

(1) PMF: P(X=k)=(1-p)^{k-1}p

(2) CDF: P(X\le k)=P(X<k+1)=1-P(X>k)=1-(1-p)^k

(3) P(X>k) = P(前 k 次都失败)= (1-p)^k

(4) P(X>k)=P(X\ge k+1)

[EXERCISE] Violet is taking a computer-adaptive test, where each time she answers a question correctly, the computer gives her a more difficult question. Let Q be the number of questions Violet answers correctly before she misses one. What type of variable is Q?

[ANSWER] It’s neither binomial random variable nor geometric random variable.

  • Because it doesn’t have fixed times of trials, it’s not a binomial random variable.
  • The probability of success in each trial is not the same because the difficulty of the question changes each time, it’s not a geometric random variable.

 


PART 5 Law of large numbers

In probability and statistics, the law of large numbers states that as a sample size grows, the mean of the sample gets closer to the expected value of the whole population

 


PART 6 Poisson distribution 

1. Poisson random variable: a count of the number of occurrences of an event in a given unit of time, distance, area, or volume

2. Poisson distribution: is the discrete probability distribution of the number of events occurring in a given time period, given the average number of times the event occurs over that time period.

3. Conditions for Poisson distribution / Poisson random variable: 

(1) Events occur independently

  • If an event occurs, it doesn’t affect the probability of another event occurring in the same time period.

(2) The rate of occurrence is constant. / The probability that an event occurs in a given length of time doesn’t change through time

(3) The probability of an event occurring is proportional to the length of the time period.

  • For example,  if a certain fast-food restaurant gets an average of 3 visitors to the drive-through per minute and it follows Poisson distribution; then there should be 6 visitors to the drive-through in a 2-minute period.

4. Probability mass function and Cumulative density function for Poisson distribution 

A discrete random variable X is said to have a Poisson distribution with parameter \lambda >0, where \lambda represents the average number of times an event occurs in a given time interval. Then for k=0,1,2,...

(1) PMF: f(k;\lambda)=P(X=k)=\frac{\lambda^ke^{-\lambda}}{k!}, k represents the number of times an event actually occurs in that given time interval.

(2) CDF: F(k;\lambda)=P(X\le k)=\sum_{i=0}^k\frac{\lambda^ie^{-\lambda}}{i!}=e^{-\lambda}\sum_{i=0}^k\frac{\lambda^i}{i!}

5. Expected value and Variance for Poisson distribution 

(1) Expected value: E(X)=\lambda

(2) Variance: Var(X)=\lambda

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值