Matakuliah Tahun : D0722 - Statistika dan Aplikasinya : 2010 Peubah Acak Pertemuan 3 Learning Outcomes • Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : 1. menghasilkan sebaran variabel acak diskrit, nilai harapan , sebaran binomial dan poisson 2. memperhitungkan sebaran kontinyu, sebaran seragam dan eksponensial 3 COMPLETE BUSINESS STATISTICS 1-4 5th edi tion Random Variables Using Statistics Expected Values of Discrete Random Variables The Binomial Distribution Other Discrete Probability Distributions Continuous Random Variables Using the Computer Summary and Review of Terms McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-5 BUSINESS STATISTICS Using Statistics Consider the different possible orderings of boy (B) and girl (G) in four sequential births. There are 2*2*2*2=24 = 16 possibilities, so the sample space is: BBBB BBBG BBGB BBGG BGBB BGBG BGGB BGGG GBBB GBBG GBGB GBGG GGBB GGBG GGGB GGGG If girl and boy are each equally likely [P(G)=P(B) = 1/2], and the gender of each child is independent of that of the previous child, then the probability of each of these 16 possibilities is: (1/2)(1/2)(1/2)(1/2) = 1/16. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-6 BUSINESS STATISTICS Random Variables Now count the number of girls in each set of four sequential births: BBBB BBBG BBGB BBGG (0) (1) (1) (2) BGBB BGBG BGGB BGGG (1) (2) (2) (3) GBBB GBBG GBGB GBGG (1) (2) (2) (3) GGBB GGBG GGGB GGGG (2) (3) (3) (4) Notice that: • each possible outcome is assigned a single numeric value, • all outcomes are assigned a numeric value, and • the value assigned varies over the outcomes. The count of the number of girls is a random variable: A random variable, X, is a function that assigns a single, but variable, value to each element of a sample space. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-7 BUSINESS STATISTICS Random Variables (Continued) 0 BBBB BGBB GBBB BBBG BBGB GGBB GBBG BGBG BGGB GBGB BBGG BGGG GBGG GGGB GGBG GGGG 1 X 2 3 4 Sample Space McGraw-Hill/Irwin Aczel/Sounderpandian Points on the Real Line © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-8 BUSINESS STATISTICS Random Variables (Continued) Since the random variable X = 3 when any of the four outcomes BGGG, GBGG, GGBG, or GGGB occurs, P(X = 3) = P(BGGG) + P(GBGG) + P(GGBG) + P(GGGB) = 4/16 The probability distribution of a random variable is a table that lists the possible values of the random variables and their associated probabilities. P(x) 1/16 4/16 6/16 4/16 1/16 16/16=1 P ro b a b ility D is trib u tio n o f th e N u m b e r o f G irls in F o u r B irth s 0 .4 0 .3 7 5 0 0 .3 0 .2 5 0 0 P(x) x 0 1 2 3 4 0 .2 5 0 0 0 .2 0 .1 0 .0 6 2 5 0 0 .0 6 2 5 1 2 3 4 N u m b e r o f g i rls , x McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-9 5th edi tion Discrete and Continuous Random Variables A discrete random variable: has a countable number of possible values has discrete jumps (or gaps) between successive values has measurable probability associated with individual values counts A continuous random variable: has an uncountably infinite number of possible values moves continuously from value to value has no measurable probability associated with each value measures (e.g.: height, weight, speed, value, duration, length) McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 1-10 BUSINESS STATISTICS 5th edi tion Rules of Discrete Probability Distributions The probability distribution of a discrete random variable X must satisfy the following two conditions. 1. P(x) 0 for all values of x. 2. P(x) 1 all x Corollary: 0 P( X ) 1 McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 5th edi tion 1-11 Cumulative Distribution Function The cumulative distribution function, F(x), of a discrete random variable X is: F(x) P( X x) P(i) all i x McGraw-Hill/Irwin P(x) 0.1 0.2 0.3 0.2 0.1 0.1 1 F(x) 0.1 0.3 0.6 0.8 0.9 1.0 Cumulative Probability Distribution of the Number of Switches 1 .0 0 .9 0 .8 0 .7 F(x) x 0 1 2 3 4 5 0 .6 0 .5 0 .4 0 .3 0 .2 0 .1 0 .0 0 1 2 3 4 5 x Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-12 BUSINESS STATISTICS Expected Values of Discrete Random Variables The mean of a probability distribution is a measure of its centrality or location, as is the mean or average of a frequency distribution. It is a weighted average, with the values of the random variable weighted by their probabilities. 0 1 2 3 4 5 2.3 The mean is also known as the expected value (or expectation) of a random variable, because it is the value that is expected to occur, on average. The expected value of a discrete random variable X is equal to the sum of each value of the random variable multiplied by its probability. E ( X ) xP ( x ) all x McGraw-Hill/Irwin Aczel/Sounderpandian x 0 1 2 3 4 5 P(x) 0.1 0.2 0.3 0.2 0.1 0.1 1.0 xP(x) 0.0 0.2 0.6 0.6 0.4 0.5 2.3 = E(X) = © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 5th edi tion 1-13 Variance and Standard Deviation of a Random Variable The variance of a random variable is the expected squared deviation from the mean: 2 V ( X ) E [( X ) 2 ] (x ) 2 P(x) a ll x E ( X 2 ) [ E ( X )] 2 x 2 P ( x ) xP ( x ) a ll x a ll x 2 The standard deviation of a random variable is the square root of its variance: SD( X ) V ( X ) McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-14 5th edi tion Bernoulli Random Variable • If an experiment consists of a single trial and the outcome of the trial can only be either a success* or a failure, then the trial is called a Bernoulli trial. • The number of success X in one Bernoulli trial, which can be 1 or 0, is a Bernoulli random variable. • Note: If p is the probability of success in a Bernoulli experiment, the E(X) = p and V(X) = p(1 – p). * The terms success and failure are simply statistical terms, and do not have positive or negative implications. In a production setting, finding a defective product may be termed a “success,” although it is not a positive result. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-15 5th edi tion The Binomial Random Variable Consider a Bernoulli Process in which we have a sequence of n identical trials satisfying the following conditions: 1. Each trial has two possible outcomes, called success *and failure. The two outcomes are mutually exclusive and exhaustive. 2. The probability of success, denoted by p, remains constant from trial to trial. The probability of failure is denoted by q, where q = 1-p. 3. The n trials are independent. That is, the outcome of any trial does not affect the outcomes of the other trials. A random variable, X, that counts the number of successes in n Bernoulli trials, where p is the probability of success* in any given trial, is said to follow the binomial probability distribution with parameters n (number of trials) and p (probability of success). We call X the binomial random variable. * The terms success and failure are simply statistical terms, and do not have positive or negative implications. In a production setting, finding a defective product may be termed a “success,” although it is not a positive result. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-16 BUSINESS STATISTICS The Binomial Probability Distribution The binomial probability distribution: n! n x ( n x ) P( x) p q p x q ( n x) x!( n x)! x where : p is the probability of success in a single trial, q = 1-p, n is the number of trials, and x is the number of successes. N u m b er o f su ccesses, x 0 1 2 3 n P ro b ab ility P (x ) n! p 0 q (n 0) 0 !( n 0 ) ! n! p 1 q ( n 1) 1 !( n 1 ) ! n! p 2 q (n 2) 2 !( n 2 ) ! n! p 3 q (n 3) 3 !( n 3 ) ! n! p n q (n n) n !( n n ) ! 1 .0 0 McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-17 BUSINESS STATISTICS Mean, Variance, and Standard Deviation of the Binomial Distribution Mean of a binomial distribution: E ( X ) np For example, if H counts the number of heads in five tosses of a fair coin : Variance of a binomial distribution: E ( H ) (5)(.5) 2.5 H V ( X ) npq 2 V ( H ) (5)(.5)(.5) 1.25 2 H Standard deviation of a binomial distribution: = SD(X) = npq McGraw-Hill/Irwin Aczel/Sounderpandian SD( H ) 1.25 1.118 H © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-18 5th edi tion The Poisson Distribution The Poisson probability distribution is useful for determining the probability of a number of occurrences over a given period of time or within a given area or volume. That is, the Poisson random variable counts occurrences over a continuous interval of time or space. It can also be used to calculate approximate binomial probabilities when the probability of success is small (p0.05) and the number of trials is large (n20). Poisson D istribution: xe P( x) for x = 1,2,3,... x! where is the mean of the distribution (which also happens to be the variance) and e is the base of natural logarithms (e=2.71828...). McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-19 5th edi tion The Poisson Distribution (continued) • Poisson assumptions: The probability that an event will occur in a short interval of time or space is proportional to the size of the interval. In a very small interval, the probability that two events will occur is close to zero. The probability that any number of events will occur in a given interval is independent of where the interval begins. The probability of any number of events occurring over a given interval is independent of the number of events that occurred prior to the interval. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-20 5th edi tion The Poisson Distribution - Example Example 3-5: Telephone manufacturers now offer 1000 different choices for a telephone (as combinations of color, type, options, portability, etc.). A company is opening a large regional office, and each of its 200 managers is allowed to order his or her own choice of a telephone. Assuming independence of choices and that each of the 1000 choices is equally likely, what is the probability that a particular choice will be made by none, one, two, or three of the managers? .2 0 e .2 P ( 0) = 0.8187 0 ! .21 e .2 P (1) = 0.1637 12 ! .2 .2 e P (2) = 0.0164 2 ! .2 3 e .2 P ( 3) = 0.0011 3! n = 200 = np = (200)(0.001) = 0.2 p = 1/1000 = 0.001 McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-21 BUSINESS STATISTICS Discrete and Continuous Random Variables - Revisited • A continuous random variable: – – – – – counts occurrences has a countable number of possible values has discrete jumps between successive values has measurable probability associated with individual values probability is height For example: Binomial n=3 p=.5 Binomial: n=3 p=.5 0.4 P(x) 0.125 0.375 0.375 0.125 1.000 McGraw-Hill/Irwin P(x) 0.3 x 0 1 2 3 0.2 0.1 0.0 0 1 2 3 C1 Aczel/Sounderpandian – – – – – measures (e.g.: height, weight, speed, value, duration, length) has an uncountably infinite number of possible values moves continuously from value to value has no measurable probability associated with individual values probability is area For example: In this case, the shaded area epresents the probability that the task takes between 2 and 3 minutes. Minutes to Complete Task 0.3 0.2 P(x) • A discrete random variable: 0.1 0.0 1 2 3 4 5 6 Minutes © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-22 BUSINESS STATISTICS From a Discrete to a Continuous Distribution The time it takes to complete a task can be subdivided into: Half-Minute Intervals Eighth-Minute Intervals Quarter-Minute Intervals Minutes to Complete Task: Fourths of a Minute Minutes to Complete Task: By Half-Minutes Minutes to Complete Task: Eighths of aMinute 0.15 P(x) P(x) P(x) 0.10 0.05 0.00 0.0 . 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 0 Minutes 1 2 3 4 5 Minutes 6 7 0 1 2 3 4 5 6 7 Minutes Or even infinitesimally small intervals: f(z) Minutes to Complete Task: Probability Density Function 0 1 2 3 4 5 6 When a continuous random variable has been subdivided into infinitesimally small intervals, a measurable probability can only be associated with an interval of values, and the probability is given by the area beneath the probability density function corresponding to that interval. In this example, the shaded area represents P(2 X ). 7 Minutes McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE BUSINESS STATISTICS 1-23 5th edi tion Continuous Random Variables A continuous random variable is a random variable that can take on any value in an interval of numbers. The probabilities associated with a continuous random variable X are determined by the probability density function of the random variable. The function, denoted f(x), has the following properties. 1. 2. 3. f(x) 0 for all x. The probability that X will be between two numbers a and b is equal to the area under f(x) between a and b. The total area under the curve of f(x) is equal to 1.00. The cumulative distribution function of a continuous random variable: F(x) = P(X x) =Area under f(x) between the smallest possible value of X (often -) and the point x. McGraw-Hill/Irwin Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-24 BUSINESS STATISTICS Probability Density Function and Cumulative Distribution Function F(x) 1 F(b) } F(a) P(a X b)=F(b) - F(a) 0 a x b f(x) P(a X b) = Area under f(x) between a and b = F(b) - F(a) 0 McGraw-Hill/Irwin a b Aczel/Sounderpandian x © The McGraw-Hill Companies, Inc., 2002 COMPLETE 1-25 BUSINESS STATISTICS 5th edi tion 3-10 Uniform Distribution The uniform [a,b] density: 1/(a – b) for a X b f(x)= { 0 otherwise E(X) = (a + b)/2; V(X) = (b – a)2/12 Uniform [a, b] Distribution f(x) The entire area under f(x) = 1/(b – a) * (b – a) = 1.00 The area under f(x) from a1 to b1 = P(a1X b1) = (b1 – a1)/(b – a) a a1 McGraw-Hill/Irwin b1 b x Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 COMPLETE 5th edi tion 1-26 BUSINESS STATISTICS Exponential Distribution E xp onential D is tributio n: = 2 The exponential random variable measures the time between two occurrences that have a Poisson distribution. 2 Exponential distribution: f(x) The density function is: f (x) ex for x 0, 0 1 1 The mean and standard deviation are both equal to . 0 The cumulative distribution function is: 0 F(x) 1 ex for x 0. McGraw-Hill/Irwin 1 2 3 Time Aczel/Sounderpandian © The McGraw-Hill Companies, Inc., 2002 RINGKASAN Variabel Acak diskrit: - Nilai harapan variabel acak diskrit - Variabel acak Binomial - Variabel acak Poisson Variabel acak kontinyu: - Sebaran seragam - Sebaran eksponensial 27