5.2 Continuous Random Variable Recall Discrete Distribution • For a discrete distribution, for example Binomial distribution with n=5, and p=0.4, the probability distribution is x 0 1 2 3 4 5 f(x) 0.07776 0.2592 0.3456 0.2304 0.0768 0.01024 A probability histogram 0.3 0.2 P(x) 0.1 0.0 0 1 2 3 x 4 5 How to describe the distribution of a continuous random variable? • For continuous random variable, we also represent probabilities by areas—not by areas of rectangles, but by areas under continuous curves. • For continuous random variables, the place of histograms will be taken by continuous curves. • Imagine a histogram with narrower and narrower classes. Then we can get a curve by joining the top of the rectangles. This continuous curve is called a probability density (or probability distribution). Continuous distributions: Density Function • For any x, P(X=x)=0. (For a continuous distribution, the area under a point is 0.) • Can’t use P(X=x) to describe the probability distribution of X • Instead, consider P(a≤X≤b) Density Function • A probability density function for a continuous random variable X is a nonnegative function f(x) with f ( x)dx 1 • And such that for all a≤b, one is willing to assign P[a≤X≤b] according to b P[a X b] f ( x)dx a Density function 0.20 0.15 0.00 • P(a≤X≤b) is the area between a and b 0.05 0.10 y • The area under the curve is 1 0.25 • A curve f(x): f(x) ≥ 0 0 2 4 6 x 8 10 0.00 0.05 0.10 y 0.15 0.20 0.25 P(2≤X≤4)= P(2≤X<4)= P(2<X<4) 0 2 4 6 x 8 10 Cumulative Probability function • For X continuous with probability density f(x) x F ( x) P[ X x] f (t )dt • We can get the density function f(x) from F(x) by differentiation d F ( x) f ( x) dx x f ( x) e , x 0 x F ( x) e dt 1 e t x 0 conversely d x x f ( x) (1 e ) e dx The normal distribution • A normal curve: Bell shaped • Density is given by 2 1 (x ) f ( x) exp 2 2 2 • μand σ2 are two parameters: mean and variance of a normal population (σ is the standard deviation) 0.06 0.04 0.02 0.00 fx 0.08 0.10 0.12 The normal—Bell shaped curve: μ=100, σ2=10 90 95 100 x 105 110 0.2 0.1 0.0 fx1 0.3 0.4 Normal curves: (μ=0, σ2=1) and (μ=5, σ 2=1) -2 0 2 4 x 6 8 Normal curves: 0.2 0.1 0.0 y 0.3 0.4 (μ=0, σ2=1) and (μ=0, σ2=2) -3 -2 -1 0 x 1 2 3 Normal curves: 0.0 0.2 0.4 fx1 0.6 0.8 1.0 (μ=0, σ2=1) and (μ=2, σ2=0.25) -2 0 2 4 6 8 0.2 0.1 0.0 y 0.3 0.4 The standard normal curve: μ=0, and σ2=1 -3 -2 -1 0 x 1 2 3 Table B.3 gives probabilities for standard normal (Numerical Integration – No formula for From Table B.3 = 0.9332 If , then Example: Example (p323 #7) • In a grinding operation, there is an upper specification of 3.15 in. on a dimension of a certain part after grinding. Suppose that the standard deviation of this normally distributed dimension for parts of this type ground to any particular mean dimension μ is σ=.002 in. Suppose further that you desire to have no more than 3% of the parts fail to meet specifications. What is the maximum μ (minimum machining cost) that can be used if this 3% requirement is to be met? 200 200 y2 50 100 150 150 0 y 100 50 0 3.140 3.142 3.144 3.146 x 3.148 3.150 3.152 3.142 3.144 3.146 3.148 x2 3.150 3.152 3.15 200 150 100 50 y P( X 3.15) 0.03 0 So 3.15 is 1.88 σ above the mean. 3.15-1.88*0.002=3.146 3.140 3.142 3.144 3.146 3.148 3.150 3.152 0.4 x 0.1 0.2 P( Z 1.88) 0.03 0.0 fz 0.3 P( Z _____) 0.03 -3 -2 -1 0 z 1 2 3 Exponential distribution • The exponential distribution is a continuous probability distribution with f ( x) 1 e x / ,x 0 • Exponential distributions are often used to describe waiting times until occurrence of events. Density curves 1 x/2 f ( x) e , x 0 2 x 1.0 0.0 0.6 0.4 0.0 0.2 0.2 0.4 y dexp(x, 0.5) 0.6 0.8 0.8 1.0 f ( x) e , x 0 0 1 2 3 x alpha=1 4 5 0 1 2 3 x alpha=2 4 5 Mean and Variance • Mean of an exponential distribution is 1 0 E( X ) x e x / dx • Variance of the exponential distribution is Var ( X ) ( x ) 2 0 2 1 e x / dx 2 Cumulative Probability Function 0.8 0.6 0.2 0.4 pexp(x, 0.5) 0.6 0.4 0.2 0.0 0.0 pexp(x, 1) 0.8 1.0 1.0 F ( x) 1 e x / 0 1 2 3 x alpha=1 4 5 0 1 2 3 x alpha=2 4 5 2 P( X 2) F (2) 1 e 0.8647 P(X<2) on density curve f(x) When alpha=1 0.0 0.6 0.4 0.0 0.2 0.2 0.4 y pexp(x, 1) 0.6 0.8 0.8 1.0 1.0 P(X<2) on CDF F(x) 0 1 2 3 x 4 5 0 1 2 3 x alpha=1 4 5 Relationship between Exponential Distribution and Poisson Ships arrive 2/ hour. The number of ships arriving in 1 hour is a Poisson random variable with λ=2 Let’s define a new random variable X to be the waiting time until the first ship. P(X≥x)=P(0 ships by time x) F(x)=P(X≤x) =1-P(0 ships by time x) An exponential distribution with mean f ( x) has 1 e x / As above with Memoryless property: If we have already waited H hours and haven’t seen a ship, our expected waiting time is . Our expected waiting time is like starting all over again. The probability of a ship showing up in the next 5 minutes is the same as when we started. Force of Mortality Function • The force of Mortality Function is (p.760): h(t ) f (t ) f (t ) P(T t ) 1 F (t ) • H(t)dt is the probability of dying in time t to t+dt if we are still living in t. • For exponential distribution 1 e x / f (t ) f (t ) 1 h(t ) x / P(T t ) 1 F (t ) 1 (1 e ) • So the exponential distribution has a constant force-of-mortality. • If the lifetime of an engineering component is described using a constant force of mortality, there is no (mathematical) reason to replace such a component before it fails. • The distribution of its remaining life from any point in time is the same as the distribution of the time till failure of a new component of the same type. The geometric distribution is also memoryless. X = time to success. The expected tosses to next head doesn’t depend on how long we have been tossing without getting a head. Lifetimes of glasses in a restaurant might be exponential. Motor lifetimes or people’s lifetimes are not. Sometimes lifetimes can be modeled with a lognormal distribution where Section 5.2.3 Weibull Distribution Very commonly lifetimes of motors, etc. are modeled with Weibull distributions. A Weibull distribution is a generalization of an exponential distribution and provides more flexibility in terms of distributional shape. For Weibull distribution F ( x) 1 e ( x / ) d 1 ( x / ) f ( x) F ( x) x e dx 1 E ( X ) (1 ) Gamma function For the force-of-mortality is a decreasing function, for example, a product break in a period. Constant force-of-mortality. Exponential distribution Increasing force-of-mortality, for example, a product that wears out. • For component with increasing force-ofmortality (IFM) distribution, such components are retired from service once they reach a particular age, even if they have not failed. Exercise The lifetime of a certain type of battery has an exponential distribution with average lifetime 100 hours. 5 batteries are installed at the same time and suppose that the operations of the batteries are independent. Find the probability that only 2 batteries are still working after 50 hours.