Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Guidelines and tips

Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Community

Ask the community

Ask the community for help and clear up your study doubts

University Rankings

Discover the best universities in your country according to Docsity users

Free resources

Our save-the-student-ebooks!

Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors

Probability TheoryMathematical StatisticsApplied StatisticsStatistics

An in-depth exploration of probability distributions, focusing on discrete and continuous examples. Topics covered include probability mass functions, cumulative distribution functions, expected values, variances, moment-generating functions, and the memoryless property. The document also includes examples of uniform, exponential, and normal distributions.

What you will learn

- How is the expected value calculated for a discrete random variable?
- How can the normal distribution be transformed to a standard normal distribution?
- What is the memoryless property, and how does it apply to the exponential distribution?

- What is the difference between a probability mass function and a cumulative distribution function?
- What is the role of moment-generating functions in probability distributions?

Typology: Slides

2021/2022

1 / 28

Download Probability Distributions: Discrete and Continuous Examples and more Slides Calculus in PDF only on Docsity! Chapter 3 Continuous Random Variables 3.1 Introduction Rather than summing probabilities related to discrete random variables, here for continuous random variables, the density curve is integrated to determine probability. Exercise 3.1 (Introduction) Patient’s number of visits, X, and duration of visit, Y . 0 1 2 3 0.25 0.75 1 4 probability = value of function, F(3) = P(Y < 3) = 5/12 x 0 1 2 0.25 0.50 0.75 1 0 1 2 0.25 0.50 0.75 1 density, pmf f(x) probability (distribution): cdf F(x) probability less than 1.5 = sum of probability at specific values P(X < 1.5) = P(X = 0) + P(X = 1) = 0.25 + 0.50 = 0.75 P(X = 2) = 0.25 0 1 2 3 1/3 1/2 2/3 1 4 density, pdf f(y) = y/6, 2 < y < 4 probability less than 3 = area under curve, P(Y < 3) = 5/12 x probability at 3, P(Y = 3) = 0 probability less than 1.5 = value of function F(1.5 ) = P(X < 1.5) = 0.75 _ Figure 3.1: Comparing discrete and continuous distributions 73 74 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) 1. Number of visits, X is a (i) discrete (ii) continuous random variable, and duration of visit, Y is a (i) discrete (ii) continuous random variable. 2. Discrete (a) P (X = 2) = (i) 0 (ii) 0.25 (iii) 0.50 (iv) 0.75 (b) P (X ≤ 1.5) = P (X ≤ 1) = F (1) = 0.25 + 0.50 = 0.75 requires (i) summation (ii) integration and is a value of a (i) probability mass function (ii) cumulative distribution function which is a (i) stepwise (ii) smooth increasing function (c) E(X) = (i) ∑ xf(x) (ii) ∫ xf(x) dx (d) V ar(X) = (i) E(X2) − µ2 (ii) E(Y 2) − µ2 (e) M(t) = (i) E ( etX ) (ii) E ( etY ) (f) Examples of discrete densities (distributions) include (choose one or more) (i) uniform (ii) geometric (iii) hypergeometric (iv) binomial (Bernoulli) (v) Poisson 3. Continuous (a) P (Y = 3) = (i) 0 (ii) 0.25 (iii) 0.50 (iv) 0.75 (b) P (Y ≤ 3) = F (3) = ∫ 3 2 x 6 dx = x2 12 ]x=3 x=2 = 32 12 − 22 12 = 5 12 requires (i) summation (ii) integration and is a value of a (i) probability density function (ii) cumulative distribution func- tion which is a (i) stepwise (ii) smooth increasing function (c) E(Y ) = (i) ∑ yf(y) (ii) ∫ yf(y) dy (d) V ar(Y ) = (i) E(X2) − µ2 (ii) E(Y 2) − µ2 (e) M(t) = (i) E ( etX ) (ii) E ( etY ) (f) Examples of continuous densities (distributions) include (choose one or more) (i) uniform (ii) exponential (iii) normal (Gaussian) (iv) Gamma (v) chi-square (vi) student-t (vii) F Section 2. Definitions (LECTURE NOTES 5) 77 (a) Verify function f(x) satisfies the second property of pdfs,∫ ∞ −∞ f(x) dx = ∫ 4 2 1 6 x dx = x2 12 ]x=4 x=2 = 42 12 − 22 12 = 12 12 = (i) 0 (ii) 0.15 (iii) 0.5 (iv) 1 (b) P (2 < X ≤ 3) = ∫ 3 2 1 6 x dx = x2 12 ]x=3 x=2 = 32 12 − 22 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1 (c) P (X = 3) = P (3− < X ≤ 3) = 32 12 − 32 12 = 0 6= f(3) = 1 6 · 3 = 0.5 (i) True (ii) False So the pdf f(x) = 1 6 x determined at some value of x does not determine probability. (d) P (2 < X ≤ 3) = P (2 < X < 3) = P (2 ≤ X ≤ 3) = P (2 ≤ X < 3) (i) True (ii) False because P (X = 3) = 0 and P (X = 2) = 0 (e) P (0 < X ≤ 3) = ∫ 3 2 1 6 x dx = x2 12 ]x=3 x=2 = 32 12 − 22 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1 Why integrate from 2 to 3 and not 0 to 3? (f) P (X ≤ 3) = ∫ 3 2 1 6 x dx = x2 12 ]x=3 x=2 = 32 12 − 22 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1 (g) Determine cdf (not pdf) F (3). F (3) = P (X ≤ 3) = ∫ 3 2 1 6 x dx = x2 12 ]x=3 x=2 = 32 12 − 22 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1 (h) Determine F (3)− F (2). F (3)−F (2) = P (X ≤ 3)−P (X ≤ 2) = P (2 ≤ X ≤ 3) = ∫ 3 2 1 6 x dx = x2 12 ]x=3 x=2 = 32 12 −22 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1 because everything left of (below) 3 subtract everything left of 2 equals what is between 2 and 3 78 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) (i) The general distribution function (cdf) is F (x) = ∫ x −∞ 0 dt = 0, x ≤ 2,∫ x 2 t 6 dt = t2 12 ]t=x t=2 = x2 12 − 4 12 , 2 < x ≤ 4, 1, x > 4. In other words, F (x) = x2 12 − 4 12 = x2−4 12 on (2, 4]. Both pdf density and cdf distribution are given in the figure above. (i) True (ii) False (j) F (2) = 22 12 − 4 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1. (k) F (3) = 32 12 − 4 12 = (i) 0 (ii) 5 12 (iii) 9 12 (iv) 1. (l) P (2.5 < X < 3.5) = F (3.5)− F (2.5) = ( 3.52 12 − 4 12 ) − ( 2.52 12 − 4 12 ) = (i) 0 (ii) 0.25 (iii) 0.50 (iv) 1. (m) P (X > 3.5) = 1− P (X ≤ 3.5) = 1− F (3.5) = 1− ( 3.52 12 − 4 12 ) = (i) 0.3125 (ii) 0.4425 (iii) 0.7650 (iv) 1. (n) Expected value. The average wait time is µ = E(X) = ∫ ∞ −∞ xf(x) dx = ∫ 4 2 x ( 1 6 x ) dx = ∫ 4 2 x2 6 dx = x3 18 ]4 2 = 43 18 −23 18 = (i) 23 9 (ii) 28 9 (iii) 31 9 (iv) 35 9 . library(MASS) # INSTALL once, RUN once (per session) library MASS mean <- 4^3/18 - 2^3/18; mean; fractions(mean) # turn decimal to fraction [1] 3.111111 [1] 28/9 (o) Expected value of function u = x2. E ( X2 ) = ∫ ∞ −∞ x2f(x) dx = ∫ 4 2 x2 ( 1 6 x ) dx = ∫ 4 2 x3 6 dx = x4 24 ]4 2 = 44 24 −24 24 = (i) 9 (ii) 10 (iii) 11 (iv) 12. (p) Variance, method 1. Variance in wait time is σ2 = V ar(X) = E ( X2 ) − µ2 = 10− ( 28 9 )2 = (i) 23 81 (ii) 26 81 (iii) 31 81 (iv) 35 81 . library(MASS) # INSTALL once, RUN once (per session) library MASS sigma2 <- 10 - (28/9)^2 ; fractions(sigma2) # turn decimal to fraction Section 2. Definitions (LECTURE NOTES 5) 79 [1] 26/81 (q) Variance, method 2. Variance in wait time is σ2 = V ar(X) = E[(X − µ)2] = ∫ ∞ −∞ (x− µ)2f(x) dx = ∫ 4 2 ( x− 28 9 )2( 1 6 x ) dx = ∫ 4 2 ( x3 6 − 56x2 54 + 784x 486 ) dx = x4 24 − 56x3 162 + 784x2 972 ]4 2 = (i) 23 81 (ii) 26 81 (iii) 31 81 (iv) 35 81 . library(MASS) # INSTALL once, RUN once (per session) library MASS sigma2 <- (4^4/24 - 56*4^3/162 + 784*4^2/972) - (2^4/24 - 56*2^3/162 + 784*2^2/972) fractions(sigma2) # turn decimal to fraction [1] 26/81 (r) Standard deviation. Standard deviation in time spent on the call is, σ = √ σ2 = √ 26 81 ≈ (i) 0.57 (ii) 0.61 (iii) 0.67 (iv) 0.73. (s) Moment generating function. M(t) = E[etX ] = ∫ ∞ −∞ etxf(x) dx = ∫ 4 2 etx ( 1 6 x ) dx = 1 6 ∫ 4 2 xetx dx = 1 6 etx ( x t − 1 t2 )]4 x=2 = 1 6 e4t ( 4 t − 1 t2 ) − 1 6 e2t ( 2 t − 1 t2 ) , t 6= 0. (i) True (ii) False use integration by parts for t 6= 0 case: ∫ u dv = uv − ∫ v du where u = x, dv = etxdx. 82 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) (j) Determine π0.01. F (π0.01) = 1 124 (π3 0.01 − 1) = 0.01, and so π0.01 = 3 √ 0.01 · 124 + 1 ≈ (i) 1.31 (ii) 3.17 (iii) 4.17 The π0.01 is that value where 1% of probability is at or below (to the left of) this value. 3. Piecewise pdf. Let random variable X have pdf f(x) = x, 0 < x ≤ 1, 2− x, 1 < x ≤ 2, 0, elsewhere. 0 1 2 0.25 0.50 0.75 1 0 1 2 3 0.25 0.50 0.75 1 probability, cdf F(x) = P(X < x)density, pdf f(x) x x Figure 3.5: f(x) and F(x) (a) Expected value. µ = E(X) = ∫ ∞ −∞ xf(x) dx = ∫ 1 0 x (x) dx+ ∫ 2 1 x (2− x) dx = ∫ 1 0 x2 dx+ ∫ 2 1 ( 2x− x2 ) dx = [ x3 3 ]1 0 + [ 2x2 2 − x3 3 ]2 1 = ( 13 3 − 03 3 ) + ( 22 − 23 3 ) − ( 12 − 13 3 ) = (i) 1 (ii) 2 (iii) 3 (iv) 4. Section 2. Definitions (LECTURE NOTES 5) 83 (b) E (X2). E ( X2 ) = ∫ 1 0 x2 (x) dx+ ∫ 2 1 x2 (2− x) dx = ∫ 1 0 x3 dx+ ∫ 2 1 ( 2x2 − x3 ) dx = [ x4 4 ]1 0 + [ 2x3 3 − x4 4 ]2 1 = ( 14 4 − 04 4 ) + ( 2(2)3 3 − 24 4 ) − ( 2(1)3 3 − 14 4 ) = (i) 4 6 (ii) 5 6 (iii) 6 6 (iv) 7 6 . (c) Variance. σ2 = Var(X) = E ( X2 ) − µ2 = 7 6 − 12 = (i) 1 3 (ii) 1 4 (iii) 1 5 (iv) 1 6 . (d) Standard deviation. σ = √ σ2 = √ 1 6 ≈ (i) 0.27 (ii) 0.31 (iii) 0.41 (iv) 0.53. (e) Median. Since the distribution function is F (x) = 0 x ≤ 0∫ x 0 t dt = t2 2 ]x t=0 = x2 2 , 0 < x ≤ 1,∫ x 1 (2− t) dt+ F (1) = 2t− t2 2 ]x t=1 + 1 2 = 2x− x2 2 − (2(1)− 12 2 ) + 1 2 , 1 < x ≤ 2, 1, x > 2. F (1) = 1 2 , so add 1 2 to F (x) for 1 < x ≤ 2 then median m occurs when F (x) = m2 2 = 1 2 , 0 < x ≤ 1, 2m− m2 2 − 1 = 1 2 , 1 < x ≤ 2, 1, x > 2. so for both 0 < x ≤ 1 and 1 < x ≤ 2, m = (i) 1 (ii) 1.5 (iii) 2 84 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) 3.3 The Uniform and Exponential Distributions Two special probability density functions are discussed: uniform and exponential. The continuous uniform (rectangular) distribution of random variable X has density f(x) = { 1 b−a , a ≤ x ≤ b, 0, elsewhere, where “X is U(a, b)” means “X is uniform over [a,b]”, distribution function, F (x) = 0 x < a, x−a b−a a ≤ x ≤ b, 1 x > b, and its expected value (mean), variance and standard deviation are, µ = E(X) = a+ b 2 , σ2 = V ar(X) = (b− a)2 12 , σ = √ V ar(X), and moment-generating function is M(t) = E [ etX ] = etb − eta t(b− a) , t 6= 0. The continuous exponential random variable X has density f(x) = { λe−λx, x ≥ 0, 0, elsewhere, distribution function, F (x) = { 0 x < 0, 1− e−λx x ≥ 0, and its expected value (mean), variance and standard deviation are, µ = E(X) = 1 λ , σ2 = V (Y ) = 1 λ2 , σ = 1 λ , and moment-generating function is M(t) = E [ etX ] = λ λ− t , t < λ. Notice if θ = 1 λ in the exponential distribution, f(x) = 1 θ e− x θ , F (x) = 1− e− x θ , µ = σ = θ, M(t) = θ 1− tθ . Exercise 3.3 (The Uniform and Exponential Distributions) Section 3. The Uniform and Exponential Distributions (LECTURE NOTES 5) 87 0 1 2 3 4 5 0 1 2 3 4 5 1 2 3 4 1 2 3 4 probability, cdf F(x) = P(X < x)density, pdf f(x) x x Figure 3.7: f(x) and F(x) (a) Find F (x). By substituting u = −3x, then du = −3 dx and so F (x) = ∫ 3e−3x dx = − ∫ e−3x(−3) dx = − ∫ eu du = −eu = (i) −e−3x (ii) e−3x (iii) −3e−3x then F (x) = [ −e−3t ]t=x t=0 = ( −e−3x − (−e−3(0)) ) = (i) e−3x − 1 (ii) e−3x + 1 (iii) 1 − e−3x (b) Chance atomic decay takes at least 2 microseconds, P (X ≥ 2), is P (X ≥ 2) = 1− P (X < 2) = 1− F (2) = 1− ( 1− e−3(2) ) ≈ (i) 0.002 (ii) 0.003 (iii) 0.004 1 - pexp(2,3) # exponential P(X > 2), lambda = 3 [1] 0.002478752 (c) Chance atomic decay is between 1.13 and 1.62 microseconds is P (1.13 < X < 1.62) = F (1.62)− F (1.13) = ( 1− e−(3)(1.62) ) − ( 1− e−(3)(1.13) ) = e−(3)(1.13) − e−(3)(1.62) ≈ (i) 0.014 (ii) 0.026 (iii) 0.034 (iv) 0.054. pexp(1.62,3) - pexp(1.13,3) # exponential P(1.13 < X < 1.62), lambda = 3 [1] 0.02595819 (d) Calculate probability atomic rate between mean and 1 standard deviation 88 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) below mean. Since λ = 3, so µ = σ = 1 3 , so P (µ− σ < X < µ) = P ( 1 3 − 1 3 < X < 1 3 ) = P ( 0 < X < 1 3 ) = F ( 1 3 ) − F (0) = ( 1− e−(3) 1 3 ) − ( 1− e−(3)(0) ) ≈ (i) 0.33 (ii) 0.43 (iii) 0.53 (iv) 0.63. (e) Check if f(x) is a pdf.∫ ∞ 0 3e−3x dx = lim b→∞ ∫ b 0 3e−3x dx = lim b→∞ [ −e−3x ]x=b x=0 = lim b→∞ [ −e−3b − (−ex(0)) ] = 1 or, equivalently, lim b→∞ F (b) = lim b→∞ 1− e−3b = 1 (i) True (ii) False (f) Show F ′(x) = f(x). F ′(x) = d dx F (x) = d dx ( 1− e−3x ) = (i) 3e−3x (ii) e−3x + 1 (iii) 1 − e−3x (g) Determine µ using mgf. Since M(t) = λ λ−t , M ′(t) = d dt ( λ λ− t ) = λ (λ− t)2 , so µ = M ′(0) = (i) λ (ii) 1 (iii) 1 − λ (iv) 1 λ . use quotient rule, since f = u v = λ λ−t , f ′ = vu′−uv′ v2 = (λ−t)(0)−λ(−1) (λ−t)2 = λ (λ−t)2 = 1 λ if t = 0 (h) Memoryless property of exponential. Chance atomic decay lasts at least 10 microseconds is P (X > 10) = 1− F (10) = 1− (1− e−3(10)) = (i) e−10 (ii) e−20 (iii) e−30 (iv) e−40. and chance atomic decay lasts at least 15 microseconds, given it has already lasted at least 5 microseconds is P (X > 15|X > 5) = P (X > 15, Y > 5) P (X > 5) = P (X > 15) P (X > 5) = 1− (1− e−3(15)) 1− (1− e−3(5)) = Section 3. The Uniform and Exponential Distributions (LECTURE NOTES 5) 89 (i) e−10 (ii) e−20 (iii) e−30 (iv) e−40. so, in other words, P (X > 15|X > 5) = P (X > 15) P (X > 5) = P (X > 10 + 5) P (X > 5) = P (X > 10) or P (X > 10 + 5) = P (X > 10) · P (X > 5) This is an example of the “memoryless” property of the exponential, it implies time intervals are independent of one another. Chance of decay after 15 microsecond, given decay after 5 microseconds, same as chance of decay after 10 seconds; it is as though first 5 microseconds “forgotten”. 3. Verifying if experimental decay is exponential. In an atomic decay study, let random variable X be time-to-decay where x ≥ 0. The relative frequency distribution table and histogram for a sample of 20 atomic decays (measured in microseconds) from this study are given below. Does this data follow an exponential distribution? 0.60, 0.07, 0.66, 0.17, 0.06, 0.14, 0.15, 0.19, 0.07, 0.36 0.85, 0.44, 0.71, 1.02, 0.07, 0.21, 0.16, 0.16, 0.01, 0.88 0 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 re la ti v e f re q u e n cy time-to-decay (microseconds), x 1.00.80.60.40 0.2 exponential density curve, pdf, f(x) relative frequency histogram approximates density curve 1.2 Figure 3.8: Histogram of exponential decay times 92 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) f(x) f(x) x 20 year old IQs 16 year old IQs µ = 100 µ = 120 σ = 20 σ = 16 Figure 3.9: Normal distributions: IQ scores (a) Mean IQ score for 20 year olds is µ = (i) 100 (ii) 120 (iii) 124 (iv) 136. (b) Average (or mean) IQ scores for 16 year olds is µ = (i) 100 (ii) 120 (iii) 124 (iv) 136. (c) Standard deviation in IQ scores for 20 year olds σ = (i) 16 (ii) 20 (iii) 24 (iv) 36. (d) Standard deviation in IQ scores for 16 year olds is σ = (i) 16 (ii) 20 (iii) 24 (iv) 36. (e) Normal density for 20 year old IQ scores is (i) broader than normal density for 16 year old IQ scores. (ii) as wide as normal density for 16 year old IQ scores. (iii) narrower than normal density for 16 year old IQ scores. (f) Normal density for the 20 year old IQ scores is (i) shorter than normal density for 16 year old IQ scores. (ii) as tall as normal density for 16 year old IQ scores. (iii) taller than normal density for 16 year old IQ scores. (g) Total area (probability) under normal density for 20’s IQ scores is (i) smaller than area under normal density for 16’s IQ scores. (ii) the same as area under normal density for 16’s IQ scores. (iii) larger than area under normal density for 16’s IQ scores. (h) Number of different normal densities: (i) one (ii) two (iii) three (iv) infinity. 2. Percentages: IQ scores. Densities of IQ scores for 16 year olds, X1, and 20 year olds, X2, are given by f(x1) = 1 16 √ 2π e−(1/2)[(y−100)/16]2 , f(x2) = 1 20 √ 2π e−(1/2)[(y−120)/20]2 . Section 4. The Normal Distribution (LECTURE NOTES 5) 93 f(x) x100 84 (a) N(100,16 )P(X > 84) = ? f(x) f(x) f(x) x100 96 120 (b) (d) P(96 < X < 120) = ? x 12096 N(120,20 ) P(96 < X < 120) = ? (c) x120 84 N(120,20 ) P(X > 84) = ? N(100,16 ) 2 2 2 2 Figure 3.10: Normal probabilities: IQ scores (a) For the sixteen year old normal distribution, where µ = 100 and σ = 16, P (X1 > 84) = ∫ ∞ 84 1 16 √ 2π e−(1/2)[(y−100)/16]2 dx1 ≈ (i) 0.4931 (ii) 0.9641 (iii) 0.8413 (iv) 0.3849. 1 - pnorm(84,100,16) # normal P(X > 84), mean = 100, SD = 16 [1] 0.8413447 (b) For sixteen year old normal distribution, where µ = 100 and σ = 16, P (96 < X1 < 120) ≈ (i) 0.4931 (ii) 0.9641 (iii) 0.8413 (iv) 0.3849. pnorm(120,100,16) - pnorm(96,100,16) # normal P(96 < X < 120), mean = 100, SD = 16 [1] 0.4930566 (c) For twenty year old, where µ = 120 and σ = 20, P (X2 > 84) ≈ (i) 0.4931 (ii) 0.9641 (iii) 0.8413 (iv) 0.3849. 1 - pnorm(84,120,20) # normal P(X > 84), mean = 120, SD = 20 [1] 0.9640697 (d) For twenty year old, where µ = 120 and σ = 20, P (96 < X2 < 120) ≈ (i) 0.4931 (ii) 0.9641 (iii) 0.8413 (iv) 0.3849. pnorm(120,120,20) - pnorm(96,120,20) # normal P(96 < X < 120), mean = 120, SD = 20 [1] 0.3849303 94 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) (e) Empirical Rule (68-95-99.7 rule). If X is N(120, 202), find probability within 1, 2 and 3 SDs of mean. P (µ−σ < X < µ+σ) = P (120− 20 < X < 120 + 20) = P (100 < X < 140) ≈ (i) 0.683 (ii) 0.954 (iii) 0.997 (iv) 1. P (µ− 2σ < X < µ+ 2σ) = P (80 < X < 160) ≈ (i) 0.683 (ii) 0.954 (iii) 0.997 (iv) 1. P (µ− 3σ < X < µ+ 3σ) = P (60 < X < 180) ≈ (i) 0.683 (ii) 0.954 (iii) 0.997 (iv) 1. Empirical rule is true for all X which are N(µ, σ2). pnorm(140,120,20) - pnorm(100,120,20); pnorm(160,120,20) - pnorm(80,120,20); pnorm(180,120,20) - pnorm(60,120,20) [1] 0.6826895 [1] 0.9544997 [1] 0.9973002 3. Standard normal. Normal densities of IQ scores for 16 year olds, X1, and 20 year olds, X2, f(x1) = 1 16 √ 2π e−(1/2)[(y−100)/16]2 , f(x2) = 1 20 √ 2π e−(1/2)[(y−120)/20]2 . Both densities may be transformed to a standard normal with µ = 0 and σ = 1 using the following equation, Z = Y − µ σ . (a) Since µ = 100 and σ = 16, a 16 year old who has an IQ of 132 is z = 132−100 16 = (i) 0 (ii) 1 (iii) 2 (iv) 3 standard deviations above the mean IQ, µ = 100. (b) A 16 year old who has an IQ of 84 is z = 84−100 16 = (i) −2 (ii) −1 (iii) 0 (iv) 1 standard deviations below the mean IQ, µ = 100. (c) Since µ = 120 and σ = 20, a 20 year old who has an IQ of 180 is z = 180−120 20 = (i) 0 (ii) 1 (iii) 2 (iv) 3 standard deviations above the mean IQ, µ = 120. (d) A 20 year old who has an IQ of 100 is z = 100−120 20 = (i) −3 (ii) −2 (iii) −1 (iv) 0 standard deviations below the mean IQ, µ = 120. Section 5. Functions of Continuous Random Variables (LECTURE NOTES 5) 97 qnorm(0.01,120,20) # normal 1st percentile, mean = 120, SD = 20 [1] 73.47304 Or, using Table C.1 “backwards”, F (π0.01) = 0.01 when Z ≈ (i) −2.33 (ii) −2.34 (iii) −2.35 but since X is N(120, 202), 1st percentile π0.01 = X = µ+ σZ ≈ 120 + 20(−2.33) = (i) 73.4 (ii) 74.1 (iii) 75.2 The π0.01 is that value where 1% of probability is at or below (to the left of) this value. 3.5 Functions of Continuous Random Variables Assuming cdf F (x) is strictly increasing (as opposed to just monotonically increasing) on a < x < b, one method to determine the pdf of a function, Y = U(X), of random variable X, requires first determining the cdf of X, F (x), then using F (X) to determine the cdf of Y , F (Y ), and finally differentiating the result, f(y) = F ′(x) = dF du . The second fundamental theorem of calculus is sometimes used in this method, d dy ∫ u2(y) u1(y) fX(x) dx = fX(u2(y)) du2 dy − fX(u1(y)) du1 dy . Related to this is an algorithm for sampling at random values from a random variable X with a desired distribution by using the uniform distribution: • determine cdf of X, F (x), desired distribution • find F−1(y): set F (x) = y, solve for x = F−1(y) • generate values y1, y2, . . . , yn from Y , assumed to be U(0, 1), • use x = F−1(y) to simulate observed x1, x2, . . . , xn, from desired distribution. Exercise 3.5 (Functions of Continuous Random Variables) 98 Chapter 3. Continuous Random Variables (LECTURE NOTES 5) 0 1 2 3 0.25 0.50 0.75 1 4 probability, cdf F(x) = P(X < x) = x - x /4 x 0 1 2 3 0.25 0.50 0.75 1 4 probability, cdf F(y) = P(Y < y) = y/2 - y /16 y = 2x -2 -1 0 1 0.25 0.50 0.75 1 2 y = 2 - 2x 0 1 2 3 0.25 0.50 0.75 1 4 probability, cdf F(y) = P(Y < y) = y - y/4 y = x 1/2 probability, cdf F(y) = P(Y < y) = (4 + 4y + y )/16 2 2 1/2 2 Figure 3.12: Distributions of various functions of Y = U(X) 1. Determine pdf of Y = U(X), given pdf of X. Consider density fX(x) = { 1− x 2 , 0 ≤ x ≤ 2 0 elsewhere (a) Calculate pdf of Y = 2X, version 1. FX(x) = ∫ x 0 ( 1− t 2 ) dt = ( t− t2 4 )t=x t=0 = x− x2 4 , FY (y) = P (Y ≤ y) = P (2X ≤ y) = P ( X ≤ y 2 ) = FX (y 2 ) = y 2 − ( y 2 )2 4 = y 2 − y2 16 , fY (y) = F ′Y (y) = dF dy = (i) 3 2 − 2y 32 (ii) 1 2 − 2y 32 (iii) 1 2 − y 32 (iv) 1 2 − y 8 , where since y = 2x, 0 ≤ x ≤ 2 implies 0 ≤ y 2 ≤ 2, or (i) −1 ≤ y ≤ 2 (ii) −2 ≤ y ≤ 1 (iii) 0 ≤ y ≤ 3 (iv) 0 ≤ y ≤ 4 Section 5. Functions of Continuous Random Variables (LECTURE NOTES 5) 99 (b) Calculate pdf of Y = 2X, version 2. FY (y) = P (Y ≤ y) = P (2X ≤ y) = P ( X ≤ y 2 ) = FX (y 2 ) = ∫ y 2 0 fX(x) dx fY (y) = d dy ∫ y 2 0 fX(x) dx = fX (y 2 ) d dy (y 2 ) − 0 = ( 1− y/2 2 ) · 1 2 = (i) 3 2 − 2y 32 (ii) 1 2 − 2y 32 (iii) 1 2 − y 32 (iv) 1 2 − y 8 , Second fundamental theorem of calculus used here, notice cdf of FX(x) is not explicitly calculated. (c) Calculate pdf for Y = 2− 2X. FY (y) = P (Y ≤ y) = P (2− 2X ≤ y) = P ( X ≥ 2− y 2 ) = ∫ 2 2−y 2 fX(x) dx, fY (y) = d dy ∫ 2 2−y 2 fX(x) dx = 0− fX ( 2− y 2 ) d dy ( 2− y 2 ) = − ( 1− 2−y 2 2 ) · −1 2 = (i) 3 2 − 2y 32 (ii) 1 2 + 2y 32 (iii) 1 2 + y 32 (iv) 1 4 + y 8 , where since y = 2− 2x, 0 ≤ x ≤ 2 implies 0 ≤ 2−y 2 ≤ 2, or (i) −1 ≤ y ≤ 2 (ii) −2 ≤ y ≤ 1 (iii) −1 ≤ y ≤ 1 (iv) −2 ≤ y ≤ 2 (d) Calculate pdf for Y = X2. FY (y) = P (Y ≤ y) = P ( X2 ≤ y ) = P (X ≤ √y) = ∫ √y 0 fX(x) dx, fY (y) = d dy ∫ √y 0 fX(x) dx = fX ( √ y) d dy ( √ y)− 0 = ( 1− √ y 2 ) · 1 2 √ y = (i) 3 2 − 2y 32 (ii) 1 2 √ y − 1 4 (iii) 1√ y − 1 4 (iv) 1 2 √ y + 1 4 , Shorten up number of steps, omitted FX( √ y). where y = x2, 0 ≤ x ≤ 2 implies 0 ≤ √y ≤ 2, or (i) 0 ≤ y ≤ 1 (ii) 0 ≤ y ≤ 2 (iii) 0 ≤ y ≤ 3 (iv) 0 ≤ y ≤ 4 Although there are two roots, ±√y, only the positive root fits in the positive interval 0 ≤ y ≤ 2.