# CS代考程序代写 University of California, Los Angeles Department of Statistics

University of California, Los Angeles Department of Statistics
Statistics 100B Instructor: Nicolas Christou Continuous probability distributions
• Let X be a continuous random variable, −∞ < X < ∞ • f(x) is the so called probability density function (pdf) if 􏰀∞ f(x)dx=1 −∞ • Area under the pdf is equal to 1. • How do we compute probabilities? Let X be a continuous r.v. with pdf f(x). Then P(X > a) = 􏰀 ∞ f(x)dx
a P(Xa)
This is NOT true for discrete r.v.
1

• Cumulative distribution function (cdf): F(x)=P(X≤x)=􏰀x f(x)dx
−∞
• Therefore
f(x) = F(x)′
• Compute probabilities using cdf:
P(a 10.
a. Find P(X > 20).
b. Find the cdf.
c. Use the cdf to compute P (X > 20).
d. Find the 75th percentile of the distribution of X.
e. Compute the probability that among 6 such electronic com- ponents, at least two will survive more than 15 months.
2
x2

• Mean of a continuous r.v. μ=E(X)=􏰀 ∞ xf(x)dx
−∞
• Mean of a function of a continuous r.v.
E[g(X)] = 􏰀 ∞ g(x)f(x)dx −∞
• Variance of continuous r.v.
σ2 =E(X−μ)2 =􏰀 ∞ (x−μ)2f(x)dx
−∞
Or
σ2 = 􏰀 ∞ x2f(x)dx − [E(X)]2
−∞
• Some properties: Let a,b constants and X, Y r.v.
E(X + a) = a + E(X) E(X + Y ) = E(X) + E(Y ) var(X + a) = var(X) var(aX + b) = a2var(X)
If X, Y are independent then
var(X + Y ) = var(X) + var(Y )
3

• Example: Let X be a continuous r.v. with f(x) = ax + bx2, and 0 < x < 1. a. If E(X) = 0.6 find a,b. b. Find var(X). 4 • Uniform probability distribution: A continuous r.v. X follows the uniform probability distribution on the interval a, b if its pdf function is given by f(x)= 1 , a≤x≤b b−a – Find cdf of the uniform distribution. – Find the mean of the uniform distribution. – Find the variance of the uniform distribution. 5 • The gamma distribution The gamma distribution is useful in modeling skewed distribu- tions for variables that are not negative. A random variable X is said to have a gamma distribution with parameters α, β if its probability density function is given by xα−1e−x β f(x)= βαΓ(α), α,β>0,x≥0. E(X) = αβ and σ2 = αβ2.
A brief note on the gamma function:
The quantity Γ(α) is known as the gamma function and it is equal to:
Γ(α) = 􏰀 ∞ xα−1e−xdx. 0
If α = 1, Γ(1) = 􏰇0∞ e−xdx = 1.
With integration by parts we get Γ(α + 1) = αΓ(α) as follows:
Γ(α+1)=􏰀 ∞xαe−xdx= 0
Let,v=xα ⇒dv =αxα−1 dx
du =e−x ⇒u=−e−x dx
Therefore,
􏰀 ∞ α −x −x α ∞ 􏰀 ∞ −x α−1
Γ(α+1)= xe dx=−e x|0 − −e αx dx=α x e dx.
Or, Γ(α + 1) = αΓ(a).
􏰀 ∞ α−1 −x 000
6

Similarly, using integration by parts it can be shown that, Γ(α + 2) = (α + 1)Γ(α + 1) = (α + 1)αΓ(α), and,
Γ(α + 3) = (α + 2)(α + 1)αΓ(α).
Therefore, using this result, when α is an integer we get Γ(α) = (α − 1)!.
Example:
Γ(5) = Γ(4+1) = 4×Γ(4) = 4×Γ(3+1) = 4×3×Γ(3) = 4×3×Γ(2+1) = 4×3×2×Γ(1+1) = 4×3×2××1×Γ(1) = 4!.
Useful result:
Γ(1) = √π. 2
The gamma density for α = 1,2,3,4 and β = 1. Gamma distribution density
Γ(α = 1, β = 1)
Γ(α = 2, β = 1)
Γ(α = 3, β = 1)
Γ(α = 4, β = 1)
02468
x
7
0.0 0.2 0.4
0.6 0.8 1.0
f(x)

• Exponential probability distribution:
Useful for modeling the lifetime of electronic components.
• A continuous r.v. X follows the exponential probability distri- bution with parameter λ > 0 if its pdf function is given by
f(x) = λe−λx, x > 0
Note: From the pdf of the gamma distribution, if we set α = 1
and β = 1 we get f(x) = λe−λx. We see that the exponential λ
distribution is a special case of the gamma distribution.
– Find cdf of the exponential distribution.
– Find the mean of the exponential distribution.
– Find the variance of the exponential distribution.
– Find the median of the exponential distribution.
– Find the pth percentile of the exponential distribution.
8

• Example:
Let X be an exponential random variable with λ = 0.2.
a. Find the mean of X.
b. Find the median of X.
c. Find the variance of X.
d. Find the 80th percentile of this distribution (or find c such
that P(X < c) = 0.80). 9 • Memoryless property of the exponential distribution: Suppose the lifetime of an electronic component follows the expo- nential distribution with parameter λ. The memoryless property states that P(X >s+t|X >t)=P(X >s), s>0,t>0
Example:
Suppose the number of miles a car can run before its battery wears out follows the exponential distribution with mean μ = 10000 miles. If the owner of the car takes a 5000-mile trip what is the probability that he will be able to complete the trip without having to replace the battery of the car?
If the number of miles follow some other distribution with known cumulative distribu- tion function (cdf) give an expression of the probability of completing the trip without having to replace the battery of the car in terms of the cdf.
10

The distribution of a function of a random variables
Suppose we know the pdf of a random variable X. Many times we want to find the proba- bility density function (pdf) of a function of the random variable X. Suppose Y = Xn.
We begin with the cumulative distribution function of Y :
Yn
F (y)=P(Y ≤y)=P(Xn ≤y)=P(X ≤y1 ).
So far we have
FY (y) = FX(yn )
To find the pdf of Y we simply differentiate both sides wrt to y: f (y)=1y1−1×f (y1).
1
YnXn n
where, fX(·) is the pdf of X which is given. Here are some more examples.
Example 1
Suppose X follows the exponential distribution with λ = 1. If Y =
Example 2

X find the pdf of Y .
LetX∼N(0,1). IfY =eX findthepdfofY. Note: Y itissaidtohavealog-normal distribution.
Example 3
Let X be a continuous random variable with pdf f(x) = 2(1−x),0 ≤ x ≤ 1. If Y = 2X −1 find the pdf of Y.
Example 4
Let X be a continuous random variable with pdf f(x) = 3×2,−1 ≤ x ≤ 1. If Y = X2 find 2
the pdf of Y.
11

􏰆 ax+bx2 f(x) = 0
If E(X) = 0.6 find a. P(X<1). 2 b. Var(X). 0 10 and f(x) = 0 for x ≤ 10.
a. FindP(X>20).
b. Find the cumulative distribution function (cdf).
c. Find the 75th percentile of this distribution.
d. What is the probabilty that among 6 such types of devices at least 3 will function for at least 15
hours?
Example 2
Suppose a bus always arrives at a particular stop between 8:00 AM and 8:10 AM. Find the probability that the bus will arrive tomorrow between 8:00 AM and 8:02 AM.
Example 3
A parachutist lands at a random point on a line AB.
a. Find the probability that he is closer to A than to B.
b. Find the probability that his distance to A is more thant 3 times his distance to B.
Example 4
Suppose the length of a phone call in minutes follows the exponential distribution with parameter λ = 0.1. If someone arrives immediately ahead of you at a public telephone booth, find the probability that you will have to wait
a. more than 10 minutes.
b. between 10 and 20 minutes.
Example 5
Let X be an exponential random variable with λ = 0.2. a. Find the mean of X.
b. Find the median of X.
c. Find the variance of X.
d. Find the 80th percentile of this distribution (or find c such that P (X < c) = 0.80). Example 6 The random variable X has probability density function x2 12 Example 7 For some constant c, the random variable X has probability density function 􏰆 cx4 f(x) = 0 Find a. E(X). b. Var(X). Example 8 0 < x < 1 otherwise To be a winner in the following game, you must be succesful in three succesive rounds. The game depends on the value of X, a uniform random variable on (0,1). If X > 0.1, then you are succesful in round 1; if X > 0.2, then you are succesful in round 2; if X > 0.3, then you are succesful in round 3.
a. Find the probability that you are succesful in round 1.
b. Find the conditional probability that you are succesful in round 2 given that you were succesful in round 1.
c. Find the conditional probability that you are succesful in round 3 given that you were succesful in round 2.
d. Find the probability that you are a winner.
Example 9
There are two types of batteries in a bin. The lifetime of type i battery is an exponential random variable with parameter λi, i = 1, 2. The probability that a type i battery is chosen from the bin is pi. If a randomly chosen battery is still operating after t hours of use, what is the probability it willl still be operating after an additional s hours?
Example 10
You bet \$1 on a specified number at a roulette table. A roulette wheel has 38 slots, numbered 0, 00, and 1 through 36. Approximate the probability that
a. In 1000 bets you win more than 28 times. b. In 10000 bets you win more than 270 times.
13

Example 1
Continuous random variables – Some examples Solutions
WearegiventhatthepdfofX isf(x)= 10 forx>10andf(x)=0forx≤10. x2
􏰀∞1010∞ 101
x2dx=− x |20 =0−(−20)= 2.
a. P(X >20)=
b. The cumulative distribution function (cdf) is defined as F(x) = P(X ≤ x).
u2du=− u |10 ⇒F(x)=1− x .
􏰀 p 10 dx = 0.75 ⇒ − 10 |p10 = 0.75 ⇒ 1 − 10 = 0.75 ⇒ p = 40.
d. We first find the probability that a device willfunction for at least 15 hours:
x2dx=− x |15 =0−(−15)= 3.
Now we have n = 6 devices with p = 2. We want to find P(X ≥ 3), where X represents the number of
3
devices that function for at least 15 hours among the 6 selected. Therefore X ∼ b(6, 2 ). The answer 3
is:
􏰈6 􏰄 6 􏰅 2 x 1 6 − x
x (3)(3) .
Thisisauniformdistributionproblemwithf(x)= 1.WewantP(015)=
􏰀∞1010∞ 102
15
P(X≥3)=
Example 2
origin.
a.P(a 10) = 􏰇 ∞ 0.1e−0.1xdx = −e−0.1x|∞ = e−0.1(10) = e−1.
10 10
b. P (< 10 < X > 20) = 􏰇 20 0.1e−0.1xdx = −e−0.1x|20 = −e−0.1(20) + e−0.1(10) = e−1 − e−2.
10
10
14

Example 5
Let X be an exponential random variable with λ = 0.2. a.μ=1=1 ⇒μ=5.
λ 0.2
b. Let m be the median. We want P (X ≤ m) = 0.50. Therefore
P(X ≤ m) = 0.50 ⇒
􏰀 m 0
ln(0.5)
−0.2 = 3.47.
0.1e−0.2xdx = 0.50 ⇒ −e−0.2x|m0 = 0.50 ⇒ m = Or faster way, is to use the cdf function:
F(m) = 1 − e−0.2m = 0.50 ⇒ m = ln(0.5) = 3.47. The median is 3.47, which means P(X ≤ 3.47) = −0.2
ln(0.2)
−0.2 = 8.05.
0.50.
c.μ=1=1 ⇒μ=25.
λ2 0.22
d. Let p be the 80th percentile. We want P (X ≤ p) = 0.80. Therefore
P(X ≤ p) = 0.80 ⇒
P (X ≤ 8.05) = 0.80. Example 6
−0.2
􏰀 p 0
0.1e−0.2xdx = 0.80 ⇒ −e−0.2x|p0 = 0.80 ⇒ p = Or faster way, is to use the cdf function:
F(p) = 1 − e−0.2p = 0.80 ⇒ p = ln(0.2) = 8.05. The 80th percentile is 8.05, which means
First we must find the constants a, and b. Since f (x) is a pdf we know that 􏰇 1 f (x)dx = 1. Therefore
􏰇1(ax+bx2)dx=1⇒[ax2 +bx3]|1 =1⇒3a+2b=6 (1). 0230
0
We also know that E(X) = 􏰇 1 xf(x)dx and that E(X) = 0.6. Therefore 􏰇 1 x(ax + bx2)dx = 0.6 ⇒ 00
[ax3 +bx4]|1 =0.6⇒4a+3b=7.2 (2). Nowsolving(1)and(2)fora,andbwegeta=3.6andb=−2.4. 340
The pdf is f(x) = 3.6x − 2.4×2, 0 < x < 1. 􏰇1231 a. P(X<1)= 2(3.6x−2.4x2)dx=(3.6x −2.4x )|2 =0.35. 20230 b. σ2 =􏰇1x2f(x)dx−μ2 =􏰇1x2(3.6x−2.4x2)dx−(0.6)2 =[3.6x4 −2.4x5]|1−(0.6)2 ⇒σ2 =0.06. 00450 Example 7 Firstwemustfindtheconstantc. 􏰇1cx4dx=1⇒cx5|1 =1⇒c=5. Thepdfisf(x)=5x4,00.3) = 0.7 = 7. P (X >0.2) 0.8 8
d. The probability that you are a winner is the probability that you are a winner in round 1, and winner
in round 2, and winner in round 3. This is equal to the product of the 3 probabilities found in parts
This is a uniform distribution problem with f (x) = 1, 0 < x < 1. a. P(X>0.1)=􏰇1 dx=x|1 =0.9.
0.1 0.1
b. P(X >0.2/X >0.1)= P(X>0.2) =
P (X >0.1)
c. P[X >0.3/(X >0.1∩X >0.2)]=
a,b,c. P(win)= 9 87 = 7 . 10 9 8 10
15

Example 9
WewantP(X>s+t/x>t). Thisisequalto:
P(X >s+t|x>t)= P(X >s+t∩X >t) = P(X > t)
P(X > s+t) = P(X > s+t)p1 +P(X > s+t)p2 ⇒ P(X >t) P(X >t)p1 +P(X >t)p2
Usingtheexponentialcdfwefind: P(X>x)=1−P(X≤x)=1−[1−e−λx]=e−λx P(X > s + t/X > t) = e−λ1(s+t)p1 + e−λ2(s+t)p2 .
e−λ1tp1 + e−λ2tp2
Let X be the number of times you win among the n times you play this game. Then X ∼ b(n, 1 ).
38
a. We want P (X > 28). We will approximate this probability using the normal distribution. We need μ andσ. Theseareequalto: μ=10001 =26.32,andσ2 =10001 (1− 1 )=25.62⇒σ=5.06. Now
Example 10
the desired probability is (we use the continuity correction):
P(X >28)=P(Z > 28.5−26.32)=P(Z >0.43)=1−0.6664=0.3336.
38 38 38
5.06
b. We want P (X > 280). Again we will approximate this probability using the normal distribution. We
needμandσ. Theseareequalto: μ=100001 =263.16,andσ2 =100001 (1− 1 )=256.23⇒σ= 38 38 38
16.01. Now the desired probability is (we use the continuity correction):
P(X >280)=P(Z > 280.5−263.16)=P(Z >1.08)=1−0.8599=0.1401. 16.01
16