6. Special Random Variables and Repeated Sampling Distributions

A random variable X has a discrete uniform distribution and it is referred to as a discrete uniform random variable if and only if , its probability function is given by fX(xj)=1k, j=1,2,3,...,k where xjxi for ij  DX={x1,x2,...,xk}

Properties: Assuming that x1=1, x2=2, , xk=k, then

  1. μX=E(X)=k+12

  2. Var(X)=k2112

  3. MX(t)=i=1ketxi/k

{.example} Example: Let X be the random variable that represents the number of dots when one rolls a die. Then X follows a discrete uniform distribution taking values {1,2,3,4,5,6}. Its probability function is given by P(X=x)={16,x=1,2,3,4,5,60,otherwise. Expected value: E(X)=6+12=72 Variance: Var(X)=62112=3512 Moment generating function: MX(t)=E(etX)=16i=16ei×t.

1 Bernoulli random variable

The Bernoulli random variable takes the value 1 with probability p and the value 0 with probability 1p, where p(0,1), that is X={1where P(X=1)=p0where P(X=0)=1p the probability function is given by fX(x)=P(X=x)={px(1p)1x,x=0,10,otherwise

Properties:

  1. E(X)=p

  2. Var(X)=p(1p)

  3. MX(t)=(1p)+pet.

Remark: This random variable is used when the result of the experiment is a success or a failure.

2 Binomial random variable

  • The Binomial random variable is defined as the number of successes in n trials, each of which has the probability of success p.

  • The Binomial random variable: X= number of successes in n trials. One can show that the probability function is given by

    fX(x)=(nx)×px(1p)nx,x=0,1,2,,n

    where (nx)=n!x!(nx)! is the number of x combinations from a set with n elements and k!=k(k1).

Remark:

  • The parameters of the random variable are n and p.

  • If X is a Binomial random variable with parameters n and p we write XB(n,p).

  • In the case of the Bernoulli random variable XB(1,p).

Properties:

  1. E(X)=np,

  2. Var(X)=np(1p)

  3. MX(t)=[(1p)+pet]n

  4. If XiB(1,p) and the Xi are independent random variables i=1nXiB(n,p), that is the sum of n independent Bernoulli random variables with parameter p is a Binomial random variable with parameters n and p.

  5. If X1B(n1,p) and X2B(n2,p) and X1 and X2 are independent, then X1+X2B(n1+n2,p)

Example: In a given factory, 2% of the produced products have a failure. Let X be the random variable that represents the number of products produced with a failure in a sample of 5 products. Then XB(n=5,p=0.02). Expected value: E(X)=n×p=5×0.02=0.1 Variance: Var(X)=n×p×(1p)=5×0.02×0.8=0.08 Probability: P(X=1)=(51)×0.021×0.984=0.092

Example: Let X be a random variable that represents the lifetime in hours of a bulb lamp with density function fX(x)=1100ex/100, for x>0

Compute the probability that 3 bulb lamps in a sample of 5 have a lifetime smaller 100 hours.

Solution: We can start by computing the probability that 1 bulb lamp has lifetime smaller 100 hours. P(X<100)=01001100ex/100dx=1e1=≈0.63. Let Y be the random variable that represents the number of bulb lamps in a sample of 5 with a lifetime smaller 100 hours. YB(n=5,p=0.63) The required probability is P(Y=3)=(53)×0.633×0.372=0.3423

Example: Suppose that in a group of 1000 computers 50 have a problem in the hardware system. We pick randomly a sample of 100 computers. Let X be the random variable that counts the number of computers with hardware problems.

  • What is the distribution of X if the experiment is done with replacement?

    Answer: X counts the number of successes in a set of 100 computers. The selection is made with replacement. XBin(100,1/20)

    What is the distribution of X if the experiment is done without replacement?

    Answer: X counts the number of successes in a set of 100 computers, but the selection is made without replacement. This means that X does not follow a binomial distribution. Indeed,

    P(X=x)=(100x100050)(x50)(1001000).

Consider a finite population of size N that contains exactly M objects with a specific feature. The hyper-geometric distribution is a discrete probability distribution that describes the probability of k successes in n draws (to get k objects with the referred feature), without replacement.                      XHypergeometric(N,M,n)P(X=k)={(nkNM)(kM)(nN),k=max{0,n(NM)},,min{n,M}0,otherwise Properties: If XHypergeometric(N,M,n), then

  1. E(X)=n×MN

  2. Var(X)=nMN(1MN)NnN1

  3. There is no closed form solution for MX(t)

Example: Assume that there are 20 balls in a box, where 2 are green, 8 are blue, 5 are red and 5 yellow. If someone chooses randomly and without replacement 3 balls from the box. Compute the probability that 1 of them is blue.

Solution: Let X be the random variable that counts the number of blue balls in a set of 3 when the experiment is made without replacement. XHypergeometric(N=20,M=8,n=3) The probability function of this random variable is P(X=x)={(8x)(122)(203),x=0,1,2,30,otherwise The required probability is P(X=1)=(81)(122)(203)=4495.

  • In connection with repeated Bernoulli trials, we are sometimes interested in the number of the trial on which the kth success occurs.

Assume that k=1.

  • Each trial has two potential outcomes called "success" and "failure". In each trial the probability of success is p and of failure is (1p).

  • We are observing this sequence until the first success has occurred.

  • If X is the random variable that counts the number of trials until a success! and the 1st success occurs on the xth trial (the first x1 trials are failures), then X follows a geometric distribution with a probability of success p.                    XGeo(p)P(X=x)=(1p)x1p,x=1,2,3,

X is the random variable that counts the number of trials until a success!

Useful Result: P(X>n)=(1p)n,nN Therefore, FX(n)=1(1p)n, for nN

Memoryless property: P(X>n+m|X>m)=P(X>n),nN

Remark: U is a random variable taking values in N that satisfies the memoryless property iff U has a geometric distribution.

  • Assume now that we are observing a sequence of Bernoulli trials until a predefined number k of successes has occurred.

  • If the kth success is to occur on the xth trial, there must be k1 successes on the first x1 trials, and the probability for this is P(X=x)=(x1k1)pk(1p)xk,   x=k,k+1,k+2, where X follows a negative binomial distribution with parameters k and p XNB(k,p)

Properties:

  1. E(X)=kp

  2. Var(X)=kp(1p1)

  3. MX(t)=(pet1et(1p))k

The Poisson random variable is a discrete rv that describes the number of occurrences within a randomly chosen unit of time or space. For example, within a minute, hour, day, kilometer.

The Poisson probability function is a discrete function defined for non-negative integers. If X is a Poisson random variable with parameter λ, we write XPoisson(λ). The Poisson distribution with parameter λ>0, it is defined by fX(x)=P(X=x)=λxeλx!,x=0,1,2,.. Properties:

  1. E(X)=Var(X)=λ.

  2. MX(t)=eλ(et1).

  3. If XiPoisson(λi) and the Xi are independent random variables, then i=1nXiPoisson(i=1nλi).

Example: Assume that in one day the number of people that take bus n1 in a small city follows a Poisson distribution with Var(X)=3.

Question: What is the probability that in a random day 5 people take bus n1?

Solution: Firstly we should notice that XPoi(λ) and Var(X)=3 Then λ=3. Now we have to compute the probability P(X=5)=e3×355!10 

Question: What is the probability that 5 people take bus n1 in two days?

Solution: Let Xi be the rv that represents the number of people that take bus n1 with i=1,2. Then XiPoi(3) and X1+X2Poi(6) Now we have to compute the probability P(X1+X2=5)=e6×655!16

The probability density function and the cumulative distribution function of an exponential random variable with parameter λ are respectively fX(x)={0ifx<0λeλxifx0FX(x)={0ifx<01eλxifx0

Remark: If X is an exponential random variable with parameter λ we write XExp(λ).

Properties: Let X be an exponential random variable. Then,

  1. Moment Generating Function MX(t)=(1t/λ)1 t<λ.

  2. E(X)=1/λ and Var(X)=1/λ2.

  3. Lack of memory: P(X>x+s|X>x)=P(X>s) for any x0 and s0.

  4. Let XiExp(λi), i=1,2,...,k, be independent random variables, then Y=min{X1,X2,...,Xk}Exp(i=1kλi)

Example: Let X be a random variable that represents the lifetime of an electronic component in years. It is known that X follows an exponential distribution such that P(X>1)=e1/3. Question: Knowing that XExp(λ), what is the value of λ?

Solution: Taking into account that P(X>1)=e1/3andP(X>1)=1FX(1)=eλ then λ=1/3.

Question: What is the probability that the lifetime of the component electronic is grater than 3 years knowing that it is grater than 1 year?

Solution: Given the memoryless property we have that P(X>3|X>1)=P(X>2)=e2/3.

Question: Assume that one has 3 similar electronic components that are independent. What is the probability that the lowest lifetime of these electronic components is lower than 2 years?

Solution: Since we have 3 independent and identical components, than we must have 3 random variables X1,X2,X3 representing respectively the lifetime of the electronic component 1,2,3. The lowest lifetime is the random variable Y=min(X1,X2,X3) According to the properties we have that YExp(3×1/3). Therefore, P(Y<2)=1e2.

Poisson Process:

  • Nt represents the number occurrences in the interval (0,t], where t>0. The collection of random variables {Nt,t>0} is called a Poisson process with intensity λ if

    • the number of occurrences in disjoint intervals are independent random variables;

    • the number of occurrences in intervals of the same size are random variables with the same distribution;

    • NtPoi(λ×t).

Relationship between the Poisson and Exponential distribution: Let

  • Nt be the number occurrences in the interval (0,t], where t>0.

  • Xi be the time spent between the two consecutive occurrences (i1) and i of the event.

If the collection of random variables {Nt,t>0} is a Poisson process, then XiExp(λ).

Example: Assume that Xt represents the number of clients that go to a store in t hours. The average number of clients in two hours is 5. Xt follows a Poisson process.

1 Compute the probability that in 1 hour at least 2 clients go to the store.

Answer: Firstly, we can notice that XtPoisson(λt) and E(Xt)=λt. Additionally, E(Xt)=2λ=5, meaning that λ=5/2. The requested probability is P(X12)=1P(X=0)P(X=1)=1e5/2e5/25/20.7127

2 Compute the probability that 5 clients go to the store in 1 hour and a half knowing that no clients went there in the first 30 minutes.

Answer: The requested probability is P(X1.5=5|X0.5=0)=P(X1.5=5,X0.5=0)P(X0.5=0)

Example: P(X1.5=5|X0.5=0)=P(X1.5=5,X0.5=0)P(X0.5=0)=P(X1.5X0.5=50,X0.5=0)P(X0.5=0)=P(X1.5X0.5=5)P(X0.5=0)P(X0.5=0)=P(X1.5X0.5=5)=P(X1=5)=e5/2(5/2)55!=0.0668

iii Compute the probability that the first client arrives 45 minutes after the opening hour.

Let Y be the rv that represents the time spent until the first client arrives. YExp(5/2) P(Y3/4)=1FY(3/4)=1(1e5/23/4)0.1534.

Question: How to model the time between two or three or more occurrences in a Poisson Process?

Gamma distribution: The gamma cumulative distribution function is defined for x>0, a>0 , b>0, by the integral FX(x)=1baΓ(a)0xua1eubdu where Γ(t)=0euut1du is the Gamma function. The parameters a and b are called the shape parameter and scale parameter, respectively.

The probability density function for the gamma distribution is fX(x)=1baΓ(a)xa1exb

Remarks:

  1. If X is a gamma random variable with parameters a and b we write XGamma(a,b)

  2. if a=1 and 1b=λ, XExp(λ)=Gamma(1,1λ).

  3. Important case: When a=v/2 and b=2 we have the chi-squared distribution which has the notation χ2(v)=Gamma(v/2,2). v is known as degrees of freedom.

Relationship between the Poisson and Gamma distribution: Let

  • Nt be the number occurrences in the interval (0,t], where t>0.

  • Xi be the time spent between the two consecutive occurrences (i1) and i

  • Yi,n be the time spent between the occurrences (in) and i of the event.

If the collection of random variables {Nt,t>0} is a Poisson process, then XiExp(λ)=Gamma(1,1λ)andYi,nGamma(n,1λ).

Properties: Let X be a Gamma distribution with parameters a and b.

  1. The Moment generating function of the Gamma distribution is given by: MX(t)=(1bt)a for t<1/b

  2. E(X)=ab.

  3. Var(X)=ab2.

  4. Let X1, X2,..., Xn be independent random variables with Gamma distribution XiGamma(ai,b), i=1,...,n, then i=1nXiGamma(i=1nai,b).

  5. If nN, then XGamma(n,b), then 2X/bχ2(2n)

In the case of the chi-squared random variables we have:

  1. E(X)=v.

  2. Var(X)=2v.

  3. Let X1, X2,...,Xk be independent random variables with Chi-squared distribution X1χ2(v1) and X22(v2),,Xk2(vk), then i=1kXiχ2(i=1kvi).

Exercise 13: Compute the following probabilities:

  1. If Y is distributed  χ2(4) find P(Y7.78).

  2. If Y is distributed  χ2(10) find P(Y>18.31).

  3. If Y is χ2(1) find P(Y3.8416).

Exercise 14: Using the moment generating function, show that if XGamma(a,b) and Y=2X/b, then Yχ2(2a).

The probability density function of the uniform random variable on an interval (a,b), where a<b, is the function fX(x)={0ifxa1baifa<x<b0ifbx

The cumulative distribution function is the function FX(x)={0ifxaxabaifaxb1ifbx

Remark: If X is a uniform random variable in the interval (a,b) we write XU(a,b).

  1. The moment generating function MX(t)={etbetat(ba)ift01ift=0. (The moment-generating function is not differentiable at zero, but the moments can be calculated by differentiating and then taking t)

  2. Moments about the origin E(Xk)=bk+1ak+1(ba)(k+1),k=1,2,3,...

  3. E(X)=(a+b)/2.

  4. Var(X)=(ba)2/12.

  5. Skewness=γ1=0.

Example: Let X be a continuous uniform random variable in the interval (2,10). Compute the following probabilities:

Questions: Compute the following probabilities:

  • P(X>5)=1FX(5)=152102=58

  • P(X<9|X>5)=P(5<X<9)1FX(5)=FX(9)FX(5)1FX(5)=7/83/85/8=25

  • E(X)=10+22=6Var(X)=(102)212=163

Inverse transform sampling: Important result in simulation.

This result shows us that, in certain conditions, Y=FX(X)U(0,1) and if YU(0,1) then FX1(Y)FX(x).

Example: Assume that X follows an exponential distribution with parameter 1. Find the distribution of Y=FX(X)

The most famous continuous distribution is the normal distribution (introduced by Abraham de Moivre, 1667-1754). The normal probability density function is given by fX(x)=12πe(xμ)22σ2.

The cumulative distribution function does not have a close form solution: FX(x)=x12πe(tμ)22σ2dt

When a random variable X follows a normal distribution with parameters μ and 2 we write XN(μ,σ2).

Properties:

  1. Moment generating function MX(t)=e(μt+0.5σ2t2)

  2. E(X)=μ.

  3. Var(X)=σ2

There is no closed form solution to the CDF of a normal distribution, which means that one has to use an adequate software to compute the probabilities. Alternatively, one may use the tables with probabilities for the normal distribution with mean equal to 0 and variance equal to 1. To use this strategy one has to notice that XN(μ,σ2)XμσN(0,1)

When μ=0 and σ2=1, the distribution is denoted as standard normal distribution.

The probability density function of the standard normal distribution is denoted ϕ(z) and it is given by ϕ(z)=12πez22. The standard normal cumulative distribution function is denoted as Φ(z)=P(Zz)=zϕ(t)dt.

Properties of the standard normal cumulative distribution function:

  • P(Z>z)=1Φ(z).

  • P(Z<z)=P(Z>z).

  • P(|Z|>z)=2[1Φ(z)], for z>0.

Examples: Assume that the weight of a certain population is modeled by a normal distribution with a mean 50 Kg and a standard deviation 5kg.

Question: What is the probability that someone weighs more than 65kg?

Solution: Let X be the random variable that represents the weight of a certain person in the given population. The required probability is P(X>65)=P(Xμσ>65μσ)=P(Z>3)=1Φ(3)=10.9987=0.0013=0.13%, where Z=XμσN(0,1).

Question: What is the weight that is exceeded by 80% of the population?

Solution: We want to find the level W such that P(X>W)=80%. 0.80=P(X>W)=P(Xμσ>Wμσ)=P(Z>W505). Now, taking into account the shape of the normal density function we know that the threshold W505<0. Therefore, noticing that 0.80=P(Z>W505)0.20=P(Z<W505)0.20=P(Z>W505) one may easily check at the tables that W505=0.842W=45.79

Exercise 20: A baker knows that the daily demand for a specific type of bread is a random variable X such that XN(μ=50,σ2=25). Find the demand which has probability 1% of being exceeded.

Theorem: (Linear combinations of Normal random variables): Let X and Y be two independent random variables such that $ XN({X},{X}^{2})$ and YN(μY,σY2). Let V=aX+bY+c, then VN(μV,σV2) where μV=aμX+bμY+cσV2=a2σX2+b2σY2.

Remarks:

  • A special case is obtained when b=0, if V=aX+c, then VN(μV,σV2) where μV=aμX+c, σV2=a2σX2.

  • if XN(μ,σ2), Z=Xμσ

Example: Let X and Y be two independent random variables such that XN(μ=10,σ2=4)andYN(μ=12,σ2=5).

Question: Compute the following probability P(X+Y>19).

Solution: Firstly, we notice that X+YN(22,9). Therefore, P(X+Y223>19223)=P(Z>1)=Φ(1)=0.8413, where Z=X+Y223N(0,1).

Theorem: If the random variable Xi,i=1,...,n have a normal distribution, XiN(μi,σi2), and are independent, then i=1nXiN(i=1nμi,i=1nσi2).

  • Assuming that μi=μX and σi2=σX2, for i=1,...,n we have i=1nXiN(nμX,nσX2).

    Thus X¯=1ni=1nXiN(μX,σX2/n).

    If we standardize we have Z=X¯μXσX/nN(0,1)

We have seen the following result:

If X1,X2,Xni.i.dN(μ,σ2) then the following holds true:

  • i=1nXiN(μn,σ2n)or equivalentlyX¯N(μ,σ2/n)

  • i=1nXiμnσnN(0,1)or equivalentlyX¯μσ/nN(0,1)

However, what happens if the Xis are not normally distributed?

The answer is given by the Central Limit Theorem:

Theorem: (The Central Limit Theorem - Lindberg-Levy)

Assume that Xi, i=1,...,n are independent, E(Xi)=X, and Var(Xi)=σX<+, then the distribution of Z=i=1nXinμXσXn=n(X¯μX)σX converges to a standard normal distribution as n tends to infinity.

We write ZaN(0,1) where the symbol a reads “distributed asymptotically”

Remarks:

  • This means that if the sample size is large enough (n30), then the distribution of Z is close to the standard normal.

  • The previous result is useful when Xi, with i=1,...,n do not follow a normal distribution (in this case we know the exact distribution of Z).

Assume that X represents the profit of a store in thousands of euros in a random day. The density function of X is given by fX(x)={x,0<x<12x,1<x<2 Compute the probability that the store has a profit greater than 29 thousands of euros in a month (30 days).

Solution: We start by noticing that E(X)=01x2dx+122xx2dx=1E(X2)=01x3dx+122x2x3dx=7/6Var(X)=7/61=1/6

Solution: Assume that Xi represents the profit of a store in thousands of euros in day i=1,2,,30, then we want to compute the following probability: P(i=130Xi>29) By using the central limit theorem we know that Z=i=130Xi3030/6aN(0,1) Therefore P(i=130Xi>29)=P(i=130Xi3030/6>293030/6)=P(Z>0.45)Φ(0.45)=0.6736

A special case of the Central Limit Theorem of Lindberg-Levy is the Central Limit Theorem of De Moivre-Laplace, which corresponds to the case that each Xi is Bernoulli with parameter p=P(Xi=1).

Theorem: (The Central Limit Theorem - De Moivre-Laplace) If the Xi, i=1,...,n are independent Bernoulli random variables with p=P(Xi=1)(0,1) then Z=n(X¯p)p(1p) converges to a standard normal distribution as n tends to infinity. We write ZaN(0,1). {.example}

Example: Assume that a person is infected with a virus with probability 0.05. If we analyze 100 people, what is the probability that at least 7 are infected?

Solution: Let Xi be a random variable defined by Xi={1, if person i is infected0, otherwise with i=1,,100. Therefore, Xi is a Bernoulli random variable. Assuming independence between the rv, we have that i=1100XiaN(5,4.75) Therefore, P(i=1100Xi7)=P(i=1100Xi54.75754.75)1Φ(0.92)=10.8212=0.1788

Exercise 21: Assume that Xi, with i=1,2,3 represent the profit, in million of euros, of 3 different companies located in 3 different countries. If X1N(1,0.01),X2N(1.5,0.03),X3N(2,0.06)

  1. Which company is more likely to have a profit greater than 1.5 millions?

  2. What is the probability of the profit of these 3 companies does not exceed 4 millions of euros? (Assume independence.)

Previous