McGRAW - HILL
INTERNATIONAL
EDITION
TABLE A.2 Cumulative normal distribution (z table)
~ z
0
z
0.00
0.01
0.02
...
1152 downloads
3638 Views
67MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
McGRAW - HILL
INTERNATIONAL
EDITION
TABLE A.2 Cumulative normal distribution (z table)
~ z
0
z
0.00
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
-3.6 -3.5
.0002 .0002
.0002 .0002
.0001 .0002
.0001 .0002
.0001 .0002
.0001 .0002
.0001 .0002
.0001 .0002
.0001 .0002
.0001 .0002
-3.4 -3.3 -3.2 -3.1 -3.0
.0003 .0005 .0007 .0010 .0013
.0003 .0005 .0007 .0009 .0013
.0003 .0005 .0006 .0009 .0013
.0003 .0004 .0006 .0009 .0012
.0003 .0004 .0006 .0008 .0012
.0003 .0004 .0006 .0008 .0011
.0003 .0004 .0006 .0008 .001 1
.0003 .0004 .0005 .0008 .0011
.0003 .0004 .0005 .0007 .0010
.0002 .0003 .0005 .0007 .0010
-2.9 -2.8 -2.7 -2.6 -2.5
.00 19 .0026 .0035 .0047 .0062
.00 18 .0025 .0034 .0045 .0060
.0018 .0024 .0033 .0044 .0059
.0017 .0023 .0032 .0043 .0057
.0016 .0023 .0031 .0041 .0055
.0016 .0022 .0030 .0040 .0054
.00 15 .0021 .0029 .0039 .0052
.00 15 .0021 .0028 .0038 .0051
.0014 .0020 .0027 .0037 .0049
.00 14 .0019 .0026 .0036 .0048
-2.4 -2.3 -2.2 -2.1 -2.0
.0082 .0107 .0139 .0179 .0228
.0080 .0104 .0 136 .0174 .0222
.0078 .0102 .0132 .0170 .0217
.0075 .0099 .0129 .0166 .0212
.0073 .0096 .0125 .0162 .0207
.0071 .0094 .0122 .0158 .0202
.0069 .0091 .01 19 .0154 .0 197
.0068 .0089 .0 116 .0150 .0192
.0066 .0087 .0113 .0146 .01 88
.0064 .0084 .0110 .0143 .0183
-1.9 -1.8 -1.7 -1.6 -1.5
.0287 .0359 .0446 .0548 .0668
.0281 .035 1 .0436 .0537 .0655
.0274 .0344 .0427 .0526 .0643
.0268 .0336 .0418 .0516 .0630
.0262 .0329 .0409 .0505 .0618
.0256 .0322 .0401 .0495 .0606
.0250 .03 14 .0392 .0485 .0594
.0244 .0307 .0384 .0475 .0582
.0239 .0301 .0375 .0465 .0571
.0233 .0294 .0367 .0455 .0559
-1.4 -1.3 -1.2 -1.1 -1.0
.0808 .0968 .115 1 .1357 .1587
.0793 .0951 .1131 .1335 .1562
.0778 .0934 .1112 .1314 .1539
.0764 .0918 .1093 .1292 .15 15
.0749 .0901 .1075 .1271 .149Z
.0735 .0885 .1056 .1251 .1469
.0721 .0869 .1038 .1230 .1446
.Q708 .0853 .1020 .12 10 .1423
.0694 .0838 .1003 .1190 .1401
.0681 .0823 .0985 .1170 .1379
- 0.9 -o.8 -o.7 -o.6 -o.5
.1841 .2119 .2420 .2743 .3085
.1 814 .2090 .2389 .2709 .3050
.1788 .2061 .2358 .2676 .3015
.1762 .2033 .2327 .2643 .2981
.1736 .2005 .2296 .2611 .2946
.1711 .1977 .2266 .2578 .29 12
.1685 .1 949 .2236 .2546 .2877
.1660 .1922 .2206 .25 14 .2843
. 1635 .1 894 .2177 .2483 .2810
.1611 .1867 .2148 .245 1 .2776
- 0.4 -0.3 -o.2 -o.1 -o.o
.3446 .3821 .4207 .4602 .5000
.3409 .3783 .4168 .4562 .4960
.3372 .3745 .4129 .4522 .4920
.3336 .3707 .4090 .4483 .4880
.3300 .3669 .4052 .4443 .4840
.3264 .3632 .4013 .4404 .4801
.3228 .3594 .3974 .4364 .4761
.3 192 .3557 .3936 .4325 .4721
.3156 .3520 .3897 .4286 .4681
.3121 .3483 .3859 .4247 .4641
Principles of Statistics for Engineers and Scientists William Navidi
g
Higher Education
Boston Burr Ridge, IL Dubuque, lA New York San Francisco St. Louis Bangkok Bogota Caracas Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal New Delhi Santiago Seoul Singapore Sydney Taipei Toronto
The McGraw·Hi/1 Companies
H Higher Education PRINC IPLES OF STATISTICS FOR ENGINEERS AN D SCiENTISTS
Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 122 1 Avenue of the Americas, New York, NY 10020. Copyright © 2010 by The McGraw-Hill Companies, I nc. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network or other electronic storage or transmission, or broadcast for distance learning. Some ancillaries, including electronic and print components, may not be available to customers outside the United Stales. This book is printed on acid-free paper.
1234 567R90 DOGDOC09 ISBN 97R-O--D7- 016697-4 MHID 0-07-0 16697-8
www.mhhc.com
To Catherine, Sarah, and Thomas
ABOUT THE AUTHOR William Navidi is Professor of Mathematical and Computer Sciences at the Colorado School of Mines. He received the B.A. degree in mathematics from New College, the M.A. in mathematics from Michigan State University, and the Ph.D. in statistics from the University of California at Berkeley. Professor Navidi has authored more than 50 research papers both in statistical theory and in a wide vari ety of applications includi ng computer networks, epidemiology, molecular biology, chemical eng ineering, and geophysics.
iv
CONTENTS Preface
vii
Chapter 1
Summarizing Univariate Data Introduction
1
1
3
1.1
Sampling
1.2
Summary Statistics
1.3
Graphical Summaries
11
4.4
The Lognormal Distribution
4.5
The Exponential Distribution
4.6
Some Other Continuous Distributions 151
4.7
Probability Plots
4.8
The Central Limit Theorem
157 161
Point and Interval Estimation for a Single Sample 172
Summarizing Bivariate Data 37 Introduction
Introduction
37
2.1
The Correlation Coefficient
2.2
The Least-Squares Line
2.3
Features and Limitations of the Least-Squares Line 56
37
66
66 Basic Ideas 66
Point Estimation
5.2
Large-Sample Confidence Intervals for a Population Mean 176
5.3
Confidence Intervals for Proportions 189
5.4
Small-Sample Confidence Intervals for a Population Mean 195
5.5
Prediction Intervals and Tolerance Intervals 204
Introduction
173
Chapter 6
3.2
Conditional Probability and Independence 74
3.3
Random Variables
3.4
Functions of Random Variables
Hypothesis Tests for a Single Sample Introduction
84
Chapter 4
Commonly Used Distributions Introduction
172
5.1
49
Chapter 3
3.1
147
Chapter 5
20
Chapter 2
Probability
143
104
4.1
The Binomial Distribution
4.2
The Poisson Distribution
127
4.3
The Normal Distribution
134
119
212
6.1
Large-Sample Tests for a Population Mean 212
6.2
Drawing Conclusions from the Results of Hypothesis Tests 221
6.3 6.4
Tests for a Population Proportion
119
119
212
6.5 6.6
229
Small-Sample Tests for a Population Mean 233 The Chi-Square Test
239
Fixed-Level Testing
248 v
.. vi
Contents
6. 7
Power
253
6.8
Multiple Tests
262
C'l1pter Inferences for Two Samples Introduction 7.1
268
Large-Sample Inferences on the Difference Between Two Population Means 268
7.3
Small-Sample Inferences on the Difference Between Two Means The FTest for Equality of Variance 303
284
294
Inference in Linear Models 312 8.1
Inferences Using the Least-Squares Coefficients 313
8.2
Checking Assumptions
8.3
Multiple Regression
8.4
Model Selection
Introduction
421
2P Factorial Experiments
448
477
477 477
10.2 Control Charts for Variables
480
10.3 Control Charts for Attributes
499
10.4 The CUSUM Chart 10.5 Process Capability
504 507
514
Appendix B: Bibliography
537
Answers to Selected Exercises 540
312
Ch'1 lter 3 Factorial Experiments
9.5
Appendix A: Tables
Ch pter 8 Introduction
Randorillzed Complete Block Designs 441
10.1 Basic Ideas
Inferences on the Difference Between Two Proportions 276
7.5
9.4
Introduction
7.2
Inferences Using Paired Data
Two-Factor Experiments
Chapter 10 Statistical Quality Control
268
7.4
9.3
335
345
362
396
396
9.1
One-Factor Experiments
396
9.2
Pairwise Comparisons in One-Factor Experiments 415
Index 574
PREFACE MOTIVATION This book is based on the author's more comprehensive text Statistics for Engineers and Scientists, 2nd edition (McGraw-Hill, 2008), which is used for both one- and twosemester courses. The key concepts from that book fmm the basis for this text, wh ich is designed for a one-semester course. The emphasis is on statistical methods and how they can be applied to problems in science and engineering, rather than on theory. While the fundamental principles of statistics are common to all disciplines, students in science and engineering learn best from examples that presen t important ideas in realistic settings. Accordingly, the book contains many examples that feature real, contemporary data sets, both to motivate students and to show connections to industry and scientific research. As the text emphasizes applications rather than theory, the mathematical level is appropriately modesL. Most of the book will be mathematicall y accessible to those whose background incl udes one semester of calculus.
COMPUTER USE Over the past 30 years, the development of fas t and cheap computing has revolutionized statistical practice; indeed, this is one of the main reasons that statistical methods have been penetrating ever more deeply into scientific work. Scientists and engineers today must not only be adept with computer software packages; they must also have the skill to draw conclusions from computer output and to state those conclusions in words. Accordingly, the book contains exercises and examples that involve interpreting, as well as generating, computer output, especially in the chapters on linear models and factorial ex periments. Many instructors integrate the use of statistical software into their courses; this book may be used effecti vely with any package.
CONTENT Chapter I covers sampling and descriptive statistics. The reason that statistical methods work is that samples, when properly drawn, are likely to resemble their populations. Therefore Chapter 1 begins by describing some ways to draw valid samples. The second part of the chapter discusses descri ptive statistics for uni variate data. Chapter 2 presents desc1ipti ve statistics for bivariate data. The conelation coefficient and least-squares line are discussed. The discussion emphasizes that linear models are appropriate onl y when the relationship between the variables is linear, and it describes the effects of outliers and influential points. Placing this chapter early enables instructors to presenl some coverage of these topics in courses where there is not enough time for a full treatment from an inferential point of view. Alternatively, this chapter may be postponed and covered just before the inferential procedures for linear models in Chapter 8. vii
viii
Preface
Chapter 3 is about probability. The goal here is to present the essential ideas witho ut a lot of mathematical derivations. I have attempted to illustrate each result with an example or two, in a scientific context where possible, to present the intuition behind the result. Chapter 4 presents many of the probability distribution functions commonly used in practice. Probability plots and the Central Limit Theorem are also covered. Only the normal and binomial dist.ribution are used extensively in the remainder of the text, instructors may choose which of the other distributions to cover. Chapters 5 and 6 cover one-sample methods for confidence intervals and hypothesis testing, respectively. Point estimation is covered as well , in Chapter 5. The ?-value approach to hypothesis testing is emphasized, but fi xed-level testing and power calculations are also covered. A discussion of the multiple testing problem is also presented. Chapter 7 presents two-sample methods for confidence intervals and hypothesis testing. There is often not enough time to cover as many of these methods as one would like; instructors who are pressed for time may choose wh ich of the methods they wish to cover. Chapter 8 covers inferential methods in linear regression. In practice, scatterplots often exhibit curvature or contain influential points. Therefore this chapter includes material on checking model assumptions and transforming variables. In the coverage of multi ple regression, model selection methods are given particular emphasis, because choosi ng the variables to include in a model is an essential step in many reallife analyses. Chapter 9 di scusses some commonly used experimental designs and the methods by which their data arc analyzed. One-way and two-way analysis of vruiance methods, along with randomized complete block designs and 2P factorial designs, are covered fairl y extensively. Chapter 10 presents the topic of statistical quality control, covering control charts, CUSUM charts, and process capability, and concluding with a brief discussion of sixsigma quality.
RECOMMENDED COVERAGE The book contains enough material for a one-semester course meeting four hours per week. For a th ree-hour course, it will probabl y be necessary to make some choices about coverage. One option is to cover the first three chapters, goi ng lightly over the last two sections of Chapter 3, then cover the binomial, Poisson, and normal distributions in Chapter 4, along with the Central Limit Theorem. One can then cover the confidence intervals and hypothesis tests in Chapters 5 and 6, and finish ei ther with the two-sample procedures in Chapter 7 or by covering as much of the material on inferential methods in regression in Chapter 8 as time permits. For a course that puts more emphasis on regression and factmi al expetiments, one can go quickly over the power calculations and multiple testing procedures, and cover Chapters 8 and 9 immediately following Chapter 6. Alternati vely, one could substitute Chapter J0 on statistical quality control for Chapter 9.
Preface
ix
THE ARIS COURSE MANAGEMENT SYSTEM The ARTS (Assessment, Review, and Instruction System) onhne course management system is available to instructors who adopt this text. With ARIS, instructors can assign and grade text-based homework within a versatile homework management system. Tn addition, ARIS contains algorithmic problems for stude nt practice, along with Java applets th at allow students to interacti vely explore ideas in the text. Custo rnizable PowerPoint lecture notes for each chapter are available as well, along with additional tools and resources such as a guide to simulation in MTNITAB, suggested syllabi, and other features. More information can be fou nd at www.mhhe.com/navidi.
ELECTRONIC TEXTBOOK OPTION This text may be purc hased in electronic fmm through an on line resource known as CourseSmart. Students can access the complete text on line through their browsers at approximately one-half the cost of a traditional text. ln addition, purchasing the eTextbook allows students to use CourseSmart 's web tools, wh ich include full text search, notes and highlighting, and email tools for sharing notes between classmates. More infOim ation can be fo und at www.CourseSmart.com.
ACKNOWLEDGMENTS l am indebted to many people for contributions at every stage of development. I received many valuable suggestions from my colleagues Barbara Moskal, Gus Greivel, Ashl yn Hutchi nson, and Melissa Laeser at the Colorado School of Mines. Mike Colagrosso of the School of Mines developed some excellent applets. I am particularly grateful to Jackie Miller of The Ohio State University, who read the entire manuscript, found many errors, and made many valuable suggestions for improvement. The staff at McGraw-Hill has been extremely capable and supporti ve. In particular, I would like to express thanks to my sponsoring editor M ichael Hackett and developmental editor Lora Neyens fo r their patience and guidance in the preparation of this book. William Navidi
Chapter
Summarizing Univariate Data Introduction Advances in science and engineering occur in large part tlu·ough the collection and analysis of data. Proper analysis of data is challenging, because scientifi c data are subj ect to random variation. That is, when scientific measurements arc repeated, they come out somewhat differently each time. This poses a problem: How can one draw conclusions from the results of an expetiment when those results could have come out differe ntly? To address this question, a knowledge of statistics is essential. The methods of statistics allow scientists and engineers to design valid experiments and to draw reliable conclusions from the data they produce. While our emphasis in this book is on the applications of statistics to science and engineering, it is worth mentioning that the analys is and interpretation of data arc playing an ever-increasi ng role in all aspects of modern life. For better or worse, huge amounts of data are collected about our opinions and our lifestyles, for purposes ranging from the creation of more effective marketing campaigns to the development of social policies designed to improve our way of life. On almost any given day, newspaper articles are published that purport to explain social or economic trends through the analysis of data. A basic knowledge of statistics is therefore necessary not only to be an effective scientist or engineer, but also to be a well-informed member of society.
The Basic Idea The basic idea behind all statistical methods of data analysis is to make inferences about a population by studying a relatively small sample chosen from it. As an illustration, consider a machine that makes steel balls for ball bearings used in clutch systems. The specification for the diameter of the balls is 0.65 ± 0.03 e m. During the last hour, the machine has made 2000 balls. The quality engineer wants to know approximately how
1
2
CHAPTER 1
Summarizing Univariate Data
many of these balls meet the specification. He does not have time to measure all 2000 balls. So he draws a random sample of 80 balls, measures them, and finds that 72 of them (90%) meet the diameter specification. Now, it is un likely that the sample of 80 balls represents the population of 2000 pe1fectly. The proportion of good balls in the population is likely to d iffer somewhat from the sample proportion of 90%. What the engineer needs to know is just how large that difference is likely to be. For example, is it plausible that the population percentage could be as high as 95%? 98%? As low as 85%? 80 %? Here are some specific questions that the engineer might need to answer on the basis of these sample data:
1.
2.
3.
The engineer needs to compute a rough estimate of the likely size of the difference between the sample proportion and the population proportion. How large is a ty pical difference for this ki nd of sample? The quality engineer needs to note in a logbook the percentage of acceptable balls manufactured in the last hour. Having observed that 90% of the sample balls were good, he will ind icate the percentage of acceptable balls in the population as an interval of the fo rm 90% ± x%, where x is a number calculated to prov ide reasonable certainty that the true population percentage is in the interval. How shoul d x be calculated? The engineer wants to be fairly certain that the percentage of good balls is at least 85%; otherwise, he will shut down the process for recalibration. How certain can he be that at least 85% of the I 000 balls are good?
Much of th is book is devoted to addressi ng questions like these. The first of these questions requires the computation of a standard deviation, which we wi ll discuss in Chapter 3. The second question requires the construction of a confidence interval, which we will learn about in Chapter 5. The third calls for a hypothesis test, which we will study in Chapter 6. The remaining chapters in the book cover other important topics. For example, the engineer in our example may want to know how the amount of carbon in the steel balls is related to their compressive strength. Issues like this can be addressed with the methods of correlation and rega·ession, which are covered in Chapters 2 and 8. It may also be important to determine how to adj ust the manufacturing process with regard to several factors, in order to produce optimal results. This requi res the design of factoa·ial experiments, which are discussed in Chapter 9. Finally, the engineer will need to develop a plan for monitoring the q uality of the product manufactured by the process. Chapter 10 covers the topic of statistical quality control, in which statistical methods are used to maintain quality in an industrial setting. The topics listed here concern methods of draw ing conclusions from data. These methods form the field of inferential statistics. Before we d iscuss these topics, we must first learn more about methods of collecting data and of sununarizing clearly the basic information they conta in. These are the topics of sampling and descriptive statistics, and they are covered in the rest of this chapter.
1.1
_.J
1.1
Sampling
3
•.~\1 ~\.. --''
Sampling As mentioned, statistical methods are based on the idea of analyzing a sample drawn from a population. For this idea to work, the sample must be chosen in an appropliatc way. For example, let us say that we wished to study the heights of students at the Colorado School of Mines by measuring a sample of 100 students. How should we choose the 100 students to measure? Some methods are obviously bad . For example, choosing the stude nts from the rosters of the football and basketball teams would undoubtedly result in a sample that wou ld fail to represent the height di stribution of the population of students. You might think that it would be reasonable to use some conveniently obtained sample, for example, all students living in a certain dorm or all students enrolled in engineering statistics. After all , there is no reason to think that the heights of these students would tend to differ from the heights of students in general. Samples like thi s are not ideal, however, because they can turn out to be misleading in ways that are not anticipated. The best sampling methods involve random sampling. There are many differe nt random sampling methods, the most basic of which is simple random sampling.
Simple Random Samples To understand the nature of a simple random sample, think of a lottery. Imagine that 10,000 lottery tickets have been sold and that 5 winners are to be chosen. What is the fairest way to choose the winners? The fairest way is to put the 10,000 tickets in a drum, mix them thoroughly, and then reach in and one by one draw 5 tickets out. These 5 winning tickets are a simple random sample fro m the population of 10,000 lottery tickets. Each ticket is equally likely to be one of the 5 tickets drawn. More important, each collection of 5 tickets that can be formed from the 10,000 is equally likely to comprise the group of 5 that is drawn. It is this idea that forms the basi s for the definition of a simple random sample.
Summary
.
_
.. .
-
·~- -
_ _ ._'.
..
·······~··.,.,..""·11
____-.,- ·:..-~ ·~ ?~
•
A population is the entire collection of objects or outcomes about which information is sought.
•
A sample is a subset of a population, containing the objects or outcomes that are actual ly observed . A simple random sample of size n is a sample c hosen by a method in which each collection of n population items is equally likely to comprise the sample, just as in a lottery.
•
Since a simple random sample is analogous to a lottery, it can often be drawn by the same method now used in many lotteries: with a computer random number generator. Suppose there are N items in the population. One assigns to each item in the population an integer between 1 and N. Then one generates a list of random integers between
4
CHAPTER 1
Summarizing Univariate Data
l and Nand chooses the corresponding population items to comprise the simple random sample. A utility company wants to cond uct a survey to measure the satisfaction level of its customers in a certain town. There arc 10,000 customers in the town, and utility emp loyees want to draw a sample of size 200 to interview over the telephone. They obtain a list of all 10,000 customers, and number Lhem from I to 10,000. They use a computer random number generator to generate 200 random integers between I and 10,000 and then telephone the customers who COITespond to those numbers. Is this a simple random sa mple? Solution
Yes, this is a simple random sample. Note that it is analogous to a lottery in which each custo mer has a ticket and 200 tickets are drawn.
A quality engineer wan ts to inspect electroni c microcircuits in order to obtain information on the proportion that are defective. She decides to draw a sample of I00 circuits from a day's production. Each hour for 5 hours, she takes the 20 most recently produced circuits and tests them. Is this a simple random sa mple? S lutio
No. Not every subset of 100 circuits is equally likely to comprise the sam ple. To construct a simple random sample, the engi neer would need to assign a number to each circuit produced during Lhe day and then generate random numbers to determine which circuits comprise the sample. '
Samples of Convenience In some cases, it is diffic ult or impossible to draw a sample in a tru ly random way. In these cases, the best one can do is to sample items by some convenient method. For example, imagine that a construction e ngineer has just received a shipment of 1000 concrete blocks, each weigh ing approximately 50 pounds. The blocks have been delivered in a large pile. The engineer wishes to investigate the crushing strength of the blocks by measuring the strengths in a sample of 10 blocks. To draw a simple random sam ple would require removing blocks from the center and bottom of the pile, wh ich might be qu ite difficult. For this reason, the engineer might construct a sample simply by taking 10 blocks off the top of the pile. A sample like this is called a sample of convenience. ltT:IillillU•lil
A sample of convenience is a sample that is not drawn by a well-defined random me thod. The big problem with samples of convenience is that they may differ systematically in some way from the population. For Litis reason samples of convenience should only be
1.1
Sa mpling
5
used in situations where it is not feasible to draw a random sample. When it is necessary to take a sample of convenience, it is important to think carefully about all the ways in wh ich the sample might differ systematically from the population. If it is reasonable to believe that no important systematic difference exists, then it may be acceptable to treat the sample of convenience as if it were a simple random sample. With regard to the concrete blocks, if the engineer is confident that the blocks on the top of the pile do not differ systematically in any important way from the rest, then he may treat the sample of convenience as a simple random sample. If, however, it is possible that blocks in different parts of the pile may have been made from different batches of mix or may have differe nt curing times or temperatures, a sample of convenience could give misleading results. Some people think that a simple random sample is guaranteed to re flect its population perfectl y. This is not true. Simple random samples always differ from their populations in some ways, and occasionally they may be substantia ll y different. Two different samples from the same population will differ from each other as well. This phenomenon is known as sampling variation. Sampl ing variation is one of the reasons that scientific experiments produce somewhat diffcrentresults when repeated, even when the conditions appear to be identical. For example, suppose that a quality inspector draws a simple random sample of 40 bolts from a large shipment, measures the length of each, and finds that 32 of them, or 80%, meet a le ngth specification. Another inspector draws a different sample of 40 bolts and finds that 36 of the m, or 90%, meet the spec ification. By chance, the second inspector got a few more good bolts in her sample. It is likely that neither sample reflects the population perfectly. The proportion of good bolL<> in the population is likely to be close to 80% or 90%, but it is not likely that it is exactly equal to either value. Since simple random samples don' t reflect thei r populations perfectly, why is it important that sampling be done at random ? The benefit of a sim ple random sample is that there is no systemati c mechani sm tending to make the sample unrepresentative. The differences between the sample and its population are due enti rely to random variati on. Since the mathematical theory of random variation is well understood, we can use mathematical models to study the relationship between simple random samples and the ir populations. For a sample not chosen at random, there is generally no theory available to describe the mechanisms that caused the sample to differ from its population. Therefore, nonrandom samples are often difficult to a nalyze reliably.
Tangible and Concept'ual Populations The populations discu ssed so far have consisted of actual physical objects-the customers of a utility company, the concrete blocks in a pile, the bolls in a shipment. S uch populations are called tangible populations. Tangible populations are always finite. After an item is sampled, the population size decreases by l. In principle, one could in some cases return the sampled item to the population, with a chance to sample it again, but this is rarely done in practi ce. Engineeting data are often produced by measurements made in the course of a scientific experiment, rather than by sampling from a tangible population. To take a
6
CHAPTER 1
Summarizing Univariate Data
simple example, imagine that an engineer measures the length of a rod five times, being as careful as possible to take the measurements under identical conditions. No matter how carefully the measurements are made, they will differ somewhat from one another, because of variation in the measurement process that cannot be controlled or predicted. It tums out that it is often appropriate to consider data like these to be a simple random sample from a population. The population, in these cases, consists of all the values that might possibly have been observed. Such a population is called a conceptual population, since it does not consist of actual objects.
A simple random sample may consist of values obtained from a process under identical experimental conditions. In this case, the sample comes from a population that consists of all the values that might possibly have been observed. S uch a population is called a conceptual population. Example 1.3 involves a conceptual population.
A geologist weighs a rock several times on a sensi ti ve scale. Each time, the scale gives a sl ightly different reading. Under what conditions can these readings be thought of as a simple random sample? What is the population? Solution
If the physical characteristics of the scale remain the same for each weighing, so that the measurements are made under identical conditions, then the readings may be considered to be a simple random sample. The population is conceptual. It consists of all the readi ngs that the scale could in principle produce.
Determining Whether a Sample Is a Simple Random Sample We saw in Example 1.3 that it is the physical characteristics of the measurement process that determine whether the data are a simple random sample. In general, when deciding whether a set of data may be considered to be a simple random sample, it is necessary to have some understanding of the process that generated the data. Statistical methods can sometimes help, especially when the sample is large, but knowledge of the mechanism that produced the data is more important.
..
Example
A new chemical process has been designed that is supposed to produce a higher yield of a certain chemical than does an old process. To study the yield of this process, we run it 50 times and record the 50 yields. Under what conditions might it be reasonable to treat this as a simple random sample? Describe some conditions under which it mi ght not be appropriate to treat this as a simple random sample.
Sampling
1.1
7
Solution
To answer this, we must first specify the population. The population is conceptual and consists of the set of all yields that will result from this process as many times as it will ever be run. What we have done is to sample the first 50 yields of the process. lj; and only if, we are confident that the first 50 yields are generated under identical conditions and that they do not differ in any systematic way fro m the y ields of future runs, then we may treat them as a simple random sample. Be cautious, however. There are many conditions under which the 50 yields could fail to be a simple random sample. For example, with chemical processes, it is sometimes the case that runs with higher yields tend to be followed by runs with lower yields, and vice versa. Sometimes yields tend to increase over time, as process engineers learn from experience how to run the process more efficie ntly. In these cases, the yields are not being generated under identical conditions and would not compri se a simple random sample. Example 1.4 shows once again that a good knowledge of the nature of the process under co nsideration is important in deciding whether data may be considered to be a simple random sample. Statisti cal methods can sometimes be used to show that a given data set is not a s imple random sample. For exampl e, sometimes experimental conditions graduall y change over time. A simple but effecti ve method to detect this condition is to plot the observations in the order they were taken. A simple random sample should show no obvious pattern or trend. Figure 1.1 presents plots of three samples in the order they were taken. The plot in Figure l.la shows an oscillatory pattern. The plot in Figure l . l b shows an increasing trend. Neither of these samples should be treated as a simple ra ndom sample. The plot in Figure l.lc does not appear to show any obvious pattern or trend. It might be appropriate to treat these data as a simple random sample. However, before making that decision, it
\
.......
.·..
0
•o
0.
.. 0
......... 20
.... 30
0
0
0
40
Measurement Number (a)
0
0
0
0
oO
10
. ... ..
... .. ...
ooo
0
00. .
... ......•..
0
50 0
0 •
•
•
0
10
20
30
40
Measurement Number (b)
50 0
... . . ... ... . . .. 0
0
10
0
0
20
0
0
0
0
0
30
40
0
50
Measurement Number (c)
FIGURE 1.1 Three plots of observed values versus the order in which they were made. (a) The values show a definite pattern over time. This is not a simple random sample. (b) The values show a trend o ver time. This is not a simple random sample. (c) The values do not show a pattern or trend. It may be appropri ate to treat these data as a simple random sample.
8
CHAPTER 1
Summarizing Univariate Data
is still important to think about the process that produced the data, since there may be concerns that don't show up in the plot.
Independence The items in a sample are said to be independent if knowing the values of some of them does not help to predict the values of the others. With a finite, tangible population, the items in a simple random sample are not strictly independent, because as each item is drawn, the population c hanges. T his change can be substantial when the population is small. However, when the population is very large, this change is negligible and the items can be treated as if they were independent. To illustrate this idea, imagine that we draw a simple random sample of 2 items from the population
For the fi rst draw, the numbers 0 and 1 are eq ually likely. But the value o f the second item is clearl y infl uenced by the fi rst; if the first is 0, the second is more likely to be 1, a nd vice versa. Thus, the sampled items are dependent. Now assume we draw a sample of size 2 from this population:
One million
[2] 's
One mi llion
IJJ ·s
Again on the first draw, the numbers 0 and l arc equally likely. But unl ike thetprevious example, these two values remain almost equally likely the second draw as well, no matter what happens on the firs t draw. With the large population, the sample items are for all practical purposes independent. It is reasonable to wonder how large a population must be in order that the items in a simple random sample may be treated as independent. A rule of thumb is that when sampling from a fini te popul ation, the items may be treated as independent so long as the sample comprises 5% or less of the population. Interestingly, it is possible to make a population behave as though it were infinitely large, by replaci ng each item after it is sampled. T his method is called sampling with replacement. With this method, the population is exactly the same on every draw, and the sampled items are truly independent. With a conceptual population, we require that the sample items be produced under iden tical experi mental conditions. Tn particular, then, no sample value may influence the conditions under wh ich the others are produced. T herefore, the items in a simple random sample from a conceptual population may be treated as independent. We may think of a conceptual population as being infinite or, equiva lently, that the items are sampled with replacement.
1.1
Sampling
•
The items in a sampl e are independent if knowing the val ues of some of the items docs not help to predict the values of the oU1e rs.
•
Items in a simple random sanipie may be tTeatcd as independent in many cases encou ntered in practice. The exception occurs when the population is finite and the sample comprises a substantial fraction (more th an 5%) of the population.
9
•a.:.:
Other Sampling Methods In addition lo simple random sam piing there are other sam pii ng methods that arc useful in various situations. In weighted sampling, some items arc given a greater chance of be ing selected than othe rs, like a lottery in whi ch some people have more tickets than others. In stratified random sampling, the population is divided up into subpopulations, called strata, and a simple random sample is drawn from each stratum. Tn cluster sampling, items are drawn fro m the population in groups, or clusters. Cluster sampling is useful when the population is too large and spread out for simple random sampling to be feasible. For example, many U.S. governme nt agencies use cl uster sampling to sample the U.S. population to measure sociological fac tors suc h as income and unemployme nt. A good source of informati on on sampling methods is Cochran ( 1977). Simple random sampling is not the only valid method of sampling. But it is the most fundamental , and we will foc us most of our attention on this method. From now on, unless othe rwise stated, the terms "sample" and " random sample" will be taken to mean "simple random sample."
Types of Data When a numerical quantity designating how much or how many is assigned to each item in a sample, the resulting set of values is called numerical or quantitative. In some cases, sample items are placed into categories, and category na mes arc assigned to the sample items. T hen the data arc categorical or qualitative. Sometimes both quantitative and categorical data are collected in the same experiment. For example, in a loading test of column-to-beam welded connections, data may be collected both on the torque applied at failure and on the location of the failure (weld or beam). The torq ue is a quant itative variable, and the location is a categorical variable.
Controlled Experiments and Observational Studies Many scientific ex periments arc designed to dete rmine the effect of changing one or more factors on the value of a response. For example, suppose that a c hemical e ngineer wants to detennlne how the concentrations of reagent and catalyst affect the y ield of a process . T he engineer can run the process several times, c hangi ng the concentrations each time, and compare the y ie lds that result. This sort of expe riment is called a controlled experiment, because the va lues of the factors- in this case, the concentrations of reagent and cata lyst -are under the conu·oJ of the experimenter. When designed and conducted
10
CHAPTER 1
Su mmarizing Univariat e Data
properly, control led experiments can produce reliable information about cause-and-effect relationships between factors and response. In the yield example just mentioned, a welldone experiment would allow the experimenter to conclude that the differences in yield were caused by differences in the concentrations of reagent and catalyst. There are many situations in which scientists cannot control the levels of the factors. For example, many studies have been conducted to determine the effect of cigarette smoking on the risk o f lung cancer. In these stud ies, rates of cancer among smokers are compared with rates among nonsmokers. The ex perimenters cannot control who smokes and who does n't; people cannot be required to smoke just to make a statistician's job easier. This kind of study is called an observational study, because the experimenter simply observes the levels of the factor as they are, without having any control over the m. Observational studies are not nearly as good as controlled experiments for obtaining reliable conclusions regarding cause and effect. In the case of smoki ng and lung cancer, for exampl e, people who choose to smoke may not be representati ve of the population as a whole, and may be more likely to get cancer for other reasons. For thi s reason, although it has been kn own for a long time that smokers have higher rates of lung cancer than nonsmokers, it took many years of carefully done observational studies before scie ntists could be sure that smoki ng was actuall y the cause of the higher rate.
Exercises for Section 1.1 1. Each of the fo llowing processes involves sampling from a population. Define the population, and state whether it is tangible or conceptual. a. A shipment of bolts is received from a vendor. To check whether the shipment is acceptable with regard to shear strength, an engineer reaches into the container and selects 10 bolts, one by one, to test. b. T he resistance of a certain resistor is measured fi ve times with the same o hmmeter. c. A graduate student majoring in environmental science is part of a study team that is assessing the risk posed to human health of a certain contaminant present in the tap water in their town. Part of the assessment process involves estimating the amount of time that people who live in that town are in contact with tap water. T he student recrui ts residents of the town to keep diaries for a month, detailing day by day the amount of time they were in contact with tap water. d. Eight welds are made with the same process, and the strength of each is measured. e. A quality engineer needs to estimate the percentage of parts manufactured on a certai n day that are defective. At 2:30 in the afternoon he samples the last 100 parts to be manufactured.
2.
u· you wanted to estimate the mean height of all the students at a university, which one of the fo llowi ng sampling strategies would be best? Why? Note that none of the methods are true simple random samples. 1.
Measure the heights of 50 students found in the gym during basketball intramurals .
u. Measure the heights of all engineering majors.
w. Measure the heights of the students selected by choosing the fi rst name on each page of the campus phone book. 3. True or false: a. A simple random sample is guaranteed to reflect exactly the population from which it was drawn. b. A simple random sample is free f rom any systematic tendency to differ from the population from which it was drawn.
4. A quali ty engineer d raws a simple random sample of 50 0-rings from a lot of several thousand. She measures the thickness of each and fi nds that 45 of them, or 90%, meet a certain specification. Which of the following statements is con·ect? 1.
The propo1t ion ofO-rings in the entire lot that meet the specification is likely to be equal to 90%.
1.2 Summary Statistics
ii. The proportion ofO-rings in the entire lot that meet the specification is li kely to be close to 90% but is not likely to equal 90%. 5. A certain process for manufacturing integrated circuits has been in use for a period of time, and it is known that 12% of the circuits it produces are defective. A new process that is supposed to reduce the proportion of defectives is being tested. In a simple random sample of 100 circuits produced by the new process, 12 were defective. a. One of the engineers suggests that the test proves that the new process is no better than the old process, si nce the proportion of defectives in the sample is the same. Is this conclusion j ustified? Explain. b. Assume that there had been only I I defective c ircuits in the sample of 100. Would this have proven that the new process is better? Explain. c. Wh ich outcome represents stronger evidence that the new process is better: fin ding 1 I defecti ve cir-
11
cuits in the sample, or findin g 2 defecti ve circuits in the sample? 6. Refer to Exercise 5. True or false: a. If the proportion of defectives in the sample is less than 12%, it is reasonable to conclude that the new process is better. b. If the proportion of defectives in the sample is on ly slightly Jess than 12%, the difference could well be due entirely to sam pling vari ation, and it is not reasonable to conclude that the new process is better. c. If the proportio n of defecti ves in the samp le is a Jot less than 12%, it is very unlikely that the difference is due entirely to sampling variation, so it is reasonable to conclude that the new process is better. 7. To determine whether a sample should be treated as a simple random sample, which is more important: a good knowledge of stati stics, or a good knowledge of the process that produced the data?
1.2 Summary Statistics A sample is often a long list of numbers. To help make the important features of a sample stand out, we compute summary statistics. The two most commonly used summary statistics are the sample mean and the sample standard deviation. The mean gives an indicati on ofthe center of the data, and the standard deviation g ives an ind ication of how spread out the data are.
The Sample Mean The sample mean is also called the "arithmetic mean," or, more simply, the "average." It is the sum of the numbers in the sample, divided by how many there are.
Let X 1 ,
• •• ,
X, be a sample. The sample mean is
( 1.1 )
It is customary to use a letter with a bar over it (e.g., X) to denote a sample mean. Note also that the sample mean has the same units as the sample values X 1, ... , X,.
12
CHAPTER 1
Sum marizing Un ivariate Data
A simple random sample of fi ve men is chosen from a large popul ation of me n, and their heights are measured. The fi ve heights (in em) are 166.4, 183.6, 173.5, 170.3, and 179.5. Find the sample mean. Solution
We use Equation ( 1.1). The sa mple mean is
X
= -1 (166.4 + 183.6 + 173.5 + 170.3 + 179 .5) = 174.66 em 5
The Standard De viatio n Here are two lists of numbers: 28, 29, 30, 3 1, 32 and 10, 20, 30 , 40, 50. Both lists have the same mean of 30. But the second list is much more spread out than the first. The standard deviation is a quantity that measures the degree of spread in a sa mple. Let X 1 , •.. , X, be a sample. The idea behind the sta ndard deviation is that when the spread is large, the sample values will tend to be far from their mean, but whe n the spread is small , the values will tend to be close to the ir mean. So the first step in calculating the sta ndard deviatio n is to compute the differences (also called deviations) between each sample value and the sample mean. The devi atio ns are (X 1 - X ) , ... , (X, - X) . Now, some of these deviations are positive and some are negative. Large negati ve deviations arc j ust as indicative of spread as large positive deviations are. To make all the deviations positive, we square them, obtaining the squared deviations (X 1 - X)2, . . . , (X, - X) 2 • From the squared dev iations, we can compu te a measure of spread called the sample variance. The sample variance is the average of the squared deviati ons, except that we divide by n - 1 instead of n . ll is customary to denote the sample variance by s 2 .
Let X 1,
•••,
X , be a sample. The sample variance is the quantity -2 s2 = -1- ../f-.. (X; - X) 6
n- 1
( 1.2)
i= l
An equivalent formula, which can be easier to compute, is
s2
1 = -·--
n- 1
(
L Xt II
nX
2)
(1.3)
i= l
While the sample variance is a n important quantity, it has a serious drawback as a measure of spread . Its units are not the same as the units of the sample values; instead, they are the squa red units. To obtain a measure of spread whose units are the same as those of the sample values, we simply take the square root o fthe variance. This quantity is known as the sample standard deviation. It is customary to denote the sample standard deviation by the lette rs (the square root of s 2 ) .
1.2 Summary Statistics
Let X 1 ,
••• ,
13
X, be a sample. The sample standard deviation is the quantity
I
s=
II
-"'<X;X) n- I L--
2
(1.4)
i= l
An equivale nt formula, which can be easier to compute, is I
- "'x.2 n - l ( L--
S=
II
1
-2 )
(1.5)
nX
i= l
The sampl e standard deviation is the square root of the sample variance.
..
It is natural to wonder why the sum of the squared deviations is divided by n - 1 rather than 11 . The purpose in computing the sample standard deviation is to estimate the amount o f spread in the population from which the sample was drawn. Ideall y, therefore, we wou ld compute deviati ons from the mean of all the ite ms in the population, rather than the deviations from the sample mean. However, the population mean is in general unknown, so the sample mean is used in its place. It is a mathematical fact that the deviations around the sample mean tend to be a bit smalle r than the deviations around the population mean and that dividing by n - 1 rathe r than n provides exactly the right correction.
Example
Find the sample variance and the sample standard deviation for the height data in Example 1.5. Solution
We'll first compute the sample variance by using Equation (1.2). The sampl e mean is X = 174.66 (see Example 1.5). The sample variance is therefore
s2 =
~[(166.4- 174.66)2 + (183.6- 174.66) 2 + (173.5- 174.66)2 4 + (170.3- 174.66)2 + (179.5- 174.66) 2 J = 47.983
Alternatively, we can use Equation (1.3): 2
s =
~ll66.42 + 183 .62 + 173.52 + 170.32 + 179.52 -
5(174.662 ) ]
= 47.983
The sample standard deviation is the square root of the sample vari ance:
s
= J47.983 = 6.93
What would happen to the sample mean, variance, and standard deviation if the he ights in Example 1.5 were measured in inches rather than centimeters? Let's denote the heights in centimeters by X 1, X 2 , X 3 , X 4 , X 5 , and the heigh_ts in inches by
14
CHAPTER 1
Summarizing Univariate Dat a
Y, , Y2, Y3, Y4 , Ys. The relationship between X; andY; is the n given by Y; = 0.3937X;. Tf you go back to Exa mple 1.5, convert to inches, and compute the sample mean, you will find that the sample means in inches and in centimeters are related by the equation Y = 0.3937 X. Thus, if we multiply each sample item by a constant, the sample mean is multiplied by the same constant. As for the sample vmiance, yo u will find that the deviations are related by the equation (Y; - f) = 0.3937(X; - X). Tt follows that s~ = 0.39372 and that s1, = 0.3937sx. What if each man in the sample stood on a 2-ce ntimeter platform? Then each sample height would increase by 2 e m, and the sample mean would increase by 2 em as well. In general, if a constant is added to each sample item, the sample mean inc reases (or decreases) by the same constant. The deviations, however, do not c hange, so the sample variance and standard deviation are unaffected.
sk
•
•
If X 1 , ••• , X, is a sample and Y; = a+ bX; , where a and bare constants, then Y = a + b X. If X 1, ••• , X, is a sample and Y; = a + bX; , where a and bare constants, the n s~ = b2 sk, and sy = lblsx.
Outliers Sometimes a sample may contain a few points that are much larger or smaller than the res t. Suc h points are called outliers. See Figure l.2 for an example. Sometimes outliers result from data entry errors; for example, a misplaced decimal point can result in a value that is an order of magnitude different from the rest. Outliers should always be scrutinized, and any ou tlier that is found to result from an en·or should be corrected or deleted. Not all outlie rs are errors. Sometimes a population may contain a few values that are much different from the rest, and the outliers in the sample reflect this fact.
Outllcr
FIGURE 1.2 A data set that contains an outlie r.
Outliers are a real problem for data analysts. For this reason, when people see outliers in their data, they sometimes u·y to find a reason, or an excuse, to delete them. An outlier should not be deleted, however, unless it is reasonably certain that it resulls from an enor. Tf a population truly contains outliers, but they m·e deleted from the sa mple, the sample will not characterize the population correctly.
The Sample Median The median, like the mean, is a measure of center. To compute the median of a sample, order the values from smallest to largest. The sample median is the middle number. Tf
Summary Statistics
1.2
15
the sample size is an even number, it is customary to take the sample median to be the average of the two middle numbers.
·, Definition
·-
,....
•
-. · -
'
-
-
....._
-: ~- ·.
,;._~.:__. __•
.,.,.,_
~
~·-·~ i:....~
If 11 numbers are ordered from smallest to largest:
• •
1 Jf 11 IS . odd , tI1e samp1e me d'tan IS . tI1e numb er ·m posttwn · · -n. + -. 2 If 11 is even, the sample median is the average of the numbers in positions and
~ 2
11
"2 + I.
Example
~
Find the sample median for the height data in Example 1.5. Solution
The five he ights, arranged in increasing order, are 166.4, 170.3, 173.5, 179.5, 183.6. The sample median is the middle number, which is 173.5. The median is often used as a measure of center for samples that contain outliers. To see why, consider the sampl e consisting of the values I, 2, 3, 4, and 20. The mean is 6, and the median is 3. It is reasonable to think that the median is more represe ntative of the sample than the mean is. See Figure 1.3.
Median
Mean
FIGURE 1.3 When a sample contains outliers, the median may be more representative of the sample than the mean is.
Quartiles The median divides the sample in half. Quartiles divide it as nearly as possible into quarters. A sample has three quartiles. There are several different ways to compute quartiles, and all of them give approximately the same result. The simplest method when computing by hand is as follows: Let n represent the sample size. Order the sample values from smallest to largest. To find the first quartile, compute the value 0.25(n + 1). Jf this is an integer, then the sample value in that position is the first quartile. Jf not, then take the average of the sampl e values on either side of this value. The third quartile is computed in the same way, except that the value 0.75(n + 1) is used. The second quartile uses the value 0.5(n + I ). The second quartile is identical to the median. We note that some computer packages use slightly different methods to compute quartiles, so their results may not be quite the same as the ones obtained by the method described here.
16
CHAPTER 1
Summarizing Univariate Data
Example In the a11icle "Evaluation of Low-Temperature Properties of HMA Mixtures" (P. Sebaaly, A. Lake, and J. Epps, Journal of Transportation Engineering, 2002:578-583), the following values of fracture stress (in mcgapascals) were measured for a sample of 24 mixtures of hot-mixed asphalt (HMA).
30
75
79
80
80
105
126
138
149
179
179
191
223
232
232
236
240
242
245
247
254
274
384 470
Find the first and th ird quartiles. Solution
The sample s ize is n = 24. To find the first quartile, compute (0.25)(25) = 6.25 . The first quartile is therefore found by averaging the 6th and 7th data points, when the sample is arranged in increasing order. This yields ( 105 + 126)/2 = 11 5.5. To find the third quartile, compute (0.75) (25) = 18.75. We average the 18th and 19th data points to obtain (242 + 245) /2 = 243.5.
Percentiles The plh percentile of a sample, for a number p between 0 and I 00, divides the sample so that as nearly as possible p% of the sample values arc less than the pth percentile, and (100 - p)% are greater. There are many ways to compute percentiles, all of which produce similar results. We describe here a method analogous to the method described for computing quartiles. Order the sample values from smallest to largest, and then compute the quantity ( p / 1OO)(n + 1) , where n is the sample size. If this quantity is an integer, the sample value in this position is the p th percentile. Otherwi se, average the two sample values on either side. Note that the fi rst quartile is the 25th percentile, the median is the 50th percentile, and the third quartile is the 75th percentile. Some computer packages use slightly different methods to compute percentiles, so their results may differ slightly from the ones obtai ned by this method. Percentiles are often used to interpret scores on stan dardized tests. For example, if a student is informed that her score on a college entrance exam is on the 64th percentile, this means that 64% of the students who took the exam got lower scores.
Example
~
Find the 65th percentile of the asphalt data in Exa mple J .8. Solution
The sample size is n = 24. To find the 65th percentile, compute (0.65)(25) = 16.25. The 65th percentile is therefo re found by averaging the 16th and 17th data points, when the sample is arranged in increasing order. This yields (236 + 240)/2 = 238.
In practice, the summary statistics we have discussed are often calcul ated on a computer, using a statistical software package. The sunm1ary statistics are sometimes called descriptive statistics, because they describe the data. We present an example of
1.2
Sum mary Statistics
17
the calculation of summary statistics from the soft ware package MINITAB. Then we wiII show how these statistics can be used to discover some important features of the data. For a Ph.D. thesis that investigated factors affect ing diesel vehicle emissions, J. Yanowitz of the Colorado School of M ines obtained data on emissions of particulate matter (PM) for a sample of 138 vehicles driven at low altitude (near sea level) and fo r a sa mple of 62 vehicles drive n at high altitude (approximately one mile above sea level). All the vehicles were manufactured between 199 1 and 1996. The samples contained roughly equal proportions of high- and low-mileage vehicles. The data, in units of grams of particulates per gallon of fuel consumed , are presented in Tables 1.1 and 1.2. At high altitude, the barometric pressure is lower, so the effective air/fuel ratio is lower as well. For th is reason, it was thought that PM e missions might be greater at highe r alti tude. We would like to compare the samples to determine whethe r the data support this assumption. It is diffic ult to do this simply by examining the raw data in the tables. Computing summary statistics makes the job much easier. Figure 1.4 (page 18) presents summary statistics for both sa mples, as computed by MINTTAB. In Figure 1.4, the quantity labeled "N" is the sample size. Following that is the sample mean. T he next quantity (SE Mean) is the standard er-ror of the mean. The standard e rror of the mean is equal to the standard deviation divided by the square root of the sample s ize. This quantity is not used much as a descriptive statistic, although it is important for applications such as constructing confidence i nlervals and hypothesis tests, which we will cover in C hapters 5, 6, and 7. Followi ng the standard error of the mean is the standard dev iati on. Finall y, the second line of the output provides the minimum, median, and maximum , as well as the first and third quarti les (Ql and Q3). We note that the values of the quartiles produced by the computer pac kage differ slightly from the values that would be computed by the methods we describe. This is not surprising, since
TABLE 1.1 Particulate matter (PM) emissions (in gfgal) for 138 vehicles driven at low a ltitude 1.50 1.48 2.98 1.40 3. 12 0.25 6.73 5.30 9.30 6.96 7.21
0.87 1.06 7.39 1.37 2.37 0.53 7 .82 3.93 6.50 5.78 4 .67
l.l2 l.l1 2.66 1.81 2. 12 3.36 4.59 3.52 4.62 9.14 4.49
1.25 2. 15 11.00 1.14 2.68 3.47 5. 12 2.96 5.45 10.63 4.63
3.46 0.86 4.57 1.63 l.l7 2.74 5.67 3. 12 4.93 8.23 2.80
1. 11 1.81 4.38 3.67 3.34 1.88 4.07 1.07 6.05 6.83 2. 16
1.1 2 1.47 0.87 0.55 3.79 5.94 4.01 5.30 5.82 5:6o 2.97
0.88 1.24 1.10 2.67 1.28 4.24 2.72 5. 16 10.19 5.4 1 3.90
1.29 1.63 1.11 2.63 2. 10 3.52 3.24 7.74 3.62 6.70
0.94 2.14 0.61 3.03 6.55 3.59 5.79 5.4 1 2 .67 5.93
0.64 6.64 1.46 1.23 1.18 3. 10 3.59 3.40 2.75 4.5 1
1.31 4.04 0.97 1.04 3.06 3.33 3.48 4.97 8.92 9.04
2.49 2.48 0.90 1.63 0.48 4.58 2.96 11 .23 9.93 7.7 1
23.38 7.10 4.68 2.0 1
9.24 6.04 1.85 5.9 1
3.22 5.66 9. 14 5.60
TABLE 1.2 Particulate matter (PM) emissions (in g/gal) for 62 vehicles driven at high a ltitude 7.59 2.06 8.86 8.67 5.61
6.28 4.04 4.40 9.52 1.50
6.07 l7.ll 3.57 2.68 6.46
5.23 12.26 4.35 10.14 5.29
5.54 19.91 3.84 9.20 5.64
3.46 8.50 2.37 7.31 2.07
2.44 7.8 1 3.81 2.09 1.11
3.01 7.18 5.32 6.32 3.32
13.63 6.95 5.84 6.53 1.83
13.02 18 .64 2.89 6.32 7.56
18
CHAPTER 1
Summ arizing Univariate Data
Descript iv e Statistics : LowAl titude, Hi Al t it ude Variable Mean SE Mean St Dev N LoA lt i tude 3 . 715 0 . 218 2.558 138 Hi Altitude 62 6 . 596 0 . 574 4. 519 Medi an Variab l e Min i mum 01 03 LoA lt i t ude 1 . 468 3 .180 5 . 300 0 . 250 5 . 750 Hi Alti t ude 1.110 3 .4 25 7.9 83
Maximum 11 . 230 23 . 380
FIGURE 1.4 MINITAB o utput presenting descriptive statistics for the PM data in Tables I . I and 1.2.
the re are several ways to compute these values. The differe nces are not large enough to have any practical importance. The summary statistics tell a lot about the differences in PM emissions between high- and low-alti tude vehicles. First, note that the mean is indeed larger for the highaltitude vehicles than for the low-altitude vehicles (6.596 vs. 3.7 15), which supports the hypothesis that emissions tend to be greater at high altitudes. Now note that the maximum value for the hi gh-altitude vehicles (23.38) is much higher than the max imum for the low-altitude vehicles ( 11.23). This shows that there are one or more high-altitude vehicles whose emissions are much highe r than the highest of the low-altitude vehicles. Could the difference in mean emissions be due entirely to these vehicles? To answer th is, compare the medians and the first and third qurutiles. These statistics are not affected much by a few large values, yet all of the m are noticeably larger fo r the high-altitude vehicles. Therefore, we can conclude that the high-altitude vehicles not only con tain a few very h igh emitters, they also have higher e missions than the low-altitude vehicles in general. Finally, note that the standard deviation is larger for the high-al titude vehicles, which indicates that the values for the high-altitude vehi cles are more spread out than those for the low-altitude vehicles. At least some of this difference in spread must be due to the one or more high-altitude vehicles with very high emissions.
Exercises for Section 1.2 1. A vendor converts the weights on the packages she sends out from pounds to kilograms (1 kg :=:::: 2.2 \b).
3. True or false: For any list of numbers, half of them wi ll be below the mean.
a. How does this affect the mean weight of the packages?
4. Is the sample mean always the most frequently occurring value? If so, explain why. If not, give an example.
b. How does this affect the standard deviation of the weights? 2. Refer to Exercise 1. The vendor begins using heavier packaging, which increases the weight of each package by 50 g. a. How does this affect the mean weight of the packages? b. How does this affect the standard deviation of the weights?
5. Is the sample mean always equal to one of the values in the sample? If so, explain why. If not, give an example. 6. Is the sample median always equal to one of the values in the sample? If so, explain why. If not, give an example. 7. Find a sample size for which the median will always equal one of the values in the sample.
1.2
8. For a list of positive numbers, is it possible for the standard deviation to be greater than the mean? lf so, give an example. Tf not, explain why not.
9. Is it poss ible for the standard deviation of a li st of numbers to equal 0? If so, give an example. If not, explain why not.
10. A sample of 100 adult women was taken, and each was ask ed how many children she had. T he resul ts were as follows:
Summary Statistics
19
e. Other things be ing equal, is it better for a meas urement method to have a smaller standard deviation or a larger s tandard deviation? Or doesn 't it matter? Explain.
13. Refer to E xercise 12. a. If the measurements for one of the methods were converted to inches ( I inch= 2.54cm), how would this affect the mean? The median? The standard deviation?
22 30 12 7 2
b. If each person rcmeasured the line, us ing a ruler marked in inches, would the effects on the mean, m edian, and standard deviation be the same as in part (a)? Explain.
a. Find the sample mean number of children.
14. There are I0 employees in a particular division
Children Numberof Women
0 27
2
3
4
5
b. Find the sample standard dev iation of the number of children. c. Find the sample median of the number of children. d. W hat is the first quartile of the number of children ?
of a company. Their salaries have a mean of $70 ,000, a median of $55,000, and a s tandard deviation of $60,000. The largest number on the lis t is $ 100,000. By accident, this number is changed to $ 1,000,000.
e. W hat proportion of the women had more than the mean number of children?
a. What is the value of the mean a!'ter the change?
f. For what proportion of the women was the number of children more than one s tandard deviation greater than the mean?
c. What is the value of the standard deviation after the change?
g. For what proportion of the women was the number of children within one standard dev iation of the mean? 11. In a sample of 20 men , the mean height was 178 em. In asamplc of 30 women, the mean height was 164cm. What was the mean height for both groups put together?
12. In a study of visual perception , fi ve people were asked to estimate the length of a line by eye and then to measure it with a ruler. The results, in em, were: By eye: 8.0, 9.0, 7.5, 9.5, 8.5 With a ruler: 8. 1, 8.2, 8. 1, 8.1, 8.3 a. Compute the mean measurement for each method. b. Compute the median measurement for each method. c. Compute the standard deviation of the m easurements for each method. d. For which method is the standard deviation the largest? Why should one expect thi s method to have the largest standard deviation ?
b. W hat is the value of the median after the change?
15. Quartiles divide a sample into four nearly equal pieces. In general , a sample of s ize 11 can be broken into k nearly equal pieces by us ing the cutpoints (i I k ) (11 +I) fori = 1, ... , k - I. Consider the following ordered sample: 2 18 23 41 44 46 49 6 1 62 74 76 79 82 89 92 95 a. Ter1i les divide a sample into thirds. Find the terti les of this sample. b. Quintiles divide a sample into fifths. Find the quintiles of this sample.
16. In each of the following data sets, tell whether the outlier seems certain to be due to an en·or or whether it could conceivably be correct. a. A rock is weighed fi ve times. The readings in grams are 48.5, 47.2, 4.91 , 49.5, 46.3. b. A sociologist samples five families in a certain town and records their annual income. The incomes are$34,000, $57,000,$ 13,000,$ 1,200,000, $62,000.
20
CHAPTER 1
Summarizing Univariate Data
1.3 Graphical Summaries Stem-and-Leaf Plots In addition to numerical summaries such as the mean , median, and standard deviation, g raphical summaries can be used to help visualize a list of numbers. We will begin by discussing a simple graphical summary known as the stem-and-leaf plot. As an exa mple, the data in Table 1.3 concern a study of the bioactivity of a certain antifungal drug. The drug was applied to the skin of 48 subjects. After three hours, the amount of drug rema ini ng in the skin was measured in units of ng/cm2 . The list has been sorted into numerical order. TABLE 1.3 Amount of drug in skin
3 15 22 27 40
4
16 22 33 41
4 16 22 34 41
7 17 23 34 51
7 17 24 35 53
R 18 25 36 55
9 20 26 36 55
9
20 26 37 74
12 21 26 3R
12 21 26 40
Figure 1.5 presents a stem-and-leaf plot of the data in Table 1.3. Each ite m in the sample is div ided into two parts: a stem, consisting of the leftmost one or two digits, and the leaf, which consists of the next digit. In Figure 1.5, the stem consists of the tens digit, and the leaf consists of the ones di git. Each line of the stem-and-leaf plot contains all of the sample items with a given stem. The stem-and-leaf plot is a compact way to represent the data. It also gives some indication of its shape. For these data, we can sec that there are equal numbers of subj ects in the intervals 0- 9, lO- J9, and 30-39, and somewhat more subjects in the inter val 20-29. In addition, the largest value (74) appears to be an outlier.
Stem
0 1 2 3 4 5 6 7
Leaf
34477899 22566778 001122 23456666 7 34456678 0011 1355
4
FIGURE 1.5 Stem-and-leaf plot for the data in Table 1.3 When there are a great many samp le items with the same stem, it is often necessary to assign more than one row to that stem. As an example, Figure 1.6 presents a computergenerated stem-and-leaf plot, produced by MINITAB, for the PM data in Table 1.2 in Section 1.2. The middle column, consisting of Os, 1s, and 2s, contains the stems, which
1.3
Stem-and-leaf of Hi Altitude Leaf Unit = 1.0 4
19 (14)
29 15 8 7 4
4 3 1 1
0 0 0 0 0 1 1 1 1 1 2 ?
Graphical Summaries
N
21
62
1111
222222223333333 44445555555555 66666666777777 8889999 0 233 7
89 3
FIGURE 1.6 Stem-and-leaf plot of the PM data in Table 1.2 on page 17, as produced by MIN !TA B.
are the tens digits. To the right of the stems are the leaves, consisting of the ones digits for each of the sample items. Since many numbers arc less than 10, the 0 stem must be assigned several lines, fi ve in this case. Specifically, the first line contains the sample items whose ones digits are either 0 or I , the next line contains the items whose ones digits are e ither 2 or 3, and so on. For consistency, all the stems are assigned several lines in the same way, even though there are few e nough values for the l and 2 stems that they could have fit on fewer Jines. The output in Figure l.6 contains a c umulative frequency colunm to the left of the ste m-and-leaf plot. The upper part of this column provides a count of the number of items at or above the current line, and the lower part of the column provides a cou nt of the numbe r of ite ms at or below the cunent line. Next Lo the l ine that contains the median is the count of items in that line, shown in parentheses. A good feature of stem-and-leaf plots is that they display all the sample values. One can reconstruct the sample in its e ntire ty from a stem-and-leaf plot-with one important exception: The order in which the items were sampled cannot be determined. Dotpl~ts
A dotplot is a graph that can be used to give a rough impression of the shape of a sample. It is useful when the sample size is not too large and when the sample contains some repeated values. Figure 1.7 (page 22) presents a dotplot for the data in Table 1.3. For each value in the sample, a verti cal column of dots is d rawn, with the number of dots in the column equal to the number of times the value appears in the sampl e. The dotplot gives a good indication of where the sample values are concentrated and where the gaps are. For exampl e, it is easy to see from Figure 1.7 that the sample contains no subjects with values between peliods between 42 and 50. In addition, the outlier is clearly visible as the rightmost point on the plol.
22
CHAPTER 1
Summarizing Univariate Data
• • • • •• •••• •• • •• ••• • •••••••••••• 0
10
20
• • •• •••••• •• 30
• • ••
40
50
• 60
70
80
FIGURE 1.7 Dotplot for the data in Table 1.3 .
Stem-and- leaf plots and dotplots are good methods for informally exami ning a sample, and they can be drawn fairly quickly with pencil and paper. They are rarely used in formal presentations, however. Graphics more commonly used in formal presentations include the histogram and the boxplot, which we will now discuss.
Histograms A histogram is a graphic that gives an idea of the "shape" of a sample, indicating regions where sample points are concentrated and regions where they are sparse. We will construct a histogram for the PM emissions of 62 veh icles dtiven at high altitude, as presented in Table 1.2 (Section 1.2). The sample values range from a low of 1.11 to a high of 23.38, in units of grams of emissions per gallon of fuel. The first step is to construct a frequency table, shown as Table 1.4.
TABLE 1.4 Frequency table for PM emissions of 62 vehicles driven at high altitude Class Interval (g/gal) l .:::; x<3 3,::: X< 5 5,::: X< 7 7.:::;x< 9 9,::: X < 11 1 1 ,:::X< 13 13 ,::: X < 15 15 ,::: X < 17 17,::: X< 19 19 .:::; x <21 21 ,:::X < 23 23,::: X < 25
Frequency 12 11
18 9 5 1 2 0 2 1
0
Relative Frequency 0.1935 0. 1774 0.2903 0. 1452 0.0806 0.0 161 0.0323 0.0000 0.0323 0.01 6 1 0.0000 0.01 61
The intervals in the left-hand column are called class intervals. They divide the sample into groups. For the histograms that we will consider, the class intervals will all have the same width. In Table 1.4, all classes have width 2. There is no hard and fast rule as to how to decide how many class intervals to use. In general, it is good to have more intervals rather than fewer, but it is also good to have large numbers of sample points in the intervals. Striking the proper balance is a matter of judgment and of trial and error. When the number of observati ons n is large (several hundred or more), some
1.3
Graphical Summaries
23
have suggested that reasonable starting points for the number of classes may be log2 11 or 2n 113 • When the number of observations is smaller, more classes than these are often needed. The column labeled "Freq uency" in Table 1.4 presents the numbers of data points that fall into each of the class intervals. The column labeled "R elative Frequency" presents the frequencies divided by the total number of data points, which fo r these data is 62. The re lative freque ncy of a class interval is the proportion of data points that fall into the inte rva l. Note that since every data point is in exactly o ne class interval, the relative freque ncies must sum to I (allowing for round-off error). Fig ure 1.8 presents a histogram for Table 1.4. The units on the horizontal axis are the units of the data- in thi s case, grams per gallon. Each class interval is represented by a rectangle. The heights of the rectangles may be set equal to the frequencies or to the relative frequencies. S ince these quantities arc proportional, the shape of the histogram wi ll be the same in eac h case. For the histogram in Figure 1.8, the heights of the rectangles are the relat ive freque ncies.
0.30
>.
u
l3
:::>
0.20
0'
!;!
LI.
-~
~ 0. 10 0::
o ~--~~--~~--~~--~~--~-L--~-L-
3
5
7
9
II
13
15
17
19
21
23
25
Emissions (g/gal)
FIGURE 1.8 Histogram for the data in Table 1.4. In this histogram the heights of the rectangles arc the relative frequencies. The frequencies and relative frequencies are proportional to each other, so it would have been equally appropri ate to set the heights equal to the frequencies.
To construct a histogram: •
Dete rmine the number of classes to use, and construct class intervals of equal width.
•
Compute the frequency and relative freq uency for each class.
•
Draw a rectangle for each class. The heights of the rectangles may be set equal to the frequencies or to the relative frequencies.
J.
24
CHAPTER 1
Su m marizing Univariate Dat a
Mean Median (a)
Mean Median (b)
Median Mean (c)
FIGURE 1.9 (a) A histogram skewed to the left. The mean is less than the median. (b) A nearl y symmetric histogram. The mean and median arc approximately equal. (c) A hi stogram skewed to the ri ght. The mean is greater than the medi an.
Symmet ry a nd Skewn ess A histogra m is perfectly symmetric if its rig ht half is a mitTor image of its left haJf. Histograms that are not symmetric are referred to as ske wed. In practice, virtuall y no sample has a perfectly symmetric histogram; almost all exhibit some degree of skewness. In a skewed hi stogram, one side, or tail, is longer than the othe r. A histogram with a long right-hand tail is said to be skewed to the right, or positively sl{ewed. A histogram with a lon g le ft-hand tail is said to be skewed to the left, or nega tively skewed. Whi le there is a formal mathemati cal me thod for mcasming the skew ness of a histogram, it is rarely used ; instead, people judge the degree of skewness informally by looking at the histogram. Figure 1.9 presents some histograms for hypothetical samples. Note that for a histogram that is skewed to the ri ght (Figure I .9c), the mean is greater tha n the median. The reason for th is is that the mean is ncar the center of mass of the histogram ; that is, it is near the point whe re the histogram would balance if supported there. For a histogram skewed to the light, more than half the data will be to the left of the center of mass. Similarly, the mean is less than the median for a h istogra m that is skewed to the left (Figure 1.9a). The histogram for the PM data (Figure 1. 8) is skewed to the right. The sample mean is 6.596, whic h is greater than the sample medi an of 5.75.
Unim oda l an d Bimod a l Hi st og ram s We have used the term " mode" to re fer to the most frequently occurring value in a sample. This term is also used in rega rd to h·i stograms and other curves to refe r to a peak , or local maximum. A histogram is u nimodal if it has only one peak, or mode, and bimoda l if it has two clearly distinct modes. Tn princ iple, a histogram can have more than two modes, but this does not happen ofte n in practice. The histograms in Figure 1.9 are all unimodal. Figure I . I 0 presents a bimodal histogram for a hypotheti cal sample. ln some cases, a bimodal histogram indicates that the sample can be di vided into two subsamples that clift'e r from each other in some scientifically important way. Each sample corresponds to one o f the modes. As an example, the data in Table 1.5 concern the geyser Old Faithful in Yellowstone National Park. This geyser alternates petiods of
1.3
Graphical Summaries
25
-
-
r--
r--
-
-
-
-
FIGURE 1.10 A bimodal histogram.
eruption, whic h typically last from 1.5 to 4 minutes, with periods o f dormancy, which are considerably longer. Table 1.5 presents the durations, in minutes, of 60 dormant pe ri ods. Along with the durati ons of the dormant period, the durati on of the eruption immediate ly preceding the dormant pe riod is classified either as short (less than 3 minutes) or long (more than 3 minutes). Figure l.lla (page 26) presents a histogram for all 60 d urations. Fig ures 1. 11 band l.llc present hi stograms for the durations following short and long eruptions, respectively. The histogram for all the durations is c learly bimodal. The hi stog rams fo r the durations fo llowing short or long eruptions are both uni mod al, and their modes form the two modes of the hi stogram fo r the full sample.
TABLE 1.5 Durations of dormant peri ods (in minutes) and of the previous eruptions of the geyser Old Faithful Dormant
Eruption
Dormant
Eruption
Dormant
Eruption
Dormant
Eruption
76 80 84 50 93 55 76 58 74 75 80 56 80 69 57
Long Long Long Short Long Short Long Short Long Long Long Short Long Long Long
90 42 91 51 79 53 82 51 76 82 84 53 86 51 85
Long Short Long Short Long Short Long Short Long Long Long Short Long Short Long
45 88 51 80 49 82 75 73 67 68 86
Short Long Short Long Short Long Long Long Long Long Long Long Long Long Short
84 70 79 60 86 71 67 81 76 83 76 55 73 56
Long Long Long Long Long Long Short Long Long Long Long Short Long Short Long
72
75 75 00
83
26
Summarizing Univariate Data
CHAPTER 1
15
15
15
12
12
r-
12 » u
»
u
9
c:
c:
"'
-
:::0 cr'
J:
6
:::0 cr'
1-
~
r-
r-f
c
1-
n
r-
40 45 50 55 60 65 10 75 go 85 9o 95 Duration ( minutes) (a)
J:
9
"'
"'
3 0
»
u
9
:::0 cr'
J:
6
6
3
3
0
0 Duration (minutes) (b)
Dural ion (mi nutes) (c)
FIGURE 1.11 (a) Histogram fo r all 60 durations in Table 1.5. T his hi stogram is bimodal. (b) Histogram for the durations in Table I .5 that follow short eruptions. (c) Hi stogram for the duratio ns in Table I .5 that follow long eruptions. The histograms for the durations following s hort eruptions and for those fo llowing lo ng eruptions arc both unimodal, but the modes are in different places. When the two samples are combi ned, the histogram is bimodal.
Box plots A boxplot is a graphic that presen ts the median, the first and th ird quartiles, and any outliers that are present in a sample. Boxplots are easy to understand, but there is a bit of terminology that goes with them. The interquartile range is the difference between the th ird quartile and the fi rst quartile. Note that si nce 75% of the data is less than the third quartile, and 25% of the data is less than the first quartile, it follows that 50%, or half, of the data is between the first and third quartiles. The interquartile range is the re fore the distance needed to span the middle half of the data. We have defined out! iers as points that are unusually large or smal I. If IQR represents the interquartil e range, then for the purpose of drawing boxplots, any point that is more than 1. 5 IQR above the third quartile, or more than I .5 IQR be low the first quartile, is considered a n outlier. Some texts define a point that is more than 3 lQR from the first o r third quartil e as an extreme outlier. These definitions of outli ers are just conventions for drawing boxplots and need not be used in other situations. F ig ure 1.12 presents a boxplot fo r some hypothetical data. T he plot consists of a box whose bottom side is the first quartile and whose top side is the third quartile. A horizontal line is drawn at the med ian. The "outliers" are plotted individuall y and are indicated b y crosses in the fig ure. Extendi ng from the top and bottom of the box are vertical lines called "whi skers." The whiskers end at the most extreme data point that is not an outlier. Apart from any o utliers, a boxplot can be thought of as having four pieces: the two parts of the box separated by the median line, and the two whiskers. Again, apart from ou tliers, each of these four parts represents one-quarter of the data. T he box plot therefore indicates how large an inte rval is s panned by each quarter of the data, and in this way it can be used to determine the regions in which the sample va lues are more densely crowded and the regions in which they are more sparse.
1.3
Grap hica l Sum maries
27
x - - - -- - --, Largest data point within - - -1.5 IQR of the third quartile Third Quanile
- .,
l r-------~-----.
Medi an -
f
1--- - - - - - ----11
I
Outliers
~
__j
Smallest data point within _ _ _ __ _, 1.5 IQR of the first quartile x X
FIGURE 1.12 A natomy of a box pl ot. Steps in the Construction of a Boxplot
•
Compute the median and the first and third quarti les of the sample. Indicate these w ith hori zontal lines. Draw vertical lines to complete the box.
•
Find the largest sample val ue that is no more than 1.5 IQR above the third quartile, and the smallest sample value that is no more than 1.5 TQR be low the first qu artile. Extend vertical lines (whi skers) from the quartile lines to these points.
•
Points more than 1.5 IQR above the third quartile, or more than 1.5 IQR be low the first quartile, are desig nated as o utliers. Plot each outl ier indiv idua lly.
Fig ure 1.1 3 (page 28) prese nts a boxp lot for the geyser data presented in Table 1.5. First note that there are no outliers in these data. Compming the fo ur pieces of the box plot, we can tell that the sample values are comparative ly densely packed between the median and the third quartile, and more sparse between the medi an and the first qua rtile. The lower whisker is a bit longer than the upper one, indicating that the data have a slig htly longer lower tail than an upper tail. Since the distance between the median and the first quartile is greater than the di stance between the median and the third quartile, and since the lower quarter of the data produces a longer whisker than the upper quarter, this boxplot s uggests that the data an~ skewed to the le ft. A hi stogram for these data was presented in Figure 1.11 a. The histogram presents a more general impression of the spread of the data. Im portantly, the histogram indicates that the data are bimodal , which a boxplot cannot do.
Compa rat ive Boxplots A useful feature of boxplots is that several of them m ay be placed side by side, allowing for easy visual compari son of the features of several samples. Tables 1.1 a nd 1.2 (in Section 1.2) presented PM e missions data for vehicles driven at high and low altitudes. Figure 1.14 (page 28) presents a side-by-side compari son of the boxplots for these two samples.
28
CHAPTER 1
Summarizing Univariate Data
100
90 Vi' :5 c
"' g c
I
80 70
.2
e :::>
0
60 50
40
FIGURE 1.13 Boxplot for the Old Faithful dormant period data in ·ntble 1.5.
25
X X X
20
....eo
X
~
~ "' c 0
15
"' "§
10
·;;;
UJ
5
I
I I I
I I
l
I
I
0 LowAiiitudc
High Altitude
FIGURE 1.14 Comparative boxplots for PM emiss ions for vehic les driven al high versus low altitudes.
The comparative boxplots in Figure 1.14 show that vehicles driven at low altitude tend to have lower emissions. In addition, there are several outliers among the data for high-altitude vehicles whose values are much higher than any of the values for the low-altitude vehicles (there is also one low-altitude value that barely qualifies as an outlier). We conclude that at high altitudes, vehicles have somewhat higher emissions in general and that a few vehicles have much higher e missions. The box for the high-alti tude vehicles is a bit taller, and the lower whisker a bit longer, than that for the low-altitude vehicles. We conclude that apart from the outliers, the spread in values is slightly larger for the high-altitude veh icles and is much larger when the outliers are considered. In Figure 1.4 (in Section I .2), we compared the values of some numerical descriptive statistics for these two samples and reached some conclusions similar to the previous
1.3
Graphical Summaries
29
ones. The visual nature of the comparative boxplots in Figure 1.14 makes comparing the features of samples much easier. We have mentioned that it is important to scrutini ze ou tliers to determine whether they have resulted from errors, in which case they may be deleted. By identifying outliers, box plots can be useful in this regard. The following example provides an illustration. The article "Virg in Versus Recycled Wafers for Furnace Qualification: ls the Expense Justified?" (Y. Czitrom and J. Reece, in Statistical Case Studies for industrial Process impro vement, ASA and Sl AM, 1997:87- 104) describes a process for grow ing a thin si Iicon dioxide layer onto silicon wa fers that are to be used in semiconductor manufacture. Table 1.6 presents thickness meas urements, in angstroms (A), of the oxide layer for 24 wafers. Nine measurements were made on each wafer. The wafers were produced in two separate runs, with 12 wafers in each run. TABLE 1.6 Oxide layer thicknesses for sil icon wafers Wafer
Thicknesses (A)
Run I
I 2 3 4 5 6 7 8 9 10 II 12
90.0 9 1.8 90.3 92.6 91.1 76.1 92.4 91.3 96.7 92.0 94.1 91.7
92.2 94.5 91.1 90.3 89.8 90.2 9 1.7 90.1 93.7 94.6 91.5 97.4
94.9 93.9 93.3 92.S 91.5 96.8 91.6 95.4 93.9 93.7 95.3 95. 1
92.7 77.3 93.5 9Ui 91.5 84.6 91.1 89.6 87.9 94.0 92.8 96.7
9 1.6 92.0 87.2 92.7 90.6 93.3 R8.0 90.7 90.4 S9.3 93.4 77.5
88.2 89.9 8S.I 91.7 93. 1 95.7 92.4 95.8 92.0 90.1 92.2 91.4
92.0 87.9 90.1 89.3 88.9 90.9 88.7 91.7 90.5 91.3 89.4 90.5
9S.2 92.8 91.9 95.5 92.5 100.3 92.9 97.9 95.2 92.7 94.5 95.2
96.0 93.3 94.5 93.6 92.4 95.2 92.6 95.7 94.3 94.5 95.4 93. 1
Run 2
1 2 3 4 5 6 7 8 9 10 II 12
93.0 91.4 91.9 90.6 93.1 90.8 88.0 RR.3 94.2 I01.5 92.8 92.1
S9.9 90.6 91.8 9 1.3 91.8 91.5 91.8 96.0 92.2 I 03.1 90.8 93.4
93.6 92.2 92.R 94.9 94.6 91.5 90.5 92.R 95.8 103.2 92.2 94.0
89.0 91.9 96.4 88.3 88.9 91.5 90.4 93.7 92.5 103.5 91.7 94.7
93.6 92.4 93.8 87.9 90.0 94.0 90.3 89.6 91.0 96.1 89.0 90.R
90.9 S7.6 R6.5 92.2 97.9 9 1.0 91.5 89.6 91.4 102.5 88.5 92.1
89.8 R8.9 92.7 90.7 92.1 92.1 89.4 90.2 92.8 102.0 87.5 91.2
92.4 90.9 90.9 91.3 91.6 91.8 93.2 95.3 93.6 106.7 93.8 92.3
93.0 92.S 92.8 93.6 98.4 94.0 93.9 93.0 91.0 105.4 91.4 91.1
The 12 wafers in each run were of several different types and were processed in several d ifferent furnace locations. The purpose in collecting the data was to determine whether the thickness of the oxide layer was affected by e ither the type of wafer or the fu rnace location. This was therefore a factorial experiment, with wafer type and furnace location as the factors and oxide layer thickness as the outcome. The experiment was intended to produce no syste matic difference in the thicknesses between one run and another. The first step in the analysis was to construct a boxplot for the data in each
30
CHAPTER 1
Summarizing Univariate Data
110 105 1X
~
100 IE 0 :;;eo 95 c:
~
..."'"'c:
90
.>< u
:c f-
$
!l5 1-
X
80 75 Run l
Run 2
FIGURE 1.15 Comparative boxplots for oxide layer th ickness.
ru n to h elp determine whether this conditio n was in fact met and whether any of the observations shou ld be deleted. T he results are presented in Fi g ure 1. 15 . The boxplots s how that there were severa l outl iers in each run . Note that apart from these outli ers, there are no striking differences between the sa mples and therefore no evidence of any systematic difference between the runs. T he next task is to inspect the outliers, to determine which , if any, s hould be deleted . By examining the data in Table 1.6, we can see that the eight larges t measurements in run 2 occurred on a s ingle wafer: number I 0 . It was then determined that th is wafer had been contaminated with a film residue, which caused the large thickness measurements. It wou ld therefore be appropriate to delete these meas urements. In the actual experiment, the engi neers had data from several other runs available, and for technical reasons, they decided to delete the entire run, rather than to anal yze a run that was mi ssing one wafer. In run I , the three s mallest m easure ments were found to have been caused by a malfunctioning gauge and were therefore appro pri ately deleted. No cause could be determined for the remaining two outliers in run 1, so they were included in the anal ysis.
Exercises for Section 1.3 1. As part of a qualily-control study aimed at improving
a production li ne, the weights (i n ounces) of 50 bars of soap arc measured. The resul ts are as follows, sorted from smallest to largest.
11.6 14.3 15.8 16.5 17.7
12.6 14.3 15.9 16.6 18.1
12.7 14.6 15.9 17.0 18.3
12.8 14.8 16.1 17.1 18.3
13.1 15.1 16.2 17.3 18.3
13.3 15.2 16.2 17.3 18.5
13.6 15.6 16.3 17.4 18.5
13.7 15.6 16.4 17.4 18.8
13.8 15.7 16.5 17.4 19.2
14. 1 15.8 16.5 17.6 20.3
a. b. c. d.
Construct a stem-and-leaf plot for these data. Construct a histogram for these data. Construct a dotplot for these data. Construct a box plot for these data. Does the boxplot show any outliers?
2. Forty-fi ve specimens of a certain type of powder were analyzed for sulfu r trioxide content. Following are the
1.3
results, in percent. The list has been sorted into numerical order.
Graphical Summaries
31
c. Using the boxplots, what differences can be seen between the results of the two methods?
16.6 17 .3 5. A certain reaction was run several times using each 17.2 17.3 of two catalysts, A and B. The catalysts were sup17.2 17.8 posed to control the yield of an undesirable side 17.2 2 1.9 product. Results, in units of percentage yield, for 24 17.2 22.4 runs of catalyst A and 20 runs of catalyst B are as follows: a. Construct a stem-and- leaf plot for these data.
14. 1 14.4 14.7 14.2 14.4 14.7 14.3 14.4 14.8 14.3 14.4 14.8 14.3 14.6 14.8
14.8 14.9 15.0 15.0 15.2
15.3 15.3 15.4 15.4 15.5
15.6 15.7 15.7 15.9 15.9
16.1 16.2 16.4 16.4 16.5
b. Construct a histogram for these data. Catalyst A
c. Construct a dotplot for these data. d. Construct a boxplot for these data. Does the boxplot show any o utliers? 3. Refer to Table .I .2 (page 17). Construct a stem-andleaf plot with the ones d igit as the stem (for values greater than or equal to 10 the stem will have two d igits) and the tenths d igit as the leaf. How many stems are there (be sure to include lealless stems)? What are some advantages and disadvantages of this plot, co mpared to the one in Fig ure 1.6 (page 2 1)? 4. Two methods were studied for the reco very of protein. Thirteen runs were made usi ng each method, and the fraction of protei n reco vered was recorded for each run. The results are as fo llows:
Method 1
Method 2
0.32 0.35 0.37 0.39 0.42 0.47 0.5 1 0.58 0.60 0.62 0. 65 0.68 0.75
0.25 0.40 0.4R 0.55 0.56 0.58 0.60 0.65 0.70 0. 76 0.80 0.91 0.99
4.4 4.9 4. 1 3.6 4.3 4.4
3.4 4.6 2.6 2.9 3.9 3. 1
2.6 5.2 6.7 2.6 4.8 5.7
3.8 4.7 4.1 4.0 4.5 4.5
Catalyst B
3.4 6.4 3.7
3.5 6.3
1.1 5.0 3.8 5.9 2.6
2.9 5.8 3. 1 6.7 4.3
5.5 2.5 1.6 5.2 3.8
a. Construct a histogram for the yields of each catalyst. b. Construct comparative boxplots for the yields of the two catalysts. c. Using the boxplots, what di fferences can be seen between the resul ts of the yields of the two catalysts? 6. Sketch a histogram for which a. T he mean is greater than the median. b. The mean is less than the median. c. The mean is approximate ly equal to the median. 7. The fo llowing histogram presents the distribution of systolic blood pressure for a sample of women. Usc it to answer the following questions.
a. Construct a histogram for the results of each method.
a. Is the percentage of women with blood pressures above 130 mm closest to 25%, 50 %, or 75%?
b. Construct comparative boxplots for the two methods.
b. In which interval are there more women: 130- 135 or 140- 150 mm?
32
Summarizing Univariate Data
CHAPTER 1
11. A sample of 100 men has average height 70 in. a nd
0.20
standard deviation 2.5 in. A sample of 100 women has average height 64 in. and standard deviation 2.5 in. If both samples are combined. the standard deviation of all 200 heights will be _ _ _ __
0.175 >.
u
0.15
c 0
cr 0.125 ~ 0.10
::>
1.
u. .,
·a>
0.075
;:x:
0.05
0
11. 111.
(flint: Don't do any ca lc ulations. Just try to ske tch, 90
110 130 140 Blood Pressure (nun)
very roughl y, histograms for each sample separately, and the n one for the combi ned sample .)
ISO
!!. The following hi stogram prescnls the a mounts of sil ver (in parts per mi llion [ppm]) found in a sample of rocks. One rectangle from the histogram is missing . Whai is its height? 0.4
12. Following arc boxplots comparing the c harge (in coulombs per mole [C/moll x 10- 25 ) at pH 4.0 and pll 4.5 for a collection of proteins (from the article "Optimal Sy nthesi s o fProtein Purification Processes," E. Vasquez-Alvarez, M . Leinqueo, and .1. P into, Riotecllllology Progress 2001 :6R5- 695). True or fal se:
0.35 >. u
.,c .,::>cr u:., ·~ 0"' ;:x:
a. The median c harge for the p H of 4.0 is greate r than the 75th percentile of charge for the p i I of 4 .5.
-
0.3
b. A pprox imately 25% of the c harges for pH 4 .5 are Jess than the sm alles t charge at pH 4.0.
0.25 0.2
-
0.15
c. About half the sample values for pH 4 .0 arc between 2 a nd 4 .
1-
d. There is a greater proportion of va lues outside the box for pH 4.0 than for pH 4.5 .
0.1 0.05
0
e. Both samples arc skewed to the right. 0
2 3 4 Silver (ppm)
s
f. Both samples contain outliers.
6
12
9. An e ng ineer wants to draw a box plot fo r the fo llow ing sample:
10
37 82 20 25 3 1 10 4 1 44 4 36 68 W hich of these values, if a ny, will be labeled as outliers?
8
~0
..c
10. Whic h of thc follow ing stat istics cannot be determined from a boxplot? 1. 11.
111.
equal to 2.5 in.
iv. can' t tell from the informaiio n given
0.025 0
less than 2.5 in. greater than 2 .5 in.
T he median T he mean T he first quartile
iv. T he third quartile v. T he intcrquarti1c range
u
-
6 4 2
0
I pH =4.0
pH =4.5
Supplementa ry Exercises for Chapter 1
a. Compute the intcrquarti le ranges for both A and B .
13. Following arc summary statistics for two data sets, A and B .
A 0.066 1.42 2.60 6.02 10.0 8
Minimum l st Quartile Median 3rd Quartile M ax imum
33
b. Do the summary statistics for A provide enough infor mation to construct a box plot? If so , construct the box plot. rr not. explain why.
B -2.235 5.27 8.03 9. 13 10. 5 1
c. Do the summary statis tics for 8 provide enough information to construct a box plot? If so , construct the box plot. If not, explain why.
14. Match each his togram Lo the boxplot that represents the same data set.
(a)
(b)
(c)
(d)
(I )
(2)
(3)
(4)
15. R efer to the asphalt data in Example 1.8 (page 16).
nearest quartile is more than 1.5 IQR. A more general , and less precise, definition is that an outlier is any point that is detached from the bulk of the data. Are any points in the asphalt data set outliers under this more general defini tion but not under the box plot de finiti on? Jf so, which are they?
a. Construct a boxplot for the asphalt data. b. Which values, if any, are outliers? c. Construct a dotplot for the asphalt data. d. For purposes of constructing boxplots, an outli er is defined to be a point whose dis tance from the
Supplementary Exercises for Chapter l. In a certain company, every worker received a 5% raise. How does this affect the mean salary? The standard deviation of the salaries? 2. Suppose that every worker in a company received a $2000-per-ycar raise. I low docs this affect the mean salary? The standard deviation of the salaries? 3. Integrated circuits consist of e lccttic channels that are etched onto silicon wafers. A certain proportion of circuits are defective because of "undercutting," wh ich
~ occurs when too much material is etched away so that the channels, which consist of the unetched portions of the wafers, arc too nan·ow. A redesigned process, involving lower pressure in the etch ing chamhcr, is being investigated. The goal is to reduce the rate of undercutting to less tnan 5%. Out of the first 100 circuits manu factured by the new process, only 4 show evidence of undercutting. True or false : a. S ince onl y 4% oft h e 100 circuits had undercutting, we can conclude that the goal has been reached.
34
CHAPTER 1
Summarizing Univariate Data
b. Although the sample percentage is under 5%, this n1ay represent sampling variation. so the goal may not yet be reached. c. There is no usc in testi ng the new process, because no matter what the result is, it could just be due to sampling variation. d. If we sample a large enough number of circuits, and if the percentage of defective circuits is far enough below 5%, then it is reasonable to conclude that the goal has been reached.
a. Is it possible to detennine by how much the mean changes? If so, by how much does it change? b. Is it possible to determine the value of the mean after the change? If so, what is the value? c. Is it possible to determine by how much the median changes? If so, by how much does it change? d. Is it possible to determine by how much the standard deviation changes? If so , by how much does it change?
8. The article "The Selection of Yeast Strains for the Pro-
4. A coin is tossed twice and comes up heads both times. Someone says, 'There's something wrong with this coi n. A coi n is supposed to come up heads only half the time, not every time."
a. Is it reasonable to conc lude that something is wrong with the coin? Explain. b. If the coin came up heads I 00 times in a row, would it be reasonable to conclude that something is wrong with the coin? Explain .
5. The smallest number on a list is changed fro m 12.9 to l.29.
ducti on of Premium Quality South Afri can Brandy Base Products" (C. Steger and M. Lambrechts, Journal of Industrial Microbiology and Biotechnology, 2000:43 1- 440) presents detailed information on the volatile compound compos ition of base w ines made from each of 16 selected yeast strains. t=ollowi ng are the concentrations of total esters (in mg/L) in each of the wines.
2R4.34 173.01 229.55 3 12.95 2 15.34 188.72 144.39 172.79 139.38 197.81 303.28 256.02 658.38 105.14 295.24 170.4 1
a. Is it possible to determine by how much the mean changes? If so , by how much does it change?
a. Compute the mean concentration.
b. Is it possible to determine by how much the median changes? If so , by how much docs it change? What if the list consists o f on ly two numbers?
c. Com pute the first quartile o f I he concenlrations.
c. Is it poss ible to determine by how much the standard deviation changes? If so, by how much docs it change?
6. T here are 15 numbers on a list, and the smallest number is changed from 12.9 to 1.29.
a. Is it possible to determine by how much the mean changes? If so , by how much does it change?
b. Compute the median concentration. d. Compute the third quarti le of the concentrations. e. Construct a boxplo t for the concentrations. What features does it reveal?
9. Concerning the data represented in the following boxplot, which one of I he following statements is true? i. The mean is greater than the med ian. ii. The mean is less than the median. iii. The mean is approximate ly equal to the median.
b. Is it possible to determine the value of the mean after the change? If so, what is the value? c. Is it possible to determine by how much the median changes? If so, by how much does it change? d. Is it poss ible to determine by how much the standard deviation changes? If so, by how much does it change?
7. There arc 15 numbers on a list, and the mean is 25 . The s mallest number on the list is changed from 12.9 to 1.29.
X
Supplementary Exercises for Chapter 1
10. In the article "Occurrence and Distribution of Ammon ium in Iowa Groundwater" (K. Schilling, Waler £nvimnme111 Research, 2002: J77-186), ammonium conce ntrations (in mg/L) were measured at a total of 349 alluvial wells in the state of Iowa. The mean concentration was 0.27, the med ian was 0. I0, and the standard deviation was 0.40. If a histogram of these 349 measurements were drawn,-------1. 11. 111.
it would be s kewed to the right. it would be skewed to the left. it would be approximately symmetric.
v. its shape could not be determined w ithout knowing the relative frequencies.
11. The article "Vehicle-Arrival Characteristics at Urban Uncontrolled Intersect ions" (V. Rengaraju and V. Rao, .loumal ufTransporrarion Engineering, 1995: 3 17-323) presents data on traffic characteristics at I 0 intersections in Madras, India. One characteristic measured was the speeds of the vehicles traveling throug h the intersections. The accompanying table gives the 15th, 50th, and R5th percentiles of speed (in km/h) for two intersecti ons.
0.525, O.R75, and 1.000. Construct a table presenting freq uencies, relative rrequencies, cumulative frequencies, and cumulative relative frequencies, for the data in Exercise I of Section 1.3, using the class intervals [) :::0 X< 12, 12:::0 X< J3, ... , 20:::0 X< 21.
13. The art ic le "The Ball-on-Three- Ball Test for Tensi le S trength: Relined Methodology and Results for Th ree 1-Io hokam Ceramic Types" (M. Beck, American Antiquity, 2002:558-569) discusses the strength of ancient ceramics. Several specimens of each o f three types of ceramic were tested. The loads (in kg) required to crack the specimens are as follows:
Ceramic Type
15th
50th
85th
A B
27 .5 24.5
37.5 26.5
40.0 36.0
loads(kg)
Sacaton
15 30 5 1 20 17 19 20 32 17 15 23 19 15 18 16 22 29 15 13 15
Gila Plain
27 34 28 9
CasaGrande
20 16 20 36 27 35 66 15 18 24 2 1 30 20 24 23 2 1 13 21
Percentile Intersection
35
18 23 26 31
28 30 17 19
25 20 19 27
55 30 16 20
21 31 24 43
Ill 25 19 15
a. Construct compara tive boxplots fo r the three samples. b. How many outliers does each sample contain?
a. If a histogram for speeds of vehicles through intersection A were drawn, d o you think it would be skewed to the left , skewed to the right, or approximately symmetric? Explain.
b. If a histogram for speeds of vehicles through intersection B were drawn, do you think it would be skewed to the left, skewed to the right, o r approximately sy mmetric? Explain. 12. The cumulative ji-equency and the CliiiiLIIarive relative frequency for a g iven class interval are the sums of the frequencies and relati ve frequencies, respectively, over all classes up to and including the given class. For example, if there are fi ve classes, with frequencies 11, 7, 3, 14, and 5, the cumulative frequencies would be II , 18, 2 1, 35, and 40, and the cumulative relative frequencies would be 0.275, 0.450,
c. Comment on the features of the three samples.
14. The article " Hydrogeochemical Characteristics of Groundwater in a Mid- Western Coastal Aquifer System" (S. Jeen, J. Kim, ct al., Geosciences JourIWI, 2001 :339-34R) presents measurements of various properties of shallow g roundwater in a certain aquifer system in Korea. Following arc measurements of electrical conductivity (in microsiemcns per centi meter) for 23 water samples. 2099 1265
488 461
528 2030 375 424 200 215 500
1350 789
486
a. Find the mean. b. Find the standard deviation.
10 18 RIO 257
384 522 557
1499 5 13 260
36
CHAPTER 1
Summarizing Univariate Data
c. Find the median.
h. Constmct a boxplot.
d. Construct a dot plot.
i. Which of the points, if any, are outliers? j. If a histogram were constructed, would it be skewed to the left , skewed to the right, or approximately symmetric?
c. Find the first quartile. f. Find the third quartile. g. Find the interquartile range.
Chapter
Summarizing Bivariate Data Introduction Scientists and engineers often collect data in order to determine the nature of a relationship between two q uanti ties. For example, a chemical e ngineer may run a chemical process several times in order to study the relati onship between the concentrat ion o f a certa in catalyst and the yield of the process. Each time Lhe process is run, the concentration x and the yield y arc recorded. T he experiment thus generates a collection of ordered pairs (x 1, y 1), . .. , (x,, y,), where n is the nu mber of nm s. Data that consist of ordered pail"S are c alled bivariate data. ln ma ny cases, ordered pairs generated in a scientific ex periment tend to cluster around a straight line when plotted. Tn these situations, the ma in question is usuall y to determ ine how closely the two q uantities are related to each other. The summary statistic most often used to measure the closeness of the association between two vari ables is the correlation coefficient, which we will study in Section 2.1. When two variables are closely related Lo each other, it is often of interest to try to predict the value of one of them when given the value of the other. This is often done with the equation of a line known as the least-squares line, which we wil l study in Sections 2.2 and 2.3.
2.1
The Correlation Coefficient The a1ticle "Advances in Oxygen Equivalence Equations for Predicting the Properties of Titanium Welds" (D. Harwig, W. lttiwattana, and H. Castner, The Welding Journal, 2001 : l26s- 136s) p resents data concerni ng the chemical composition and strength characteristics of a num ber of titanium welds. One of the goals of the research reported in this artic le was to discover factors that could be used to predict the strength of welds. Figure 2.1 a (page 38) is a plot of the yield strength (in thousands of pounds per square 37
CHAPTER 2
38
Summa rizing Bivariate Data
80
80
• 75
~
70
• •
-5 00
g "
65
V)
:9
~
60 55
•
•
•
•
•
•
•
•
•
••
•
• • •
• 0.01
0.015
·v; ~
0.02
"g
•
65
til
"ii 60
• •••
;,:;
•
••
70
-5 00 "0
•
• •
so
• • • •• • • •
75
•
~
·;:;;
•
•
55
•• • ••
••
•• •
•
~
o.ms
Carbon Content (%) (a)
0.03
50
0
0.02
0.04
0.06
0.08
Nitrogen Content(%) (b)
FIGURE 2.1 (a) A scallerplot showing that there is not much of a relationship between carbon content and yield strength for a certain group of welds. (b) A scatterplot showing that for these same welds, higher nitrogen content is associated with higher yield strength.
inch fksi]) versus carbon content (i n %) for some of these welds. Figure 2.lb is a plot of the yield strength (in ksi) versus nitrogen content (in %) for the same welds. Figures 2 .1 a and 2. 1b are examples of scatterplots. When data consist of ordered pairs, a scatterplot is constructed simply by plotting each point on a two-dimensional coordinate syste m. The scatterplot of y ield strength versus nitrogen conten t (Figure 2.1 b) shows some clear structure-the points seem to be following a line from lower left to upper right. In this way, the scatte rplot illustrates a relationship between nitrogen content and yield strength: Welds with higher nitrogen conte nt tend to have higher yield strength. This scatterplot might lead investigators to try to predict strength from nitrogen content. Tn contrast, there does not seem to be much structure to the scatterplot of yield strength versus carbon content (Figure 2 .1 a), and thus there is no evidence of a relationship between these two quant ities. This scatterplot would discourage investigators from trying to predict strength from carbon content. Looking again at Figure 2. 1b, it is apparent that the point<; tend to follow a line with positive slope. Figure 2.2 presents the scatte rplot with a line drawn through it. lt is clear that the points tend to cluster around this line. This line is a special line known as the least-squares line. It is the line that fits the data best, in a sense to be described later. We wi ll learn how to compute the least-squares line in Section 2.2. In general, the degree to whi ch the points in a scatterplot tend to cluster around a line reflects the strength of the linear relationship between x andy. We would like a way to measure the stre ngth of this linear relationshi p. The visual impression of a scattcqJlot can be misleading in this regard, because changi ng the scale of the axes can make the c lustering appear tighter or looser. For this reason, we define the con-elation coefficient, wh ich is a numeri cal measure of the strength of the linear relationship between two
2.1
The Correlation Coefficient
39
80
• 75 v;-
0.
g 70 -5
eo c:
g
65
(/)
"0
03 ::;:: 60
55
so
"' 0
0.02
0. 0~
0.06
Nitrogen Content (%)
FIGURE 2.2 Yield strength versus nitrogen content for a sample of welds. The least-squares line is superimposed.
variables. T he correlation coefficient is usually denoted by the lette r r . There are several eq uivalent fmm ulas for r . T hey are all a bi t compli cated, and it is not immediately obvious how they work. We wil l present the formul as, then show how they work. Let (x 1, y 1), • •. , (x,, y,) represent n points on a scaller plot. To compute the con·elation, ftrst compute the deviations of the xs and ys, that is, x; - x and y; - y, for each x; and y;. The correlation coeffi cient is given by (2. 1)
By performing some algebra on the numerator and denom inator o f Equation (2.1), we obtain an equivalent fom1ula that is often easiest to use when computing by ha nd: (2.2)
ll is a mathematical fact that the correlation coefficient is always between -I and I. Positive values of the correlation coefficient indicate that the least-squares line has a positi ve slope, which means that greate r values of one variable are associated with greater values of the other. Negative values of the correlation coeffic ien t indicate that the least-squares line has a negative slope, which means that greater values of one variable are associated with lesser values of the other. Values of the correlation coeffic ient close to I or to - I indicate a strong linear relationship; values close to 0 indicate a weak linear relationship. The con·elation coefficient is equal to 1 (or to - I) only when the points in the scatterplot lie exactly on a straight line of positive (or negative) slope- in other words, when there is a perfect linear relationship. As a tec hnical note, if the points lie exactl y on a hori zontal or a vertical line, the conclation coefficient is undefined,
.. 40
CHAPTER 2
Summarizing Bivariate Data
because the denominator in the formu la is equal to zero. Finall y, a bi t of terminol ogy: Whenever r =;f 0, .r and y are said to be correlated. If r = 0, .x and y are said to be uncoiTelated. The corre lation between nitrogen content and yield strength in Figure 2. 1b is r = 0.92. The correlation between carbon conte nt and y ield strength in F igure 2. 1a is r = - 0.16. We can interpret these results by saying that nitrogen content and yield strength have a strong positive Iinear re lationship, while carbon content and yie ld streng th have a weak negative linear relationship.
How the Correlation Coefficient Works How does the fo rmula (Eq uati on2. 1) for the corre lation coefficien t r measure the strength of the linear association between two variables? First, note that the denominator of the express ion in Equation (2.1 ) is always positive, so the sign of the corre lation coeffi cient is the same as the sign of the numerator, wh ich is L;;'=1(x; -x)(y;- )'), the su m oft he products of the deviations. Figure 2.3 now illustrates bow the cmTelation coefficient works. ln this scatterplot, the origin is placed at the point of averages (x, )') .There fore, in the first quadrant, the deviations (x; -x) and (y;- )')are both positive, so their product is positive as wel l. Thus, each point in the first quadrant contributes a positive amoun t to the sum in Equation (2. 1). In the second quadrant, the deviations for the x-coordinates of the points are negative, w hile the deviations for they-coordinates are positive. Therefo re, the products of the deviations are negative, so each point i n the second quadrant contributes a negative amount to the sum in Equation (2. J ). Similarly, points in the thi rd quadrant contribute positive amounts, and points in the fourth quadrant contribute negati ve amounts. Clearly, in Fig ure 2.3 there are more points in the first and third quadrants than in the second and fourth, so the correlation will be positive. Tf the plot had a negative slope, there would be more points i n the second and fourt h quadrants, and the correlation coefficient would be negati ve.
x; - x is -
.r;- .\'is+
J; -
Y; -
y is+
y is+ Product is+
Producl is-
.. . .. .... ' • ••
••
• • • • •• • •• .~
•• •• •
-'"i -
.Y i ~
Y;- yis -
Product is +
• •
_\' is + y is Product is -
.r; -
Yi
FIGURE 2.3 How the corre lation coefficient works.
2.1
The Correlation Coefficient
41
The Correlation Coefficient Is Unitless Examination of Equation (2.1) shows that the numerator and the denominator have the same units -both are units of .r multiplied by uni ts of y. Fo r Lllis reason, the correlation coeffic ien t is unitless. This fact is important to the usefulness of r , because it allows us to compare the strengths of the linear relati onships between I wo plots even when the units of the quantities o n one plot diffe r from the units of the quantiti es on the other. Another important property of the correlation coeffic ient is that it is unaffected by changes in scale. This means that if each x; or each y; is mul tiplied by a positi ve constant, the value of the correlation coefficient will be unchanged. As a result, the value of the corre lation coefficient docs not depend on the units of .r or of y. In addition, the value of the con·eJation coefficient is unchanged if the same constant va lue is added to each x ;, or to each )';, or to both. The reason is that the correlati on coefficient depends o nl y on the deviations x; - x and y; - y. Finally, it can be seen from Equation (2. 1) that interchanging the values of x and y does not change the value of the correlation coeffic ient.
The correlation coeffi cient remains uncha nged under each of the followi ng operations: •
Multiplying each va lue of a variable by a positive co nstant.
•
Adding a constant to each va lue of a variable.
•
Interchang ing the values o f x and y.
Fig ure 2.4 (page 42) presents plots of mean temperatures for the months of April and October for several U.S. c ities. W hether the temperatures are measured in °C o r °F, the correlation is the same. The reason is that converting from °C to ° F invol ves multiplying by 1.8 and addi ng 32.
The Correlation Coefficient Mea su res Only Linear Association An object is fi red upward from the ground with an initial velocity of 64 ft/s. At each o f several times x 1 , ••• , .x11 , the heig hts y 1 , ••• , )111 ofthe object above the surface of the earth are measured. ln the absence of fi·icti on, and assuming that there is no measure ment error, the scallerplot of the points (x 1 , y 1), ••• , (x11 , )'11 ) will look like Figure 2.5 (page 42). T he plot shows a strong relationship between x and y; in fact, the value of y is determined by x through the equatio n y = 64x - 16x 2 . Yet the conelation between x and y is eq ual to 0. Ts something wrong? No. The value of 0 fo r the correlation indicates that there is no linear relationship between x and y, which is true. T he relationship is purely quadratic. T he lesson of thi s example is that the conelation coefficient should not be used whe n the points on a scatte rpl ot tend to follow a curve. The results can then be misleading.
42
CHAPTER 2
Summarizing Bivariate Data
E ~
::>
80 70
'§
"E ~ ...
0.
60
"
50
0
40
..0 0
u
••
•
••
....
. •• •
G:' 80
••
~
70
~0.
60
::>
• •
E
~
...
g"
50
0
40
..0
u
,-
40
50
••
~
60
80
70
• •• 0
5
April temperature (°F)
G 25
~
~
20
::>
'§ 15
"0.
E
~
... g"
..0 (J
0
10 5
••
• •
.... •
• •• •• •
••
G
~
~
20
25 20
.. ..
::1
"E
0.
~
...
60
•
15
'§ 15
0 50
10
••
25
April temperature ("C)
70
• • •
10
ll0
5
0
0
u
40
..
• •
•• • ••
80
•• 0
5
10
• •• •• •
15
••
20
25
April temperature (0 C)
April temperature (° F)
FIGURE 2.4 Mean April and October temperatures for se veral U.S. cities. The correlation cocffit:ie nt is 0.96 for each plot; the choice of units does not matter. 70 60 50
g
•
·~·
•
• • •
•
•
20
0
•
•
30
10
••••
•
40
.E
:I:
•
••
, 0
•
• r
, 2
3
4
Time (s)
FIGURE 2.5 T he relationship between the he ight of a free falling object with a positive initial velocity and the time in free fall is quadratic. T he correlation is equal to 0.
Outliers In Figure 2.6, the point (0, 3) is an outlier, a point that is detached from the main body of the data. The cotTelation for this scatterplot is r = 0.26, which indicates a weak linear relationship. Yet 10 of the 11 points have a pelfect linear relationship. Outliers
2.1
3
The Correlation Coefficient
43
•
2.5 2
1.5
0.5
•
0 0
•
•
•
0.5
•
•
•
•
1.5
•
•
2
FIGURE 2.6 The correlation is 0.26. Because of the outlier, the correlation coefficient is misleading.
can greatly distort the correlation coefficient, especially in small data sets, and present a serious problem for data analysts. Some ou tliers are caused by data-recording en·ors or by failure to foll ow experime ntal protocol. It is appropriate to correct these outliers when possible or to delete them if they cannot be corrected. It is tempti ng to delete outliers from a plot without cause, simpl y to make the plot easier to inte rpret. This is not appropriate, because it results in an underestimation of the variability of the process that generated the data. Interpreting data that contain ou tliers can be difficult, because there arc few easy rules to follow.
Correlation Is Not Causation For children, vocabul ary size is strongly correlated with shoe size. However, learning new words docs not cause feet to grow, nor do growing feet cause one's vocabulary to increase. There is a third factor-age-that is correlated with both shoe size and vocabulary. Older children tend to have both larger shoe sizes and larger vocabularies, and this resu lts in a positive correlation between vocabul ary and shoe size. Th is phenomenon is known as confounding. Confounding occurs when there is a third variable that is correlated with both of the variables of interest, resu lting in a correlation between them. To restate thi s example in more detail: Individuals with larger ages tend to have larger shoe sizes. Tndividuals with larger ages also tend to have larger vocabularies. Tt follows that indi viduals with larger shoe sizes will tend to have larger vocabularies. Tn other words, because both shoe size and vocabulary are positively conelatcd wi th age, they are positively conelated with each other. In this example, the confounding was easy to spot. Tn many cases, it is not so easy. T he example shows that simply because two variables are co rrelated with each other, we cannot ass ume that a c hange in one will tend to cause a change in the other. Before we can conclude th at two variables have a causal relationship, we must rule out the possibi lity of confounding.
44
CHAPTER
2
Summarizing Bivariate Data
When planning a scientifi c expetiment, it is important to design the experiment so as to reduce the possibility of confounding by as much as is practical. The topic of experimental design (see Chapter 9) is largely conccmed with this topic. Here is a simple example.
..
Example
An environmental scientist is studying the rate of absorption of a certain chemical into skin. She p laces differing volumes of the chemical on differe nt pieces of skin and allows the skin to remain in contact with the chemical for varying lengths of time. She then measures the volume of chemical absorbed into each piece of skin. She obtains the results shown in the following table.
Volume (ml)
Time (h)
Percent Absorbed
0.05 0.05 0.05 2.00
2 2
48.3 51.0 54.7
2 10 10 10 24 24 24
2 .00
2.00 5.00 5.00 5.00
63.2
67.8 66.2 83.6 85.1 87.8
The scientist plots the percent absorbed against both volume and time, as shown in the foll owi ng figure. She calculates the correlation between volume and absorption and obtains r = 0.988. She concludes that increas ing the volume of the chemical causes the percentage absorbed to increase. She then calculates the corre lation between Lime and absorption, obtaining r = 0.987. She concl udes that increasing the time that the skin is in contact with the chemical causes the percentage absorbed to increase as we ll. Are these conclusions justified? 90
90
•
•
I
..,
"0
80
..,
"0
-e
Sl 70
~ c..
40
"' 70
~
I
"' "'
0..
50 2 3 Volumc(mL)
•
l:! 60
• c! 0
I
"' ;:
•
60 50
80
-e0
~
"'.., ;:
I
4
5
40 0
• •• 5
10
15
Time (h)
20
25
2.1
The Correlation Coefficient
45
Solution No. The scientist shoullllook at the plot of time versus volume, presented in the following fi gure. The corre lation between time and volume is r = 0.999, so these two variables arc a lmost completely confounded. 1f either time or volume affects the percentage absorbed, both will appear to do so, because they are highly conelated with each other. For thi s reason, it is impossible to determ ine whether it is the time or the volume that is having an effect. T his relat ionship between time and volume resulted from the design of the experiment and should have been avoided.
25
•
20
g
15
(.)
E
f= 10
•
5 0
• ()
2
3
4
5
Volume (mi.)
Example T he scientist in Example 2. 1 has repeated the experi ment, thi s time with a new design. The results arc presented in the following table.
Volume (ml)
Time (h)
Percent Absorbed
0.05 0.05 0.05 2.00 2.00 2.00 5.00 5.00 5.00
2 JO 24 2 10 24 2 10 24
49.2 5 1.0 R4.3 54.1 68.7 87.2 47.7 65.1 88.4
T he scientist plots the percent absorbed agai nst both volume and Lime, as shown in the following fi gu re.
46
CHAPTER 2
Summarizing Bivariate Data
100
100
90 ""0
-e"' 0
"'
..0
c"'
..."'~
~
80
•
90
•
•
.e ~
..0
70
•
50 40
.,"'c .,~
•
60
~
I 0
• 4
3
80 70
••
60
•
50
•
2
••
""0
40
5
•
I
0
5
10
15
20
25
Time (h)
Volume (mL)
She then calcul ates the cone lation between volume and absorption and obtains 0.12 1. She concludes that inc reasing the volume of the che mical has little or no effect on the percentage absorbed. She the n calculates the corrclation between time and absorption and obta ins r = 0.952. She concludes that increasing the t ime that the sk in is in contact with the chemical will cause the percentage absorbed to increase. Arc these conclusions justified?
r
=
So l ution
T hese conclusions are much beller justified than the ones in Example 2. 1. To see why, look at the plot of time versus volume in the foll owing fig ure. This expetiment has been designed so that time and volume are uncorrelated. It now appears that the time, but not the volume, has an effect on the percentage absorbed. Before maki ng a final conclusion th at increasing the time actuall y causes the percentage absorbed to increase, the scie ntist must make sure th at no other potential confounders are around. For example, if the ambient temperature varied with each replication of the experiment and was highly correlated w ith time, then it might be the case that the temperature, rather than the time, was causing the percentage absorbed to vary.
25
•
•
•
•
•
•
20
5.,
15
E
E= 10
5 0
•
•
0
2
3 Volume(mL )
• 4
5
2.1
The Correlation Coefficient
47
Controlled Experiments Reduce the Risk of Confounding In Examples 2.1 and 2.2, the experimenter was able to reduce confounding by choosing values for volume and time so that these two variables were unco rrelated. This is a controlled experiment, because the experimenter could choose the values for these factors. In controll ed experiments, confounding can often be avoided by choosing values for factors in a way so that the factors are uncorrelated. Observational studi es are studies in which the values of fac tors cannot be chosen by the experimenter. Studies invol ving public health issues, such as the effect of environmental pollutants on human health, are usually observational, because experimenters cannot deliberately expose people to high levels of pollution. In these studi es, confounding is often difficult to avoid. For example, people who 1ive in areas wi th higher levels of pollution may lend to have lower socioeconomic status, which may affect their health. Because confounding is diffi cult to avoid, observational studi es must generally be repeated a number of times, under a variety of conditi ons, before rei iab le conc lusions can be drawn.
Exercises for Section 2.1 1. Compute the con·elation coeffi c ient for the following data set.
xl l 2 3 4 5 y2 14 37 2. For each o f the following data sets. explain why the correlation coefficient is the same as for the data set in Exercise I.
2
a.
b.
c.
3 4
... .. ..
y
. ..
5
2 8 6 14 X
...
(b)
13 23 33 43 53 4
2
8
X
I3
2
5 4
y
2
4
6
6
14
..··
8
8 JO
3. For each of the following scatterplots, stale whether the correlation coefficient is an appropriate summa ry, and explain briefly.
..
. (c)
..
·.
4. True or false, and ex plain briefly: a. If the con·elation coefficient is positive, then aboveaverage values of one variable arc associated with above-average values of the other.
·' (a )
b. If the correlation coefficient is negative, then below-average values of one vari able are associated with below-average values of the other.
48
CHAPTER 2
Summarizing Bivariate Data
c. If the correlatio n betwecn.r andy is positive, the n x is usually g reater than y. 5. An investigator collected data on heights and weights of college students. The correlation between height and weight for men was about 0.6, and for women it was about the same. If men and women are taken together, wi II the correlation bet ween height and weig ht be more than 0.6, less than 0.6, or about equal to 0.6? It mig ht be helpful to make a rough scatterplot. 6. In a laboratory test of a new engine design , the em issions rate (in mg/s of oxides of nitrogen, NO,) was measured as a fu nction of engine speed (in rpm). The results are presented in the fo llowing table. Speed ~missions
167 1.8 1532.R 1595.6 14R7.5 1432.3 1622.2 1577.7 323.3 94.6 149.6 60.5 26.3 158.7 106.0
a. Compute the correlation coefficient between emjss iuns and speed. b. Construct a scattcrplot fur these data. c. Is the correlation coefficient an appropriate summary for these data? Exp lain why or why not. 7. II. chemical engineer is studyi ng the effect of temperature and stirring rate on the yield of a cert ain product. The process is run 16 times, at the settings indicated in the followin g table. T he units for yield are percent of a theoretical maximum.
Temperature (o()
Stirring Rate (rpm)
Yield (%)
110 110 Ill Ill 11 2 112 114 I 14 11 7 117 122 122 130 130 143 143
30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
70.27 72.29 72.57 74.69 76.09 73. 14 75.61 69.56 74.4 1 73.49 79.18 75.44 81.71 83.03 76.9ll 80.99
a. Compute the correlation between temperature and yie ld, between sl itTing rate and yield, and between temperature and stirring rate. b. Do these data provide good evidence that increasing the temperature causes the y ield to increase, w itrun the range of the data? Or might the resu lt be due to confounding? Explain. c. Do these data provide good ev idence that increasing the stirring rate causes the yield to increase, withi n the range of the data? Or might the result be due to confounding? Expla in.
8. Another che mical engineer is studying the same process as in Exercise 7 and uses the following expcrimental matrix.
Temperature (o()
Stirring Rate (rpm)
Yield(%)
110 110 l I0 1 10 12 1 12 1 12 1 12 1 132 132 132 132 143 143 143 143
30 40 50 60 30 40 50 60 30 40 50 60 30 40 50 60
70.27 74.95 77.91 82.69 73.43 73.14 78.27 74.89 69.07 70.83 79.18 78. 10 73.71 77.70 74.31 80.99
a. Compute the corre lation between temperature and yield, between stirring rate and yield, and between temperature and stirring rate. b. Do these data provide good evidence that the yield is unaffected by te mperature, w ith in the range of the data? Or might the result be due to confound ing? Explai n. c. Do these data provide good evidence that increasing the stirring rate causes the yield to increase, within the range of the data? Or might the result be due to confound ing? Explain. d. Which experimental desig n is better, this one or the one in Exercise 7? Explain.
2.2 The Least-Squares Line
49
2.2 The Least-Squares Line When two variables have a linear relationship, the scatlerplot tends to be clustered ;u·ound a line known as the least-squares line (see Figure 2.2 in Section 2. 1). Tn this section , we will learn how to compute the least-squares line and how it can be used to describe bivariate data. Table 2.1 prese nts the nitrogen con tent (in percent) and yield strength (in ks i) for 28 welds. These data were first presented in Figure 2.1 b in Section 2. 1.
TABLE 2.1 Nitrogen Content and Yield Strength Nitrogen Content
Yield Strength (ksi) y
Nitrogen Content
X
0.0088 0.0200 0.0350 0.0460 0.0617 0.0620 0.0074 0.0160 0.0237 0.0327 0.0555 0.0447 0.0068 0.0081
52.67 57.67 64.00 67.00 71.00 72.67 55.67 60.00 63.67 67.67 68.00 64.00 59.50 56.60
0.0169 0.0286 0.0430 0.0580 0.0630 0.0099 0.0190 0.0270 0.0350 0.0520 0.0580 0.0290 0.0 170 0.0096
X
- --
-
Yield Stren gth (ksi) y 61.05 65.85 7t.45 77.45 75.5 5 54.70 59.05 62.75 67. 10 70.65 71.80 58.50 57. 15 52.95
F igure 2.7 (page 50) presents the scauerplot of y versus x with the least-squares line superimposed. We write the equation of the line as
Y
= So+ ~~x
(2.3)
The quantities fio a nd fi 1 are called the least-squares coefficients. The coefficient fi 1 is the slope of the least-squares line, and the coefficient fio is the y-intercept. The variable represen ted by x, in th is case nitrogen con te nt, is caUed the independent variable. The variable represented by y, in this case yield strength, is called the dependent variable. The least-squ ares line is the line that ti ts the data "best." We now de fine what we mean by " best." For each data poi nt (x;, y; ), the vertical distance to the point (x;, .Vi) on the least-squares line is e; = y;- .)•; (sec Figure 2 .7). The quantity _)•; ~o + S1x; is called the fitted value, and the quantity e; is called the t·csidual associated wiU1 the point (x;, )';) . T he residua l e; is the difference between the value )'; observed in the data and the fitted value )•; predicted by the least-squares li ne. T his is the vertical di stance from the point to the line. Points above the least-squares line have positive res iduals, and points below the least-squares line have negative residuals. The closer ilie residuals are to 0, the c loser the fitted values are to the observations and the better the line fi ts the data. We defi ne the least-squares line to be the line for which the sum of the sq uared res iduals
=
50
CHAPTER 2
Summarizing Bivariate Data
80 , ---.---- ,----,---,----r---.----,
• 75
•
.c
on t: ~
65
• (x;, Y;)
Vi v
~
•
60 55 50
0
•
-
o.oz
0.03 0.04 0.05 Nitrogen Content(%)
0.01
0.06
0.07
FIGURE 2. 7 Plot of yield strengths versus nitrogen content. The least-squares line y = fin+ ~ 1 x is superimposed. The vertical distance from a data point (x1, y1) to the
point (x1 , y1) on the line is the ith residual e1 . The least-squares line is the line that minimizes the sum of the squared residuals.
2:;'=1 e~ is minimized. In this sense, the least-squares line fi ts the data better than any other line. Tn the weld example, there is only one independent variable (nitrogen content). In other cases, we may use several independent variables. For example, to predict the yield of a certain crop, we might need to know the amount of fe11ilizer used, the amount of water applied, and various measurements of chemical properties of the soil. Linear models with only one independent variable are called simple linear regression models. Linear models with more than one independent variable are called multiple regression models. This chapter covers simple li near regression. Multiple regression is covered in Chapter 8. Computing the Equation of the Least-Squares Line To compute the equation of the least-squares line, we must determine the values for the Slope ~I and the intercept ~0 that minimize the sum of the squared residuals L.:;'=l To do thi s, we first express e; in terms of ~o and~ , :
er
e;
= Yi-
y;
= Yi - ~o - ~tX;
(2.4)
Therefore, ~ 0 and~ 1 are the quantities that minimize the sum
S = "'2"' L./i = L.)Y;- f3on
n
i=l
i= l
A
[3,x,) A
2
(2.5)
2.2
51
The Least-Squares Line
It can be shown that these quantities are
(2.6) (2 .7)
Computing Formulas
E;'=
E;'=
2 The quantities 1(x; - :X)(y; - y) need to be computed in order 1(x; - :X) and to determine the equation of the least-squares line, and, as we will soon see, the quantity 2 1( y; - y) needs to be computed in order to de termine how well the line fits the d ata. When computing these quantities by hand, there are alternate formulas that are often easier to use. They are given in the following box.
E7=
Computing Formulas
The e xpressions on the right are equivalent to those on the left and are often easier to compute: n
n
L(x;- :X)2
=
L x'f - n:X2
i= l
i=l
I!
n
i= l
i= l
(2.8)
(2.9)
n
''
L (X; - x )(y;- y) = L x;y;- n:Xy i= l
..
(2.10)
i= l
Example
Using the weld data in Table 2.1, compute the least-squares estimates of the slope and intercept of the least-squares line. Solution
The slope is ~ 1, and the the intercept is ~ 0 . From Table 2.1 we compute
y=
:X = 0.031 943
ll
11
ll
i= l
i= l II
L(X; - x )(y; - )i) = L i= l
63.7900
i=l
X;y; - n:X y = 3.322921
52
CHAPTER 2
Summarizing Bivariate Data
Using Equations (2.6) and (2.7), we compute ~ 3.322921 331 ' 62 f3l = 0.100203 =
~0 = 63.7900- (33 1.62)(0.03 1943) = 53 .197
The equation of the least-squares line is y = values for ~o and ~ 1, we obtain
/3 0 + fj 1x . Substituting the computed
y =53 .1 97+33 1.62x Using the equation of the least-squares line, we can compute the fitted values y; = fj 1x; and the residuals e; = y; - y; for each point (x; , y; ) in the data set. The results are presented in Table 2.2. The point whose residual is shown in Figure 2.7 is the one where x = 0.0430. f3o +
TABlE 2.2 Yield strengths of welds with various nitrogen contents, with fitted values and residuals Fitted Value
Nitrogen
Strength
X
y
p
0.0088 0.0200 0.0350 0.0460 0.061 7 0.0620 0.0074 0.0160 0.0237 0.0327 0.0555 0.0447 0.0068 0. 008 1
52.67 57.67 64.00 67.00 7 1.00 72.67 55.67 60.00 63.67 67.67 68.00 64.00 59.50 56.60
56. 12 59.83 64.80 68.45 73.66 73.76 55.65 58.50 61.06 64.04 71.60 68.02 55.45 55.88
Residual
Nitrogen
e - 3.45 -2.16 - 0.80 -1 .45 -2.66 - 1.09 0.02 1.50 2.6 1 3.63 - 3.60 - 4.02 4.05 0.72
Strength
X
0.0169 0.0286 0.0430 0.0580 0.0630 0.0099 0.0190 0.0270 0.0350 0.0520 0.0580 0.0290 0.0 170 0.0096
Fitted Value
y
p
61.05 65.85 71.45 77.45 75.55 54.70 59.05 62.75 67. 10 70.65 7 1.80 58.50 57.15 52.95
58.80 62.68 67.46 72.43 74.09 56.48 59.50 62.15 64.80 70.44 72.43 62.81 58.83 56.38
Residual
e 2.25 3. 17 3.99 5.02 1.46 - 1.78 - 0.45 0.60 2.30 0.21 - 0.63 - 4.3 1 - 1.68 -3.43
Often we know the value of the independent variable and want to predict the value of the dependent variable. When the data fo llow a linear pattern, the quantity y = /3 0 + fj 1x is a prediction of the value of the dependent variable. Examples 2.4 and 2.5 illustrate this.
Example Using the weld data, predict the yield strength for a weld whose nitrogen content is 0.05%. Solution In Example 2.3, the equation of the least-squares line was computed to be y = 53.197 + 33 1.62x. Using the value x = 0.05, we estimate the yield strength of a weld whose nitrogen content is 0.05% to be
y = 53.197 +
(33 1.62)(0.05)
= 69.78 ksi
2.2
..
The Least-Squares Line
53
Example
Using the weld data, predict the yield strength for a weld whose nitrogen content is 0.02%. Solution
The estimate is
y=
53.197
+ (33 1.62)(0.02) =
59.83 ksi.
In Example 2.5, note that the data set contains a weld whose nitrogen content was 0.02%. The yield strength of that weld was 57. 67 ksi (see Table 2.2). It might seem reasonable to predict that another weld with a nitrogen content of 0.02% would have the same strength as that of the weld already observed. But the least-squares estimate of 59.83 ksi is a better prediction, because it is based on all the data.
Given points (x 1, Yt), . . . , (x,, y"):
• • • •
The least-squares line is A
_
f3 1 -
L:;'=1(x; -
y = So+ S1x .
x) (y;- y)
"'" L-i=l ( X ; - X )2
So=Y-Six For any x, y = ~ 0 + ~ 1x is a prediction of the value of the dependent variable for an item whose independent variable value is x .
Exercises for Section 2.2 1. Each month for several months, the average temperature in °C (x) and d1e amount of steam in kg (y) consumed by a certain chemical plant were measured. T he least-squares line computed from the resulting data is y = 111.74 + 0.5 1x . a. Predict the amo unt of steam consumed in a month where the average temperature is 6SOC. b. If two months differ in their average temperatures by soc, by how much do you predict the amount of steam consumed to differ? 2. In a study of the relationship between the Brinell hardness (x) and tensil e strength in ksi (y) of specimens of cold drawn copper, dle least-squares line was y = - 196.32 + 2.42x. a. Predict the tensile strength of a specimen whose Brinell hardness is 102.7. b. If two specimens differ in their Brinell hardness by 3, by how much do yo u predict their tensile strengths to differ?
3. O ne of the earliest uses of the correlation coefficient was by Si r Francis Gal ton, who computed dle correlation between height and forearm length for a sample of adult men. Assume that the least-squares li ne for predicting forearm length (y) from height (x) is y = - 0.2967 + 0.2738x . Both forearm length and he ight are measured in inches in this equatio n. a. Predict the forearm length of a man whose height is 70 in. b. How tall must a man be so that we would predict his forearm length to be 19 in.? c . All the men in a certain group have heights greater than the height computed in pan (b). Can you conclude that all their forea1ms will be at least 19 in. long? Explain. 4. In a study relating the degree of warping, in mm, of a copper plate (y) to te mperature in oc (x), the following summary statistics were calculated: n = 40,
54
CHAPTER 2
Summarizi ng Bivariate Data
2 " '2 - 98 '7 7 5 'Wi=l '\'" ( ); -x, y -- 19.1 0 ' 26.36, y = 0.5 188, I:;'=,(x; - x)(y; - )i) =
'\'" • Wi=l(X;
I
-
-)
x = 826.94.
a. Compute the cmTelation r between the degree of warping and the temperature. b. Compute the least-squares line for predicting warping from temperature. c. Predict the warping at a temperature of 40°C. d. At what temperature will we predict the warping to be 0.5 mm? e. Assume it is important that the warping not exceed 0.5 mm. An engineer suggests that if the temperature is kept below the level computed in part (d), we can be sure that the warping will not exceed 0.5 mm. Is th is a correct conclusion? Explain. 5. Inertial weight (in tons) and fuel economy (in 1ni/gal) were measured for a sample of seven diesel trucks. The results are presented in the following table. (From "ln-Use Emissions from Heavy-Duty Diesel Vehicles," J. Yanowi tz, Ph.D. thesis, Colorado School of Mines, 2001.)
Weight
Mileage
8.00 24.50 27.00 14.50 28.50 12.75 21.25
7.69 4.97 4.56 6.49 4.34 6.24 4.45
cision for Coal Ash Using Gy's Discrete Model of the Fundamental Error" (Journal of Coal Quality, L989:33-39) provides data relating the percentage of ash to the density of a coal patticle. The average percentage ash for five densities of coal particles was measured. The data are presented in the following table:
Density (g/cm 3 )
Percent ash
1.25 l.325 1.375 1.45 1.55
1.93 4.63 8.95 15.05 23.31
a. Construct a scattc rplot of percent ash (y) versus density (x). b. Compute the least-squares line for predicting percent ash from density. c. If two coal particles differed in density by 0.1 g/cm3 , by bow much would you pred ict their percent ash to differ? d. Predict the percent ash for particles with density 1.40 g/cm3 . e. Compute the fitted values. f. Compute the residuals. Which point has the residual with the largest magnitude?
g. Compute the correlation between density and percent ash.
a. Construct a scatterplot of mileage (y) versus weight (x).
7. fn tests desi gned to measure the effect of a certain additive on the drying time of paint, the following data were obtained.
b. Compute the least-squares line for predicting mi leage from weight.
Concentration of Additive(%)
Drying Time (h)
c. If two trucks differ in weight by 5 tons, by how much would you predict their mileages to differ?
4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8
8.7 8.8 8.3 8.7 8.1 8.0 8.1 7.7 7.5 7.2
d. Predict the mileage for trucks with a weight of 15 tons. e. What are the units of the estimated slope
fi
1
?
f. What are the units of the estimated intercept fio? 6. T he processing of raw coal involves "washing," in which coal ash (nonorganic, incombustible material) is removed. The artide "Quantifying Sampling Pre-
2 .2 The Least-Squares Li ne
55
b. Compute the least-squares line for predicting drying tin1e from add itive concentration.
a. Let A = ~ 0 + ft 1C be the equation of the least-squares line for predicting absorbance (A) from concentration (C). Compute the values of ~ 0 and fi 1 •
c. Compute the fitted value and the residual for each point.
b. Predict the absor bance for a C = I .3 mol/cm3 .
a. Construct a scatterplot of drying time (y) versus additive concentration (x).
d. [f the concentratio n of the additive is increased by 0.1 %, by how much would you predict the dry ing time to increase or decrease?
concentration
10. For a sample of 12 trees, the volume of lumber (in m 3) and the diameter (in em) at a fixed height above ground level was measured. The results were as follows.
e. Predict the drying time for a concentration of 4.4% .
f. For what concentration would you predict a drying time of 8.2 hours?
8. The article "Polyhedral Distortions in Tourmaline" (A. E11l, J. Hughes, et al. , Canadian Mineralogist, 2002: 153-162) presents a model for calculating bondlength distortion in vanadium-bearing tourmaline. To check the accuracy of the model, several calculated values (x) were compared with directly observed values (y). The results (read from a graph) are presented in the following table.
Diameter
Volume
Diameter
Volume
35.1 48.4 4 7.9 35.3 47.3 26.4
0.81 1.39 1.31 0.67 1.46 0.47
33.8 4 5.3 25.2 28.5 30. 1 30.0
0 .80 1.69 0.30 0.19 0.63 0.64
a. Construct a scatterplot of volume (y) versus d iameter (x).
Observed Value 0.33 0.36 0.54 0.56 0.66 0.66 0.74
Calculated Value 0.36 0.36 0.58 0.64 0.64 0 .67 0.58
Observed Value 0 .74 0.79 0.97 1.03 1.10 1.13 l.J4
Calculated Value 0.78 0.86 0 .97 I. 11 1.06 1.08 1.17
a. Compute the least-squares line y = ~ 0
c. For which values of x will the predicted value y be less than the calculated value x?
9. Measurements of the abso rbance of a solution are made at various concentrations. The results are p resented in the fo11 owi ng table.
1.00 1.20 0 .99 1.1 3
1.50 1.52
1.70 1.73
ume from diameter. c. Compute the fitted value and the residual for each point. d. If two trees differ in diameter by 8 em, by how much would you predict their volumes to differ? e. Predict the volume for a tree whose d iameter is 44 cm. f. For what diameter would you predict a volume of 1 m3 ?
11. A sample of I0 households was monitored for one
+ ~ 1x.
b. Predict the value y when the calculated value is X= 1.0.
Concentration (mol!cm 3) Absorbance (Ucm3)
b. Compute the least-squares line for predicting vol-
2.00 1.96
year. The household income (in $1000s) and the amotmt of energy consumed (in 10 10 joules) were determined. The results follow.
Income
Energy
Income
Energy
31 40 28 48 195
16.0 40.2 29.8 45.6 184.6
96 70 100 145 78
98.3 93 .8 77.1 114.8 67.0
56
CHAPTER 2
Summarizing Biva ri ate Data
a. Construct a scatterplot of energy consumption (y) versus income (x).
a. Construct a scatterplot of hardness (y) versus percent reclaimed n 1bber (x) .
b. Compute the least-squares line for predicting energy consumpti on fro m income.
b. Compute the least-squares line for predicting hardness from percent reclaimed rubber.
c. If two families differ in income by $ 12,000, by how much would you predict their energy consumptio ns to differ?
c. If two tires differ in the amount of reclaimed rubber by 15%, by bow much would you predict their hardnesses to differ?
d. Predict the energy consumption for a family whose income is $50,000.
d. The table shows that a tire that had 30% reclaimed rubber had a hardness of 67.3. If another tire was manufactured wi th 30% reclaimed rubber, what would you predict its hardness to be?
c. For what income would you predict an energy consumption of 100?
12. The fo llowing table presents measurements of hardness (in durometers) for tire treads containing various percentages of reclaimed rubber.
e. For what percent reclaimed rubber would you predict a hardness of 65?
Percent
Hardness
Percent
Hardness
Percent
Hardness
0 2 4 6 8 10 12 14 16 18 20
61.6 61.5 60.9 61 .4 6 3.2 6 1.7 64.5 64.6 63.0 64.2 63.3
22 24 26 28 30 32 34 36 38 40
62.3 67.2 65.5 67. 1 67.3 67.4 66.4 66. 9 68.1 67.3
42 44 46 48 50 52 54 56 58 60
67.9 71.9 70.3 68.9 70.9 69.8 69.9 7 1.8 73.9 73.2
2.3
Features and Limitations of the Least-Squares Line Don't Extrapolate Outside the Ra ng e of the Da ta The nitrogen conte nts of the welds in the data set presented in Table 2.1 in Section 2.2 range from 0 .0068% to 0 .0630%. Should we use the least-squares line to estimate the yield strength of a weld whose nitrogen content is 0 .100%, which is outside the range of the data? The answer is no. We can compute the )east-squares estimate, which is 53 .1 97 + 331.62(0.100) = 86.359 k si. However, because the value of the independent variable is outside the range of the data, this estimate is unreliable. Although the data follow a linear p atte rn for nitrogen conte nts within the range 0 .0068% to 0.0630%, this does not guarantee that a weld with a nitrogen conte nt outside this range would follow the same pattern. For many variables, linear relationships hold within a certain range, but not outside it. If we extrapolate a least-squares line outside the range of the data, therefore, there is no guarantee that it will properly describe the
2.3
Features and Limitations of the Least-Squares Line
57
relationshi p. If we want to predict the yield strength of a weld with a nitrogen content of 0. 100%, we must include welds with nitrogen content 0. 100% or more in the data set.
Summary Do not extrapolate a fitted line (such as the least-squares line) outside the range of the data. The linear relationship may not hold there.
Don't Use the Least-Squares Line When the Data Aren't Linear In Section 2.1 , we learned that the correlation coefficient should be used onl y when the relationship between x and y is linear. The same holds true for the least-squares line. When the scatterplot follows a curved pattern, it does not make sense to summarize it with a straight line. To illustrate this, Figure 2.8 presents a plot of the relationshi p between the height y of an object released from a height of 256 ft and the time x since its release. The relationship between x and y is nonlinear. The least-squares line does not fit the data well. 350,-------.------,------,-------, 300
250
g
200
~ ~ 150
•
0~-------L-------L------~------~
0
2 T ime (s)
3
4
FIGURE 2.8 The relationship between the height of a free-falling object and the time in free fall is not linear. The least-squares line does not fit the data well and should not be used to predict the height of the object at a given time.
Outl iers and Influential Points Outliers are points that are detached from the bulk of the data. Scatterplots should always be examined for outliers. The first thing to do with an outlier is to try to determine why it is different from the rest of the points. Sometimes outliers are caused by data-recording errors or equipment malfunction. In these cases, the o utliers may be deleted from the data set. But many times the cause for an outlier cannot be determined with certainty. Deleting the outlier is then unwise, because it results in underestimating the variability of the process that generated the data.
58
CHAPTER 2
Summarizing Bivariate Data
When there is no justification for deleting outliers, one approach is first to fit the line to the whole data set, and then to remove each outlier in turn, fitting the line to the data set with the one outlier deleted. If none of the outliers upon removal make a noticeable difference to the least-squares line or to the estimated standard deviations of the slope and intercept, then use the fit with the outliers incl uded. If one or more of the outliers does make a difference when removed, then the range of values for the least-squares coefficients should be reported. An outlier that makes a considerable difference to the least-squares line when removed is called an influential point. Figure 2.9 presents an example of an influential point, along with an outlier that is not influential. In general, outliers with unusual x values are more likely to be infl uential than those with unusual y values, but every outlier should be checked. Many software packages identify potentially influential points. Further information on treatment of outliers and influential points can be fo und in Draper and Smith (1998); Belsey, Kuh, and Welsch (2004); and Cook and Weisberg (1994). y = -0.34 + l.05x
7
y = -0.22 + l .06x
7
6
6
6
5
5
5
4
4
4
3
3
3
2
2
2
2
3
4
5 (a)
6
7
2
3
4
5
6
7
y = 0.97 + 0.70x
7
2
(b)
3
4
5
6
7
(c)
FIGURE 2.9 (a) Scatterplot with no outliers. (b) An outlier is added to the plot. There is little change in the least-squares line, so thi s point is not influential. (c) An outlier is added to the plot. There is a considerable change in the least-squares line, so this point is infl uential. Finally, we remark that some authors rest:J.ict the definition of outliers to points that have unusually large residuals. Under this defi nition, a point that is far from the bulk of the data, yet near the least-squares line, is not an outlier.
Another Look at the Least-Squares Line The expression (2.6) for fi 1 can be rewritten in a way that provides a useful interpretation. Starting with the definition of the correlation coefficient r (Equation 2. 1 in Section 2.1) 2 2 and multiplying both sides by 1(x; -x) = sy/ sx yields the 1 (y;- y) result
JL,;'=
/JL.7=
~
fJ1
Sy
=r -
(2.11)
Sx
Eq uation (2.1 J) allows us to interpret the slope of the least-squares line in terms of the correlation coefficient. The uni ts of~ 1, the slope of the least-squares line, must be units of y 1.x. The correlation coefficient r is a unitless number that measures the strength of the linear relationship between x and y. Equation (2. 11) shows that the slope fi 1 is
2.3
Feat ures and Limitations of the Least-Squares Line
59
proportional to the correlation coefficient, where the constant of proportional ity is the quantity sy/sx that adjusts for the units in which x and y are measured. Using Equation (2. 11), we can write the equation of the l east-squares line in a useful form: Substituting y- ~ 1:X fo r ~o in the equation for the least-squares l ine y = ~o + ~ ~x and rearranging terms yields
Y - Y = S1(x
(2. 12)
- :X)
Combining Equations (2. 11) and (2. 12) yields Sy y- y = r-(xx) A
(2.13)
-
Sx
Thus the least-squares line is the line that passes through the center of mass of the scatterplot (:X, y), with slope s l = r(sy/sx).
Measuring Goodness-of-Fit A goodness-of-fit statistic is a quantity that measures how well a model explains a given set of data. A linear model fit~ well if there is a strong linear relationship between x and y . We mentioned in Section 2.1 that the conelation coefficient r measures the stre ngth of the linear relationshi p between x and y. Therefore r is a goodness-of-fit statistic for the linear model. We will now describe how r measures the goodness-of-fit. Figure 2.10 presents the weld data. The points on the scatterplot are (x;, y;) where x; is the nitrogen content of the i th weld and Yi is the yield strength . There are two li nes superimposed on the scatte r-plot. One is the least-squares line, and the other is the horizontal l ine y = Y. Now imagine that we must pred ict the yield strength of one of the welds. If we have no knowledge of the nitrogen content, we must predict the yield strength to be the mean, y. Our prediction error is y; - y. [f we predict the strength of each weld this way, the sum of squared prediction errors will be I:~= ' (y; - y) 2 . lf, on the other hand, we know
80 .--------.--------.--------.----.
•
50 L--------L------~--------~--~
0
0.02
0.04
0.06
Nitrogen Content(%)
FIGURE 2 .10 Nitrogen content and yield strengths of welds. The least-squares line and the horizontal li ne y =yare superimposed.
60
CHAPTER 2
Summarizing Bivariate Data
the nitrogen content of each weld before predicting the yield strength, we can use the least-squares line, and we will predict the ith yield strength to be y;. The prediction error will be the residual y; - y;, and the sum of squared predicti on e tTors is I:;'= 1(y; - )•; ) 2 . The strength of the linear relationship can be measured by computing the reduction in sum of squared prediction errors obtained by using y; rather than y. This i s the diffe rence I:~=l (y;- y f - I:;'=t (y;- y;)2 . The bigger this difference is, the more tightly clustered the points are around the least-squares line, and the stronger the linear relationship is between x andy. Thus, I:;'= 1 (y; - y) 2 - I:;'= 1(y; - y; )2 is a goodness-of-fit statistic. There is a problem with using I:;'= 1 (y; - y) 2 - I:;'= 1 (y; - )1;) 2 as a goodness-of-fit statistic, however. This quantity has units -namely, the squared units of y. We could not use this statistic to com pare the goodness-of-fit of two models fit to different data sets, since the units would be differe nt. We need to use a goodness-of-fi t statistic that is unitless, so that we can measure goodness-of-fit on an absolute scale. This is where the correlation coefficient r comes in. It can be shown that 2
r =
2:7=1 (y; - )1) ~"
2
ui = l
-
2:7=1 (y; - .YY ?
(2.14)
(y; - y)-
The quantity r 2 , the square of the correlation coefficient, is called the coefficient of determination. It is the reduction i n the sum of the squared prediction errors obtained by using Y; rather than y, expressed as a fraction of the sum of squared prediction errors 2:;'= 1(y; - )1) 2 obtained by using Y. This interpretation of r 2 is important to know. In C hapter 8, we will see how it can be generalized to provide a measure of the goodnessof-fit of linear relationships involving several variables. For a visual interpretation of r 2 , look at Figure 2.1 0. For each point (x;, y;) on the scatterplot, the quantity y;- y is the vertical distance from the point to the horizontal line y = y, and the quantity y;- Y; is the vertical distance from the point to the least-squares line. Thus, the quantity I:;'= I (y; - y) 2 measures the overall spread of the points around the line y = y, and the quantity 2:;'= 1(y; - y; f measures the overall spread of the points around the least-squares li ne. The quantity 2:;'= 1(y; - )1) 2 - I:;'= 1 (y;- );; ) 2 therefore measures the reduction in the spread o f the points obtained by using the least-squares line rather than y = y. The coefficient of determination r 2 expresses this reduction as a proportion of the spread around y = y. The su ms of squares appearing in this discussion are used so often that statisticians have given them names. They call I:;'= 1(y; - 5•; )2 the error sum of squares and I:;'= 1(y; -)1) 2 the total sum of squares. Their difference I:;'= 1 (y; -)1) 2 - 2:7= 1 (y;- y;) 2 is called the regression sum of squares. Clearly, the following relationship holds: Total sum of squares = Regression sum of squares
+ Error sum of squares
Using the preceding terminology, we can write Equation (2.14) as Regression sum of squares Total sum of squares
r 2 = --"---------''--Since the total sum of squares is just the sample variance of the y; without dividing by n - I , statisticians (and others) often refer to r 2 as the proportion of the variance in y explained by regression.
2.3
61
Features and Lim itations of the Least-Sq uares Line
Interpreting Computer Output Nowadays, calculations involving least-squares lines are usually done on a computer. Many software packages are available that will perform these calculations. The following output (from MINITAB), which presents the results of fitting a least-squares line to the weld data, is fairly typical.
Regression Analysis: Length versus Weight The regression equation is Strength= 53.197 + 33 1. 62 Ni trogen Predictor Constant Nitrogen
s
=
2.75151
Coef 53.19715 331.6186 R- Sq
SE Coef 1.02044 27 . 4872 84.8%
T
p
52.131 12 .064
0. 000 0.000
R-Sq( adj) = 84. 3%
In the output, the equation of the least-squares line a~-a.r-t:he top, labeled as the "regression equation." The least-squares coefficientV
Exercises for Section 2.3 1. Ultimate strengths (in MPa) were measw·ed at several temperatures (in °C) for three types of plastic. The results follow.
Type 1 Temperature Strength
10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
3 11 11 16 19 21 25 25 29 26 31 33 32 39 38 47
Type 2 Temperature Strength
10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
5 7 7 9 11 13 17 18 22 18 25 28 26 37 36 52
Type 3 Temperature Strength
10 11 12 16 19 22 23 25 26 29 31 31 33 35 35 60
8 ll ll
15 16 21 24 26 30 27 32 32 32 38 38 41
62
CHAPTER
2
Summa rizi ng Bivariate Data
a. Construct a scatterplot for each of the three d ata sets. b. For each data set, say whether the least-squares line is appropriate for summarizing the d ata, and explain why. 2. Following are measurements of shear s train (in %) and shear strain (in MPa) for a sample of copper bars.
Stress
Strain
Stress
Strain
8.2 9.6 11.0 12.0
77.6 78.8 78.9 80.2
13.4 13.5 14.7 14.9
80.9 81.3 82.2 82.7
a. Compute the least-squares line using strain as the dependent variable (y) and stress as the independent variable (x). b. C ompute the least-squares line using stress as the dependent vari able (y) and strain as the independent variable (x). Rewrite the equation of this line to express strain in terms of stress. c. Are the lines in parts (a) and (b) the same? d. Compute the correlation coefficient r. Express the ratio of the slopes of the two lines in terms of r.
3. In an experiment to determine corrosion rates, steel plates were placed in a solution of 10% hydrochloric acid (HCI) for various periods of time (in hours), and the weight loss (in mg) was measured. Following are the results. Time Weight loss
2 0.7
4
6
8
6.9
7.2
11.9
10 16.2
12 22.5
a. Compute the least-squares line for predicting the weight loss (y) at a given time (x) . b. Should the line be used to predict the weight loss after I hour? If so, predict the weight loss. If not, explain why not. c. Should the line be used to predict the weigh t loss after 5 hours? If so, predict the weight loss. If not, explain why no t. d. Should the line be used to p redict the weight loss after 20 hours? If so, pred ict the weight loss. If not, explain why not.
4. For a certain scatterplot, the value of the correlation coefficient is r = 0.5 . Which of the following statements is correct? 1.
The total sum of squares is hal f as much as the regression sum of squares.
ii. The regression sum of squares is half as much as the total sum of squares. iii. The total sum of squares is one-fourth as much as the regression sum of squares. iv. The regression sum of squares is one-fourth as much as the to tal sum of squares.
S. A least-squares line is fit to a set of points. If the total sum of squares is L:; (y; - yy = 9615, and the en or sum of squares is L:;(y; - yy = 1450 , compute the coeffi cient of determination r 2 .
6. A least-squares line is fit to a set of points. If the total
:Yi
= 181.2, and the error sum of squares is L:;(y; s um of squares is L:;(y; - yy = 33.9, compute the coefficient of determination r 2 • 7. Moisture content in percent by volume (x ) and conductivity in mS/m (y) were measured for 50 soil specimens. The means and standard deviations were x = 8.1 ,s., = 1.2,y = 30.4,sy = 1.9.Thecorrelatio n between conductiv ity and moisture was computed to be r = 0.85. Find the equation of the least-sq uares line for predicting soil conductivity from moisture content.
8. Curing times in days (x) and compressive strengths in MPa (y) were recorded fo r several concrete specimens. The means and standard deviations of thex and y values were x 5 , s, = 2, y = 1350, s1 = 100. The correlation between curing time and compressive strength was computed to be r = 0.7. Find the equation of the least-squares li ne to predict compressive strength fro m curing time.
=
9. Varying amounts of pectin were added to canned jellies, to study the relationship between pectin concentratio n in percent (x) and a firnmess index (y) . T he means and standard deviations of the x and y values were x = 3, s, = 0 .5, y = SO, Sy = 10. The correlation between curing time and firmness was computed to be r = 0. 5. Fi nd the equation of the least-squares line to predict fi r mness from pectin concentration.
Supplementary Exercises for Chapter 2
]0. An engineer wants to predict the value for y when x 4.5, usi ng the following data set.
=
X
y
z =lny
X
y
I 2
0.2 0.3 0.5 0.5 1.3
- 1.61 -1.20 -0.69 - 0.69 0.26
6 7 8 9 10
2.3 2.9 4.5 8.7 12.0
3 4 5
z
=l ny 0.83 1.06 1.50 2. 16 2.48
63
a. Construct a scatterplot of the points (x, y) . b. Should the least -squares line be used to predict the value of y when x = 4 .5? Tf so, com pute the leastsquares line and the predicted value. If not, explain why not. c. Construct a scatterplot of the points (x, z), where z = ln y. d. Use the least-squares line to predict the value of z when x = 4.5. Is this an appropriate method of prediction? Explain why or why not. e. Let denote the predicted value of z computed in part (d). Let y = ei . Explain why y is a reasonable predictor of the value of y when x = 4 .5.
z
Supplementary Exercises for Chapter 2 1. A simple random sample of 100 men aged 25-34 averaged 70 inches in height and had a standard deviation of 3 inches. Their incomes averaged $47,500 and had a standard deviation of$1 8,300. Fill in the blank: From the least-squares line, we would predict that the income of a man 70 inches tall would be _ _ __ 1.
less than $47,500.
ii. greater than $47,500. u1. equal to $47,500. 1v. we cannot tell unless we know the correlation. 2. In an accelerated life test, units are operated under extreme conditions until fa il ure. In one such test, 12 motors were operated under high temperature conditions . The ambient temperatures (in cq and lifetimes (in hours) are presented in the followi ng table:
Temperature
lifetime
40 45 50 55 60 65 70 75 80 85 90 95
851 635 764 708 469 661 586 371 337 245 129 158
a. Construct a scattervlot of lifetime (y) versus temperature (x). Verify that a linear model is appropri ate. b. Compute the least-squares line for predicting lifetime from temperature. c. Compute the fitted value and the residual for each point. d. If the temperature is increased by SOC, by how much would you predict the lifetime to increase or decrease? e. Predict the lifetime for a tempcran.re of 73oC. f. Should the least-squares line be used to predict the lifetime for a temperature of 120°C? If so, predict the lifetime. If not, explain why not. g. For what temperature would you predict a lifetime of 500 hours? 3. In a sample of adults, would the correlation between age and the year graduated from high school be closest to -1 , - 0.5, 0, 0.5, or l? Explain.
4. A mixture of sucrose and water was heated on a hot plate, and the temperature (in oq was recorded each minute for 20 minutes by three thermocouples. The results are shown in the following table.
64
CHAPTER 2
Su mmarizing Bivariate Data
T,
Tz
T3
9 10
20 18 29 32 37 36 46 46 56 58 64
11
72
12 13 14 15 16 17 18 19 20
79 84 82 87 98 103 101 103 102
18 22 22 25 37 46 45 44 54 64 69 65 80 74 87 93 90 100 98 103 103
21 11 26 35 33 35 44 43 63 68 62 65 80 75 78 88 91 103 109 .107 104
Time 0 l 2 3 4 5 6 7
8
T = (Tt + T2 + T3)/3. Compute the least-squares line usi ng T as the value for temperature. f. Are the results of parts (d) and (e) different?
5. A scatterplot contains three poults: (- 1,- 1), (0,0), ( 1, 1). A fourth point, (2,y), is to be added to the plot. Let r represent the correlation between x and y . a. Find the value of y so that r b. Find the value of y so that r
= I. = 0.
c. Explain why there is no value of y for which r = - 1.
6. The article "Experimental Measurement of Radiative Heat Transfer in Gas-Solid Suspension Flow System" (G. Han, K. Tuzla, and J. Chen, AIChe Journal, 2002: 19 10- 19 16) discusses the calibration of a radiometer. Several measurements were made on the electromotive force readings of the radiometer (in volts) and the radiation fl ux (in kilowatts per square meter). The results (read fro m a graph) are presented in the following table. Heat flux (y) 15 31 51 55 67 89 Signal output (x) 1.08 2.42 4. 17 4.46 5. 17 6.92
a. Compute the least-squares line for estimating the temperature as a function of time, using T1 as the value for temperature. b. Compute the least-squares line for estimating the temperatu re as a function of time, using T2 as the value for temperature. c. Compute the least-squares line fo r estimating the temperature as a fu nction of time, using T3 as the value for temperatmc. d. It is desired to compute a single line to estimate temperature as a function of time. One person suggests averaging the three slope estimates to obtain a single slope estimate, and averaging the three intercept estimates to obtain a single intercept estimate. Find the equation of the line that results from thi s method. e. Someone else suggests averaging the three temperature measurements at each time to obtain
a. Compute the least-squares line for predicting heat flu x from the signal output. b. If the radiometer reads 3.00 V, predict the heat flu x. c. If the radiometer reads 8.00 V, should the heat flu x be predicted? If so, predict it. If not, explain why. 7. The article "Estimating Populatio n Abundance in Plant Species With Dormant Life-Stages: Fi re and the Endangered Plant Grevillea caleye R. Br." (T. Au.ld and J. Scott, Ecological Management and Restoration, 2004: 125-1 29) presents estimates of population sizes of a certain rare shrub in areas burnt by fire. The following table presents populatio n counts and areas (in m2 ) fo r several patches containing the plant.
Supplementary Exercises for Chapter 2
Area
Population
Area
Population
3739 5277 400 345 392 7000 2259 81 33 1254 1320 1000
3015 1847 17 142 40 2878 223 15 18 229 351 92
2521 21 3 11958 1200 12000 10880 841 1500 228 228 10
707 11 3 1392 157 7 11 74 1720 300 31 17 4
a. Compute the least-square line for predicting popul atio n (y) from area (x). b. Use the least-squares line computed in part (a) to predict the population in an area of 5000 m 2 •
65
e. Construct a scatterplot of population (y ) versus area (x). f. Construct a scatterplot of In y versus In x.
g. Which of the two scatterplots appears to be more appropriately summarized by the least-squares line') h. Which prediction is more reliable, the one in part (b) or the one in pa1t (d)? Explain.
8. In a test of military ordnance, a large number of bombs were dropped o n a tm·get from various heights. The initial velocity of the bombs in the direction of the gro und was 0. Let y be the height in meters from which a bomb is dropped, let x be the time in seconds for the bomb to strike the ground, let u = x 2 , and let v = .JY. The relationship between x and y is given by y = 4.9x 2 • For each of the following pairs of variables, state whether the correlation coefficient is an appropriate summary. a. x andy
c. Compute the least-sq uare line fo r predicting In y f rom ln x .
b. u andy c. x and u
d. Use the least-squares line computed in part (c) to predict the popu latio n in an area of 5000 m2 .
d. u and v e. lnx and ln y
Chapter
Probability Introduction The development of the theory of probability was financed by seventeenth-century gamblers, who hired some of the leading mathematicians of the day to calculate the correct odds for certain games of chance. Later, people realized that scientific processes involve chance as well, and since then the methods of probability have been used to study the physical world. Probability is now an extensive branch of mathematics. Many books are devote}~ to the subject, and many researchers have dedicated their professional careers to its further development. In this chapter we present an introduction to the ideas of probability that are most important to the study of statistics.
3.1
Basic Ideas To make a systematic study of probability, we need some terminology. An experiment is a process that results in an outcome that cannot be predicted in advance with certainty. Tossing a coin, rolling a die, measuring the diameter of a bolt, weighing the contents of a box of cereal, and measuring the breaking strength of a length of fishing line are all examples of experiments. To discuss an experiment in probabilistic terms, we must specify its possible outcomes:
The set of all possible outcomes of an experiment is called the sample space for the experiment. For tossing a coin, we can use the set {Heads, Tails} as the sample space. For rolling a six-sided die, we can use the set {I, 2, 3, 4, 5, 6}. These sample spaces are finite. Some experiments have sample spaces with an infinite number of outcomes. For example, imagine that a punch with a diameter of 10 mm punches holes in sheet metal. 66
3.1
Basic Ideas
67
Because of variations in the angle of the punch and slight movements in the sheet metal, the diameters of the holes vary between I 0.0 and 10.2 mm. For the experiment of punching a hole, then, a reasonable sample space is the interval (10.0, 10.2), or in set notation, (x 110.0 < x < 10.2}. This set obviously contains an infinite number of outcomes. When discussing experiments, we are often interested in a particular subset of outcomes. For example, we might be interested in the probability that a d ie comes up an even number. The sample space for the experiment is {1, 2, 3, 4, 5, 6}, and coming up even conesponds to the subset {2, 4, 6}. In the hole punch example, we might be interested in the probability that a hole has a diameter less than I 0.1 mm. This conesponds to the subset (x 110.0 < x < 10. I}. There is a special name for a subset of a sample space:
Note that for any sample space, the empty set 0 is an event, as is the entire sample space. A given event is said to have occutTed if the outcome of the experiment is one of the outcomes in the event. For example, if a die comes up 2, the events {2, 4 , 6} and {I , 2, 3} have both occurred, along with every oth er event that contains the outcome "2."
Example
~
An engineer has a box containi ng four bolts and another box containing four nuts. The diameters of the bolts are 4, 6, 8, and I 0 mm, and the diame te rs of the nuts are 6, I 0, I 2, and 14 mm. One bolt and one nut are chosen. Let A be the event that the bolt d iameter is less than 8, let B be the event that the nut diamete r is greater than 10, and let C be the event that the bolt and the nut have the same diameter. Find a sample space for this ex periment, and sp ecify the subsets con-espond ing to the events A, B, and C. Solution A good sample space for thi s experiment is the set of ordered pairs in which the first component is the diame te r of the bolt a nd the second component is the diameter of the nut. We will denote this sample space by S.
s=
((4, 6), (4, 10), (4, 12), (4, 14), (6, 6), (6, 10), (6, 12), (6, 14), (8, 6), (8, 10) , (8, 12) , (8, 14), (10, 6) , (10, 10) , (10, 12), ( 10, 14)}
The events A, B, and Care given by A= {(4, 6), (4, 10), (4, 12), (4, 14), (6, 6), (6, I 0), (6, I 2), (6, 14)} B = {(4, 12), (4, 14), (6, 12), (6, 14), (8, 12), (8, 14), ( 10, 12), ( 10, 14)} c = {(6, 6), (10, 10)}
68
CHAPTER 3
Probability
Combining Events We often construct events by combini ng simpler events. Because events are subsets of sample spaces, it is traditional to use the notation of sets to describe events constructed in this way. We review the necessary notation here. •
The union of two events A and B, denoted A U B, is the set of outcomes that belong to A , to B , or to both. In words, A U B means "A or B." Thus the event A U B occurs whenever either A orB (or both) occurs. The intersection of two events A and B, denoted A n B, is the set of outcomes that belong both to A and to B. In words, A n B means "A and B." Thus the event A n B occurs whenever both A and B occur. The complement of an event A, denoted Ac, is the set of outcomes that do not belong to A. In words, A c means "not A." Thus the event A c occurs whenever A does not occur.
•
•
Mutually Exclusive Events There are some events that can never occur together. For example, it is impossible that a coin can come up both heads and tails, and it is impossible that a steel pin can be both too long and too short. Event<> like this are said to be mutually exclusive.
Definition • •
The events A and B are said to be mutually exclusive if they have no outcomes in common. More generally, a collection of events A 1, A2 , ... , A, is said to be mutually exclusive if no two of them have any outcomes in common.
Example
~
Refer to Example 3. 1. If the experiment is performed, is it possible for events A and B both to occur? How about B and C? and C? Which pair of events is mutually exclusive?
1
Solution
If the outcome is (4, 12), (4, 14), (6, 12) , or (6, 14), then events A and B both occur. If the outcome is (6, 6), then both A and C occur. It is impossible for B and C both to occur, because these events are mutually exclusive, having no outcomes in common.
Probabilities Each event in a sample space has a probability of occurring. Intuitively, the probability is a quantitative measure of how likely the event is to occur. Formally speaking, there are several interpretations of probability; the one we shall adopt is that the probability of an event is the proportion of times the event would occur in the long run, if the experiment were to be repeated over and over again.
3.1
Basic Ideas
69
We often use the letter P to stand for probability. Thus when tossing a coin, the notation " P(hcads) = 1/2" means that the probability that the coin lands heads is equal to l/2.
Summary G iven any ex periment and any event A: • •
The expression P(A) denotes the probability that the event A occurs. P(A) is the proportion of times that event A would occur in the long run, if the experiment were to be repeated ove r and over again.
In many situ ations, the only way to estim ate the probability of an event is to repeat the experiment many times and determine the proportion of times that the event occurs. For example, if it is desired to estimate the probabili ty that a printed circuit board manufactured by a certain process is defective, it is usually necessary to produce a number of b oards and test the m to de te rmine the proportion that arc defective. In some cases, probabilities can be determined through knowledge of the physical nature of an experiment. For example, if it is known that the shape of a die is nearly a pe rfect cube and that its mass is d istributed nearly uniformly, it may be assumed that each of the six faces is equally likely to land upward when the die is rolled. Once the probabilities of some events have been found through scientific knowledge or experience, the probabilities of other events can be computed mathematically. For example, if it has been estimated through experimentation that the probability that a printed circuit board is defective is 0.10, an estimate of the probability that a board is not defective can be calculated to be 0.90. As another example, assume that steel pins manufactured by a certain process can fail to meet a le ngth specification either by being too short or too long. By measu ring a large number of pins, it is estimated that the prob ability that a pin is too short is 0.02, and the probability that a pin is too long is 0.03. It can then be estimated that the probability that a pin fails to meet the specification is 0.05 . In practice, scientists and engineers estimate the probabilities of some events on the b asis of scientific understan ding and experience, and then use mathematical rules to compute csti mates of the probabilities of other events. In the rest of this section, we will explain so me of these rules and show how to usc them.
Axioms of Probability The subject of probability is based on three commonsense rules, known as axioms. T hey are: The Axioms of Probability
1. 2. 3.
LetS b e a sample space. Then P(S) = L. For any event A, 0 ~ P(A) ~ l. If A and Bare mutually exclusive events, then P(A U B)= P(A) + P(B). More gene rally, if A 1, A2 , .. . are mutually exclusive events, then P(A , U A2 U · · ·) = P(A,) + P (A 2) + · · ·.
70
CHAPTER 3
Probability
With a little thought, it is easy to see that the three axioms do indeed agree with common sense. The first ax iom says that the outcome of an experiment is a! ways in the sample space. This is obvious, because by definition the sample space contains all the possible outcomes of the experiment. The second axiom says that the long-run frequency of any event is always between 0 and 100%. For an example illustrating the third axiom, we previously discussed a process that manufactures steel pins, in which the probability that a pin is too short is 0.02 and the probability that a pin is too long is 0.03. The third axiom says that the probability that the pi n is either too short or too long is 0.02 + 0.03 = 0.05. We now present two simple rules that are helpful in computing probabilities. These rules are intuitively obvious, and it can be shown that they follow logically from the axioms. For any event A , (3. 1)
Let 0 denote the empty set. Then
P(0) = 0
(3.2)
Equation (3.1) says that the probability that an event does not occur is equal to 1 minus the probability that it does occur. For example, if there is a 40% chance of rain, there is a 60% chance that it does not rain. Equation (3.2) says that it is impossible for an experiment to have no outcome.
Example A target on a test firing range consists of a bull's-eye with two concentric rings around it. A projectile is fired at the target. The probability that it hits the buH's-eye is 0.1 0, the probability that it hits the inner ring is 0.25 , and the probability that it hits the outer ring is 0.45 . What is the probability that the projectile hits the target? What is the probability that it misses the target?
Solution Hitting the bull's-eye, hitting the inner ring, and bitting the outer ring are mutually exclusive events, since it is impossible for more than one of these events to occur. Therefore, using Ax iom 3, ?(hits target) = P (bull's-eye) + P (inner ring)+ P(outer ring) = 0.10 + 0.25
+ 0.45
= 0.80
We can now compute the probability that the projectile misses the target by using Equation (3. 1): P(misses target) = 1 - ?(hits target) = 1-0.80
= 0.20
3.1
Basic Ideas
71
Sample Spaces with Equally likely Outcomes For some experiments, a sample space can be constructed in which all the outcomes are equally likely. A simple example is the roll of a fair die, in which the sample space is {I, 2, 3, 4, 5, 6} and each of these outcomes has probability 1/ 6. lf a sample space contains N equally likely outcomes, the probability of each outcome is 1/ N. This is so because the probability of the whole sample space must be 1, and this probability is equally divided among the N outcomes. If A is an event that contains k outcomes, then P(A) can be found by summing the probabilities of the k outcomes, so P(A) = k/ N. If S is a sample space containing N equally likely outcomes, and if A is an event containing k outcomes, then P(A) =
!:._
(3.3)
N
E xample An extrusion die is used to produce aluminum rods. Specifications are given for the length and the diameter of the rods. For each rod, the length is classified as too short, too long, or OK, and the diameter is classified as too thin, too thick, or OK. In a population of 1000 rods, the number of rods in each class is as follows: Diameter Length Too Short OK Too Long
Too Thin
OK
Too Thick
10 38 2
3 900 25
5 4 13
A rod is sampled at random from this population. What is the probability that it is too short? So l uti on
We can think of each of the 1000 rods as an outcome in a sample space. Each of the 1000 outcomes is equally likely. We'll solve the problem by counting the number of outcomes that correspond to the event. The number of rods that are too short is 10 + 3 + 5 = 18. Since the total number o f rods is 1000, 18 P(too short) = 1000
The Addition Rule If A and Bare mutually exclusive events, then P(A U B)= P(A) + P (B). This rule can be generalized to cover the case where A and Bare not mutually exclusive. Example 3.5 illustrates the reasoning.
12
CHAPTER
3
Probability
Example Refer to Example 3.4. If a rod is sampled at random, what is the probability that it is either too short or too thick? Solution First we'll solve this problem by counting the number of outcomes that correspond to the event. In the followi ng table the numbers of rods that are too thick are circled, and the numbers of rods that are too short have rectangles around them. Note that 5 of the rods are both too short and too thick.
Diameter Too Short Length
Too Thin
OK
Too Thick
ITQ]
[]]
38 2
900 25
~
OK Too Long
®
([])
Of the 1000 outcomes, the number that are either too short or too thick is 10 + 3 + 5 + 4 + I 3 = 35. Therefore 35 P (too short or too thick) = - 1000 Now we will solve the problem in a way that leads to a more general method. In the sample space, there are 10 + 3 + 5 = 18 rods that are too short and 5 + 4 + 13 = 22 rods thal are too thick. But if we try to find the number of rods that are either too short or too thick by adding J 8 + 22, we get too large a number (40 instead of 35). The reason is that there are five rods that are both too short and too thick, and these are counted tw ice. We can still solve the problem by add ing 18 and 22, but we must then subtract 5 to correct for the double counting. We restate thi s reasoning, using probabilities: 18 P (too short)=--, 1000
22 P(too thick) = - - , 1000
P(too short or too thick) = P(too short) 18 I 000
. 5 P(too short and too thick) = - 1000
+ P(too thick) +
- P(too short and too thick)
22
5
1000
I 000
35 1000 The method of Example 3.5 holds for any two events in any sample space. In general, to find the probability that either of two events occurs, add the probabilities of the events and then subtract the probability that they both occur.
3.1
Basic Ideas
Summary
73
ll. I
Let A and B be any events. T hen P (A U B)= P(A)
+ P(B)- P(A n B)
(3.4)
Exercises for Section 3.1 1. The probability that a bearing fa il s d uring the first
month of use is 0.1 2. What is the probability that it does not fa il dming the fi rst mo nth? 2. An die (six faces) has the number 1 painted o n three of its faces, the number 2 painted on two of its faces, and the number 3 painted on one face. Assume that each face is equally likely to come up. a. Find a sample space for this experiment. b. Find P(odd number). c. If the die were loaded so that the face with the 3 on it were twice as likely to come up as each of the other fi ve faces, would th is change the sample space? Explain. d. If the die were loaded so that the face with the 3 on it were twice as likely to come up as each of the other five faces, would this change the value of P(odd number)? Explain. 3. Silicon wafers are used in the manufacture of integrated circuits. Of the wafers manufactured by a certain process, 10% have resistances below specification, and 5% have resistances above spec ification. a. What is the probability that the resistance of a randomly chosen wafer does not meet the specification~
b. If a randomly chosen wafer has a resistance that does not meet the specification, what is the probability that it is too low? 4. A system contai ns two components, A and B. The system will function so long as either A or B functions. The probability that A functions is 0.95, the probability that B functions is 0.90, and the probability that both function is 0.88. What is the probability that the system functions?
5. A system contains two components, A and B. The system will function o nly if both components function. The probability that A fu nctio ns is 0.98, the probability that B functions is 0.95, and the probability that either A or B functions is 0.99. What is the probability that the system functions? 6. Human blood may contain either or both of two antigens, A and B. Blood that contains only the A antigen is called type A, blood that contains on ly the B antigen is called type B, blood that contains both antigens is called type AB, and blood that contains neither antigen is called type 0 . At a certain blood bank, 35% of the blood d onors have type A blood, 10% have type B, and 5% have type AB. a. What is the probability that a randomly chosen blood donor is type 0 ? b. A recipient with type A blood may safely receive blood from a donor whose blood does not contain the B antigen. What is the probab ili ty that a randomly chosen blood donor may donate to a recipient with type A blood? 7. Sixty percent oflarge purchases made at a certain computer retailer are personal computers, 30% are laptop computers, and 10% are peripheral devices such as printers. As part of an audit, one purchase record is sampled at random. a. What is the probability that it is a personal computer? b. What is the probability that it is either a personal computer or a laptop computer? 8. A fl ywheel is attached to a crankshaft by 12 bolts, numbered I through 12. Each bolt is checked to determine whether it is torqued con ectly. Let A be the event that
74
CHAPTER 3
Probability
all tlw bolts are torqued correctly, let B be the event that the #3 bolt is not torqued conectly, let C be the event that exactly one bolt is not torqued con ectly, and let D be the event that bolts #5 and #8 are torqued correctly.
State whether each of the following pairs of events is mutually exclusive. a. A and B b. 8 and D
c. C and D
d. Band C
3.2 Conditional Probability and Independence A sample space contai ns all the possible outcomes of an experiment. Sometimes we obtain some additional information abo ut an experiment that tells us that the outcome comes from a certain part of the sample space. In this case, the probability of an event is based on the outcomes in that part of the sample space. A probability that is based on a part of a sample space is called a conditional probability. We explore this idea through some examples. In Example 3.4 (in Section 3.1) we d iscussed a population of 1000 alurrri nu m rods. For each rod, the length is classified as too short, too long, or OK, and the diameter is classified as too thin, too thick, or OK. These 1000 rods f01m a sample space in which each rod is equally likely to be sampled. The number of rods in each category is presented in Table 3.1. Of the 1000 rods, 928 meet the diameter specification. Therefore, if a rod is sampled, P(diameter OK) = 928/1000 = 0.928. This probability is called the unconditional probability, since it is based on the entire sample space. Now assume that a rod is sampled and found to meet the length specification. What is the probability that the rod also meets the diameter specification? The key to computing this probability is to realize that knowledge that the length meet<; the specification reduces the sample space from which the rod is drawn. Table 3.2 presents this idea. Once we know that the length specification is met, we know that the rod will be one of the 942 rods in the sample space presented in Table 3.2.
TABLE 3.1 Sample space containing 1000 aluminum rods Diameter Length Too Short OK Too Long
Too Thin
OK
Too Thick
10 38 2
3 900
5 4 13
25
TABLE 3.2 Reduced sample space containing 942 aluminum rods that meet the length specif ication Diameter Length Too Short OK Too Long
Too Thin
OK
Too Thick
38
900
4
3.2 Conditional Probability and Independence
75
Of the 942 rods in this sample space, 900 of them meet the diameter specification. Therefore, if we know that the rod meets the length specification, the probability that the rod meets the diameter specification is 900/ 942. We say that the conditional probability that the rod meets the diameter specification given that it meets the length specification is equal to 900/942, and we write P(diameter OK ! length OK) = 900/942 = 0.955. Note that the conditional probability ?(diameter OK ! length OK) diffe rs from the unconditional probability P(diameter OK), which was computed from the full sample space (Table 3.1) to be 0.928.
Example Compute the conditional probability P(diameter OK !length too long) . Is this the same as the unconditional probability ?(di ameter OK)? Solution
The conditional probability ?(diameter OK 1 length too long) is computed under the assumption that the rod is too long. Thi s reduces the sample space to the 40 items indicated in boldface in the following table. Diameter Length Too Short OK Too Long
Too Thin
OK
Too Thick
10 38 2
3 900 25
5 4 13
Of the 40 outcomes, 25 meet the diameter specification. Therefore 25 P(diameter OK I length too long) = = 0.625 40 The unconditional probability P(diameter OK) is computed on the basis of alllOOO outcomes in the sample space and is equal to 928/1000 = 0.928. In this case, the conditional probability differs from the unconditional probability. Let's look at the solution to Example 3.6 more closely. We found that 25 40 In the answer 25 /40, the denominator, 40, represents the number of outcomes that satisfy the condition that the rod is too long, while the numerator, 25, represents the number of o utcomes that satisfy both the condition that the rod is too long and that its diameter is OK. If we divide both the numerator and denomi11ator of this answer by the number of outcomes in the full sample space, which is 1000, we obtain ?(diameter OK I length too long)=
?(diameter OK ! length too long) =
25/1000 4011000
76
CHAPTER 3
Pro ba bility
Now 40/ 1000 represents the probability of satisfying the condition that the rod is too long. That is, 40 ? (length too long) = - 1000
The quantity 25 j 1000 represents the p robability of satisfying both the condition that the rod is too long and that the diameter is OK. That is, 25 P (d1ameter OK and length too long) = - 1000 0
We can now express the conditional probability as ?(diameter OK and length too long) ? (diameter OK I length too long)= ----'----- -- -=---- - =? (length too long) This reasoning can be extended to construct a definition of conditional probability that holds for any sample space:
Definition Let A and B be events with P ( B ) B is
t=
0. The conditional probability of A given
P (AIB) = P(A n B ) P( B)
(3.5)
Figure 3.1 presents Venn diagrams to illustrate the idea of conditional probability.
(]) (a)
(b)
FIGURE 3.1 (a) The diagram represents the unconditional probability P(A). P(A) is illusu·ated by consideiing the event A in proportion to the entire sample space, which is represented by the rectangle. (b) The diagram represents the conditional probability P (AIB). Since the event B is known to occur, the event B now becomes the sample space. For the event A to occur, the outcome must be in the intersection A n B. The conditional probability P (A IB) is therefore illustrated by co nsidering the intersection A n B in proportion to the entire event B .
3.2
Conditional Probability an d Independence
71
Independent Events Sometimes the knowledge that one event has occurred does not change the probability that another event occurs.ln this case the conditional and unconditional probabilities are the same, and the events are said to be independent. We present an example.
Example If an aluminum rod is sampled from the sample space presented in Table 3.1, find P(too long) and P(too long I too thin) . Are these probabilities different? Solution
40 P (too long) = IOOO = 0.040 P (too long and too thin) P(too long I too thin) = - - - - - - - P(too thin)
2jl000
=--50/ 1000 = 0.040
The conditional probability and the unconditional probability are the same. The information that the rod is too thin does not change the probabil ity that the rod is too long.
Example 3.7 shows that knowledge that an event occurs sometimes does not change the probability that another event occurs. In these cases, the two events are said to be independent. The event that a rod is too long and the event that a rod is too thin are independent. We now give a more precise definition of the term , both in words and in symbols.
Definition Two events A and B are independent if the probability of each event remains the same whether or not the other occurs. In symbols: Tf P(A) i 0 and P(B) i 0, then A and B are independent if P(BIA) = P(B)
or, eq uivalentl y,
P (A IB) = P (A)
(3.6)
If either P (A) = 0 or P(B) = 0, then A and Bare independent.
If A and B are independent, then the following pairs of events are also independent: A and Be, A e and B, and A e and Be. The proof of this fact is left as an exercise.
78
CHAPTER 3
Probability
The concept of independence can be extended to more than two events:
Definition Events A 1, A2 , ..• , A, are independent if the probability of each remains the same no matter which of the others occur. Jn symbols: Events A 1 , A2 , ... , An are independent iffor each A ;, and each collection Aj t •. .. , A,;m of events with P(Aj i n · · · n Ajm) =f: 0, P(A;I A.i 1
n · · · n Ajm) =
P(A ;)
(3.7)
The Multiplication Rule Sometimes we know P(A IB) and we wish to fi nd P(A n B). We can obtain a result that is useful for this purpose by multiplying both sides of Equation (3.5) by P(B). This leads to the multiplication rule. If A and B are two events with P(B) P(A
n B)=
If A and B are t wo events with P(A) P(A
=f: 0, then
n B)
P( B )P(AIB)
(3.8)
=f: 0, then
= P(A)P(BIA)
(3.9)
If P(A) -=f. 0 and P(B) -=f. 0, then Equations (3.8) and (3.9) both hold. When two events are independent, then P(A IB) = P(A) and P(B lA) = P(B) , so the m ultip lication rule simplifies:
If A and B are independent events, then P(A
n B)= P(A)P(B )
(3.10)
This result can be extended to a ny number of events. If A 1 , A2, ... , An are independent events, then for each collection A .i 1 , ••• , A jm of events (3. 11)
In particular, P(A 1 n A 2 n
... n A,) =
P(A 1)P(A 2)
••.
P(An)
(3.12)
3.2
Conditional Probability and Independence
79
Example It is known that 5% of the cars and l 0% of the light trucks produced by a certain manufacturer require warranty service. If someone purchases both a car and a light tluck from this manufacturer, then, assuming the vehicles function independently, what is the probability that both will require warranty service? Solution
We need to compute P(car requires service and truck requires service). Since the vehicles function independently, we may use Equation (3.10): P(car requires service and truck requires service)
=
P(car requires service) P(truck requires service)
= (0.05) (0.10) = 0.005
Equations (3. 10) and (3. 11 ) tell us how to compute probabilities when we know that events are independent, but they are usually not much help when it comes to deciding whether two events really are independent. In most cases, the best way to determine whether events are independent is through an understanding of the process that produces the events. Here are a few illustrations: •
•
•
•
A die is rolled twice. It is reasonable to believe that the outcome of the second roll is not affected by the outcome of the fi rst roll. Therefore, knowing the outcome of the first roll does not help to predict the outcome of the second roll. The two rolls are independent. A certain chemical reaction is run twice, using different equipment each time. It is reasonable to believe that the yield of one reaction will not affect the yield of the other. In this case the yields are independent. A chemical reaction is run twice in succession, using the same equipment. In this case, it might not be wise to assume that the yields are independent. For example, a low yield on the first run might indicate that there is more residue than usual left behind. This mi ght tend to make the yield on the next run higher. Thus knowing the yield on the first run could help to predict the yield on the second run. The items in a simple random sample may be treated as independent, unless the population is finite and the sample comprises more than about 5 % of the population (see the discussion of independence in Section 1.1 ).
Application to Reliability Analysis Rel iability analysis is the branch of engineering concerned with estimating the failure rates of systems. While some problems in re]jability analysis require advanced mathematical methods, there are many problems that can be solved with the methods we have learned so far. We begin with an example illustrating the computation of the reliability of a system consisting of two components connected in series.
80
CHAPTER 3
Probability
Example A system contains two components, A and B, connected in series as shown in the following diagram.
The system will function only if both components function. The probability that A functions is given by P(A) = 0.98, and the probability that B functions is given by P(B) = 0.95. Assume that A and B function independentl y. Find the probability that the system functions. Solution
Since the system will fu nction only if both components func tion, it follows that P(system functions) = P(A n B) = P(A)P(B) by the assumption of independence = (0.98)(0.95) = 0.931
Example 3. 10 illustrates the computation of the reliability of a system consisting of two components connected in parallel.
Example A system contains two components, C and D, connected in parallel as shown in the following diagram.
The system will function if either C or D functions. The probab ility that C functions is 0.90, and the probability that D functions is 0.85. Assume C and D function independently. Find the probability that the system fu nctions. Solution
Since the system will function so long as either of the two components functions, it follows that P(system functions) = P(C U D)
+ P(D)- P(C n D) P(C) + P (D) - P (C)P (D)
= P(C) =
by the assumption of independence = 0.90 + 0.85 - (0.90)(0.85) = 0.985
3.2
Conditional Probability and Independence
81
The reliability of more complex systems can often be determined by decomposing the system into a series of subsystems, each of which contains components connected either in series or in parallel. Example 3.11 illustrates the method.
Example The thesis "Dynamic, Single-Stage, Multiperiod, Capacitated Production Sequencing Problem with Multiple Parallel Resources" (D. Ott, M.S. thesis, Colorado School of Mines, 1998) describes a production method used in the manufacture of aluminum cans. The following schematic diagram, slightly simplified, depicts the process .
Print
Dcpalletize
Fill
The initial input into the process consists of coiled aluminum sheets, approximately 0.25 mm thick. In a process known as "cupping," these sheets are uncoiled and shaped into can bodi es, which are cylinders that are closed on the bottom and open on top. These can bodies are then washed and sent to the printer, which prints the label on the can. In practice there are several printers on a line; the diagram presents a line with three printers. The printer deposits the cans onto pallets, which are wooden structures that hold 7140 cans each. The cans next go to be filled. Some fill lines can accept cans directly from the pallets, but others can accept them only from cell bins, which are large containers holding approximately 100,000 cans each. To use these fill lines, the cans must be transported from the pallets to cell bins, in a process called depalletizing. In practice, there are several fill lines; the diagram presents a case where there are two fill lines, one of which will accept cans from the pallets, and the other of which wiJl not. In the filling process the cans are filled, and the can top is seamed on. The cans are then packaged and shipped to distributors. It is desired to estimate the probability that the process will function for one day without failing. Assume that the cupping process has probability 0.995 of functioning successfully for one day. Since this component is denoted by "/\' in the diagram, we will express this probability as P(A) = 0.995. Assu me that the other process components have the following probabilities of functioning successfully during a one-day period: P(B) = 0.99, P(C) = P(D) = P(E) = 0.95, P(F) = 0.90, P(C) = 0.90, P(H) = 0.98. Assume the components function independently. Find the probability that the process functions successfully for one day. Solution
We can solve this problem by noting that the entire process can be broken down into subsystems, each of which consists of simple series or parallel component systems. Specifically, subsystem I consists of the cupping and washing components, which are connected in seties. Subsystem 2 consists of the printers, which are connected in parallel.
82
CHAPTER
3
Probability
Subsystem 3 consists of the fill lines, which are connected in parallel, with one of the two lines consisting of two components connected in series. We compute the probabilities of successful functioning for each subsystem, denoting the probabilities PI , p2 , and P3· ?(subsystem 1 functions)
= p 1 = P(A n B)
= P(A)P(B) = (0.995)(0.990) = 0.985050
?(subsystem 2 functio ns)
= P1 = 1- ?(subsystem 2 fails) = 1 - P(Cc n DCn Ec) = I - P(Cc)P(D'' )P(Ec)
= 1- (0.05) 3
= 0.999875 Subsystem 3 functions if F functions, or if both G and H function. Therefore, ?(subsystem 3 fu nctions)
=
P3
= = = =
P(F U (G
n
H))
+ P(G n H) - P(F n G n H) P(F) + P(G)P(H) - P(F)P(G)P(H) (0.90) + (0.90)(0.98) - (0.90)(0.90)(0.98) P(F)
= 0.988200 The entire process consists of the three subsystems connected in series. Therefore, for the process to function, all tlu·ee subsystems must function. We conclude that
?(system functions) = P (systems I , 2, and 3 all fu nction)
= PIP2P3 = (0.985050)(0.999875)(0.988200)
= 0.973 We remark that the assumption that the components function independently is crucial in the solutions of Examples 3.9, 3.10, and 3.1 I. When this assumption is not met, it can be very difficult to make accurate reliability estimates. If the assumption of independence is used without justification, reliabi lity estimates may be misleading.
Exercises for Section 3.2 1. Suppose that start-up companies in the area of biotechnology have probabi lity 0.2 of becoming profitable and that those in the area of information teclmology have probability 0. 15 of becoming profitable. A venture capitalist invests in one firm of each type. Assume the companies function independently.
a. What is the probabil ity that both companies become profitable? b. What is the probability that nei ther company become profitable? c. What is the probability that at least one of the two companies become profitable?
3.2 Conditional Probability and Independence
2. A drag racer has two parachutes, amain and a backup, that are designed to bring the vehicle to a stop after the end of a run. Suppose th at the main chute deploys with probability 0.99 and that if the main fa il s to deploy, the backup deploys with probability 0.98 . a. What is the probability that one of the two parachutes deploys? b. What is the probability that the backup parachute deploys? 3. A population of 600 semiconductor wafers contains wafers from three lots. The wafers are categorized by lot and by whether they conform to a thickness specification. T he following table presents the number of wafers in each category. A wafer is chosen at random from the population.
Lot
Conforming
Nonconforming
A
88 165 260
12 35 40
B
c
a. If the wafer is from Lot A, what is the probability that it is conforming? b. If the wafer is conforming, what is the probability that it is from Lot A? c. If the wafer is conforming, what is the probability that it is not from Lot C?
83
a. What is the probability that a randomly sampled indi vidual, Gene I is dominant? b. What is the probabi lity that a randomly sampled individual , Gene 2 is dominant? c. Given that Gene I is dominant, what is the probability that Gene 2 is dominant? d. These genes are said to be in linkage equilibrium if the event that Gene l is dominant is independent of the event that Gene 2 is donunant. Are these genes in linkage equilibrium? 6. A system consists of four components connected as shown in the following diagram:
Assume A, B, C, and D function independently. If the probabilities that A, B, C, and D fail are 0.1 0, 0.05, 0. 10, and 0.20, respectively, what is the probability that the system functions? 7. A system consists of four components connected as shown in the following diagram:
d. If the wafer is not from Lot C, what is the probabil ity that it is conforming? 4. Refer to Exercise 3. Let E 1 be the event that the wafer comes from Lot A, and let £ 2 be the event that the wafer is conforming. Are £ 1 and £ 2 independent? Explain.
5. A geneticist is studying two genes. Each gene can be either dominant or recessive. A sample of 100 individuals is categorized as follows.
Gene 2 Gene 1 Dominant Recessive
Dominant
Recessive
56 14
24 6
Assume A, B, C, and D function independently. If the probabilities that A, B, C, and D fail are 0.1 , 0.2, 0.05, and 0.3, respectjvely, what is the probability that the system functions?
84
CHAPTER 3
Probability
8. A system contains two components, A and B, connected in series, as shown in the diagram.
Assume A and B fun ction independently. For the system to fun ction, both components must function. a. If the probability that A fails is 0.05, and the probability that B fai ls is 0.03, find the probability that the system functio ns. b. If both A and B have probability p of failing, what must the value of p be so that the probabi lity that the system functions is 0.90? c. If three components are connected in series, and each has probability p of failing, what must the value of p be so that the probability that the system functions is 0.90?
a. If the probability that C fails is 0.08 and the probability that D fails is 0.12, find the probabil ity that the system functions. b. If both C and D have probability p offailing, what must the value of p be so that the probability that the system functions is 0.99? c. If three components are connected in parallel, function independently, and each has probability p of failin g, what must the value of p be so that the probability that the system functions is 0.99? d. If components function independently, and each component has probability 0.5 of failing, what is the minimum number of components that must be connected in parallel so that the probabil ity tl1at the system functi ons is at least 0.99?
9. A system contains two components, C and D , connected in parallel as shown in the diagram.
10. If A and B are independent events, prove that the following pairs of events arc independent: A< and B, A and w·, and A c and B ".
Assume C and D functi on independently. For the system to function, either Cor D must function.
11. An electronic message consists of a string of bits (Os and I s). The message mu st pass through two relays before being received. At each relay the probability is 0. 1 that the bit will be reversed before being relayed (i.e., a I will be changed to a 0, or a 0 to a 1). Find the probability that the value of a bit received at its final destination is the same as the value of the bit that was sent.
3.3 Random Variables In many situations, it is desirable to assign a numerical value to each outcome of an experiment. Such an assignment is called a random variable. To make the idea clear, we present an example. Suppose that three machines are available to cut concrete blocks. Each machine needs to be brought down from time to time for maintenance. At any given moment, the probability that a machine is down is 0.10, and the probability that it is functioning is 0.90. Assume the machines function independently. There are eight possible outcomes regarding which of the machines are up and which are down. Their probabilities are easy to compute. For example, the probability that Machine I is up, Machine 2 is down, and Machine 3 is up is (0.9)(0. I )(0.9) = 0.081.
3.3
Random Variables
85
The sample space that lists these outcomes, along with their probabi lities, is presented in the following table. Machine
1
2
3
Up Up Up Up Down Down Down Down
Up Up Down Down Up Up Down Down
Up Down Up Down Up Down Up Down
Probability
(0.9)(0.9)(0.9) (0.9) (0.9) (0.1) (0.9)(0.1) (0.9) (0.9)(0. 1)(0.1) (0.1 )(0.9)(0.9) (0. 1)(0.9) (0.1) (0.1 )(0.1)(0.9) (0. 1)(0. 1)(0. 1)
= = = = = = = =
0.729 0.081 0.081 0.009 0.081 0.009 0.009 0.001
Now let us suppose that what is important is the number of machines that are up, not specifically which machines are up. We will therefore assign to each outcome the quantity representing the number of machines that are up. This assignment, represented by the letter X, is presented in the following table. Machine
1
2
3
X
Up Up Up Up Down Down Down Down
Up Up Down Down Up Up Down Down
Up Down Up Down Up Down Up Down
3 2 2 1
2 1 1 0
Probability
(0.9)(0.9) (0.9) (0.9)(0.9) (0. 1) (0.9)(0.1) (0.9) (0.9)(0.1)(0.1) (0. 1)(0.9) (0.9) (0. 1)(0.9)(0.1 ) (0.1 )(0. 1)(0.9) (0. 1)(0. 1)(0.1)
= = = = = = = =
0.729 0.08 1 0.081 0.009 0.08 1 0.009 0.009 0.001
The function X , which assigns a numerical value to each outcome in the sample space, is a random variable. A random variable assigns a numerical value to each outcome in a sample space. It is customary to denote random vari ables with uppercase letters. The letters X, Y, and Z are most often used. We can compute probabilities fo r random variables in an obvious way. In the example just presented, the event X= 2 corresponds to the event {(Up, Up, Down), (Up, Down, Up), (Down, Up, Up)} ofthe samplespace. Therefore P(X = 2) = P({(Up, Up, Down), (Up, Down, Up), (Down, Up, Up)})= 0.081 + 0.081 + 0.081 = 0.243.
86
CHAPTER
3
Probability
E xample
~
List the possible values of the random variable X, and find the probability of each of them. Solution The possible values are 0, 1, 2, and 3. To find the probability of one of these values, we add the probabilities of the outcomes in the sample space that correspond to the value. The result<; are given in the following table.
X
0 I 2 3
P(X
= x)
0.001 0.027 0.243 0.729
The table of probabilities in Example 3. 12 contains all the information needed to compute any probability regarding the random variable X. Note that the outcomes of the sample space are not presented in the table. When the probabilities pe1iaining to a random variable are known, we usually do not think about the sam ple space; we just focus on the probabilities. There are two important types of random variables, discrete and continuous. A discrete random variable is one whose p ossible values form a discrete set This means that the values can be ordered and there are gaps between adjacent values. The random variable X described in Example 3. 12 is discrete. ln contrast, the possible values of a continuous random variable always contain an interval- that is, all the points be tween some two numbers. We will provide precise definitions of these types of random variables later in this section. We present some more examples of random vari ables.
Example
~
For a certain type of printed-circuit board, 50% contain no defects, 25% contain one defect, 12% contain two defects, 8% contain three defects, and the remaining 5% contain four defects. Let Y represent the number of defects in a randomly chosen board. What are the possible values for Y? Is Y discrete or continuous? Find P(Y = y) for each possible value y. Solution The possible values for Y are the integers 0, I, 2, 3, and 4. The random variable Y is discrete, because it takes on only integer values. Fifty percent of the outcomes in the sample space are assigned the value 0. Therefore P(Y = 0) = 0.5. Similarly P(Y = 1) = 0.25, P(Y = 2) = 0.12, P(Y = 3) = 0.08, and P(Y = 4) = 0.05.
3.3
Random Variables
87
Example
~
A certain type of magnetic disk must function in an environment where it is exposed to corrosive gases. It is known that 10% of all such disks have lifetimes less than or equal to I 00 hours, 50% have lifetimes greater than 100 hours but less than or equal to 500 hours, and 40% have life times greater tha n 500 hours. Let Z represent the number of hours in the lifetime of a randoml y chosen disk. Is Z conti nuous or discrete? Find P(Z ~ 500) . Can we compute all the probabilities for Z? Explain. Solution The lifetime of a component is not limited to a list of discretely spaced values; Z is continuous. Of all the components, 60% have lifetimes less than or equal to 500 hours. Therefore P(Z :::: 500) 0.60. We do not have enough information to compute all the probabilities for Z. We can compute some of them, for example, P (Z :::: 100) = 0.1 0, P(100 < Z ~ 500) = 0.50, and P (Z > 500) = 0.40. But we do not know, for example, the proportio n of components that have lifetimes between 100 and 200 hours, or between 200 and 300 hours, so we cannot find the probability that the random variable Z falls into e ither of these intervals . To compute all the probabilities for Z, we would need to be able to compute the probability for every possible interval -for example, P(200 < Z:::: 300), P(200 < Z ~ 201) , P(200 < Z ~ 200.1), and so on. We will see how this can be done late r in this section, when we discu ss continuous random variables.
=
Random Variables and Populations It is often useful to think of a value of a random variable as having been sampled from a population. For example, consider the random variable Y described in Example 3.1 3. Observing a value for this random variable is like sampling a value from a population consisting of the integers 0, l, 2, 3 in the following proportions: Os, 50%; l s, 25%; 2s, 12%; 3s, 8%; and 4s; 5%. For a continuous random variable, it is appropriate to imagine an infinite population containing all the possible values of the random variable. For example, for the random variable Z in Example 3.14 we would imagine a population containing all the positive numbers, with 10% of the popul ation values less than or equal to 100, 50% greater than 100 but less than or equal to 500, and 40% greater than 500. The proportion of population values in any interval would be equal to the probability that the variable Z is in that interval. Methods for working with random variables differ somewhat between discrete and continuous random variables. We begi n with the discrete case.
Discrete Random Variables We begin by reviewing the definition of a discrete random variable.
Definition A random variable is discrete if its possible values form a discrete set. This means that if the possible values are arranged in order, there is a gap between each value and the next one. The set of possible values may be infinite; for example, the set of all integers and the set of all positive integers are both discrete sets.
88
CHAPTER 3
Probability
It is common for the possible values of a discrete random variable to be a set of integers. For any discrete random variable, if we specify the list of its possible values along with the probability that the random variable takes on each of these values, then we have completely described the population from which the random variable is sampled. We illustrate with an example. The number of flaws in a l-inch length of copper wire manufactured by a certain process varies from wire to wire. Overall, 48% of the wires produced have no flaws, 39% have one flaw, 12% have two flaws, and 1% have three flaws. Let X be the number of flaws in a randomly selected piece of wire. Then P(X = 0) = 0.48
P(X = 1) = 0.39
P(X = 2) = 0.12
P (X = 3) = 0.01
The possible values 0, 1, 2, 3, along with the probabilities for each, provide a complete description of the population from which X is drawn. This description has a name-the probability mass function.
Definition
·
· ' I
The probability mass function of a discrete random variable X is the function p(x) = P(X = x). The probability mass function is sometimes called the probability distribution.
Thus for the random variable X representing the number of flaws in a length of wire, p(O) = 0.48, p(l ) = 0.39, p(2) = 0.12, p(3) = 0.0 1, and p(x) = 0 for any value of x other than 0, I, 2, or 3. Note that if the values of the probability mass function are added over all the possible values of X, the sum is equal to 1. This is true for any probability mass function. The reason is that summing the values of a probability mass function over all the possible values of the corresponding random variable produces the probability that the random variable is eq ual to one of its possible values, and this probability is always equal to 1. The probability mass function can be represented by a graph in which a vertical line is drawn at each of the possible values of the random variable. The heights of the lines are equal to the probabilities of the corresponding values. The physical inteq)retation of this graph is that each line represents a mass equal to its height. Figure 3.2 presents a graph of the probability mass function of the random variable X.
The Cumulative Distribution Function of a Discrete Random Variable The probability mass function specifies the probability that a random variable is equal to a given value. A function called the cumulative distribution function specifies the probability that a random variable is less than or equal to a given value. The cumulative distribution function of the random variable X is the function F(x) = P (X S x) .
3.3
Random Variables
89
0.6 0.5
~
0.4
:.0 0.3
"'....
.0 0
0..
0.2 0.1 0
I
0
3
2
Number of flaws
FIGURE 3.2 Probability mass function of X , the number of flaws in a randomly chosen piece of wire.
Example Let F(x) denote the cumulative di stribution function of the random variable X that represents the number of flaws in a randomly chosen wire. Find F (2) . Find F ( 1. 5) . Solution Since F(2) = P(X :::: 2), we need to find P(X :::: 2). We do this by summing the probabilities for the values of X that are less than or equal to 2, namely, 0 , 1, a nd 2. T hus
F(2) = P(X :::;: 2)
+ P(X = 0.48 + 0.39 + 0.12
= P(X = 0)
=
1)
+ P(X =
2)
= 0.99
Now F(l.S) = P (X .::; 1. 5). T herefore, to compute F( l. S) we must sum the probabilities for the values of X that are less than or equal to 1.5, which are 0 and 1. Thus F(1.5) = P(X .::; l.S)
= P(X = 0)
+ P(X =
1)
= 0.48 + 0.39 = 0.87 In general , for any discrete random variable X , the c umulative distribution function F (x) can be computed by summi ng the probabilities of all the possible values of X that are less than or equal to x. Note that F(x) is defined for any number x, not just for the possible values of X.
90
CHAPTER
3
Probability
-
~~~
~--
------------
-
Summary
--- - -
-
·
·
- -
Let X be a discrete random variable. Then • •
The probability mass function of X is the function p(x) = P(X = x ). The cumulative distribution function of X is the function F(x) = P(X ::::; x).
•
F(x)
= 2: p(t) =
L
l ~X
P (X
= t).
t ~x
• L p(x) = L P (X = x) = 1, where the sum is over all the possible X
X
values of X.
Example
~
Plot the cumulative distribution functi on F(x) of the random variable X that represents the number of flaws in a randomly chosen wire. Solution
First we compute F(x) for each of the possible values of X , which are 0, I , 2, and 3. F(O) = P(X ::::; 0) = 0.48
F(l)
= P(X ::::;
1) = 0.48 + 0.39
F(2) = P(X ::::; 2) = F(3)
= P(X ::::; 3) =
= 0.87 0.48 + 0.39 + 0.12 = 0.99 0.48 + 0.39 + 0. 12 + 0.01 = 1
For any value x , we compute F(x) by summing the probabilities of all the possible values of X that are less than or equal to x . For example, if 1 ::::; x < 2, the possible values of X that are less than or equal to x are 0 and 1, so F(x) = P(X = 0) + P(X = 1) = F(l) = 0.87. Therefore
F(x)
=
0
x
0.48 0.87 0.99
O::::;x < l l ::::; x < 2 2::::;x < 3
l
x:::3
1
A plot of F(x) is presented in the following figure. I
0.99 0.87
0.48 r-----o
0
2
3
4
3.3
Random Variables
91
For a discrete random variable, the graph of F(x) consist~ of a series of horizontal lines (called "steps") with jumps at each of the possible values of X. Note that the size of the jump at any point x is equal to the value of the probability mass function p(x) = P(X = x).
Mean and Variance for Discrete Random Variables The population mean of a discrete random variable can be thought of as the mean of a hypothetical sample that follows the probability distribution perfectly. To make this idea concrete, assume that the number of flaws in a wire, X, has the probability mass function given previously, with P(X = 0) = 0.48, P(X = 1) = 0.39, P(X = 2) = 0.12, and P(X = 3) = 0.01. Now imagine th at we have a sample of 100 wires and that the sample follows this distribution perfectly, so that exactly 48 of the wires have 0 flaws, 39 have 1 flaw, 12 have 2 flaws, and 1 has 3 flaws. The sample mean is the total number of flaws divided by I 00: Mean= 0(48)
+ 1(39) + 2(12) + 3(1)
= 0.
100
66
This can be rewritten as Mean= 0(0.48)
+ 1(0.39) + 2(0. 12) + 3(0. 01)
= 0.66
This shows that the mean of a perfect sample can be obtained by multiplying each possible value of X by its probability, and summing the products. This is the definition of the population mean of a discrete random variable. T he population mean of a random variable X may also be called the expectation, or expected value, of X , and can be denoted by !J-x, by E(X), or simply by !J-. Sometimes we will drop the word "population," and simply refer to the population mean as the mean.
Definition Let X be a discrete random variable with probability mass function p(x) = P(X = x) . The mean of X is given by 1-Lx
= 2:xP(X = x)
(3.13)
X
where the sum is over all possible values of X. The mean of X is sometimes called the expectation, or expected value, of X and may also be denoted by E(X) ort'by J.l..
92
CHAPTER 3
Probability
Example
~
A certain industrial process is brought down for recalibration whenever the quality of the items produced falls below specifications. Let X represent the number of times the process is recalibrated during a week, and assume that X has the following probability mass function. 1 0.25
2 0.20
3 0.15
4 0.05
Find the mean of X. Solution
Using Equation (3 .13), we compute J..Lx = 0(0.35)
+I (0.25) + 2(0.20) + 3(0.15) + 4(0.05) =
1.30
The population mean has an important physical interpretation. lt is the horizontal component of the center of mass of the probability mass function, that is, it is the point on the horizontal axis at which the graph of the probability mass would balance if supported there. Figure 3.3 illustrates this property for the probability mass function described in Example 3.17, where the population mean is J..L = 1.30. 0.4 0.3
0
;3 ..c
..c "' 0.2
8
p..
0.1 0
I 0
I
t
2
3
4
1L = 1.30
FIGURE 3.3 The graph of a probability mass function will balance if supported at the population mean.
We will describe the population variance of a discrete random variable by making an analogy with the sample variance. The sample variance was discussed in Section 1.2. Recallthatfor a sample X 1, ... , X,, the sample valiance is given by L;(X;- X) 2 /(n - 1). The sample variance is thus essentially the average of the squared differences between the sample points and the sample mean (except that we divide by n- 1 instead of n). By analogy, the population valiance of a discrete random variable X is a weighted average of the squared differences (x - J..L x ) 2 where x ranges through all the possible values of the random variable X. This weighted average is computed by multiplying each squared difference (x - J..Lx) 2 by the probability P(X = x) and summing the results.
3.3
Random Variables
93
The population variance of a random variable X can be denoted by a~, by V(X), or simply by a 2 . The population variance is given by the formula
a~= "L<x- J-Lx) 2 P(X = x) X
By ped"orming some algebra, an alte rnate formula can be obtained.
ai = "Lx 2 P(X = x)- tLix
We also define the population standard deviation to be the square root of the population variance. We denote the population standard deviation of a random variable X by ax or simply by a . As with the mean, we w ill sometimes drop the word "population," and simply refer to the population variance and population standard deviation as the variance and standard deviation, respectively.
Let X be a discrete random variable with probability mass function p(x) = P(X = x) . Then •
The variance of X is given by
a;=
L,:Cx - JJ-x) 2P (X = x)
(3 .1 4)
X
•
An alternate formula for the variance is given by
a~=
I> P(X = x)- f.-L~ 2
(3.15)
X
• •
The variance of X may also be denoted by V (X) or by a 2 . The standard deviation is the square root of the variance: ax =
v'af.
Example Find the variance and standard deviation fo r the random variable X described in Example 3.17, representing the number of times a process is recalibrated. Solution
In Example 3.17 we computed the mean of X to be tLx = 1.30. We compute the variance by using Equation (3.14):
a; = (0 =
= 0) + (1 - 1.30)2 P(X = l) + (2- 1.30)2 P(X = 2) + (3 - L.30) 2 P(X = 3) + (4 - 1.30) 2 P(X = 4) (1 .69)(0.35) + (0.09)(0.25) + (0.49)(0.20) + (2.89)(0. 15) + (7.29)(0.05) 1.30)2 P(X
= 1.51
The standard deviation is ax = .j[5T = 1.23.
94
CHAPTER 3
Probability
E xample
~
Use the alternate formula, Equation (3.15), to compute the variance of X, the number of times a process is recalibrated. Solution In Example 3.17 the mean was computed to be J.-Lx
ai =
.
= 1.30. The variance is therefore
02 P( X = 0) + 12 P(X = 1) + 22 P(X = 2) + 42 P(X = 4) - (1.30) 2
+ 32 P(X =
3)
= (0)(0.35) + (1)(0.25) + (4)(0.20) + (9)(0.15) + (16)(0.05)- (1.30) 2 = 1.51
The Probability Histogram When the possible values of a discrete random variable are evenly spaced, the probability mass function can be represented by a histogram, with rectangles centered at the possible values of the random variable. The area of a rectangle centered at a value x is equal to P(X = x). Such a histogram is called a probability histogram, because the areas represent probabilities. Figure 3.2 presented the graph of the probability mass function of a random variable X representing the number of flaws in a wire. Figure 3.4 presents a probability histogram for this random variable.
0.5
r
0.4 I0.3
-
0.2 0.1 -
0
0
2
3
FIGURE 3.4 Probability histogram for X, the number of flaws in a randomly chosen piece of wire. Compare with Figure 3.2.
The probability that the value of a random variable falls into a given interval is given by an area under the probability histogram. Example 3.20 illustrates the idea.
Example
~
Use the probabi lity histogram in Figure 3.4 to find the probability that a randomly chosen wire has more than one flaw. Indicate this probability as an area under the probability histogram.
3.3
Random Variables
95
0.5 0.4
-
0.3
-
0.2
-
0.1 r 0 0
2
3
FIGURE 3.5 Probability histogram for X , the number of flaws in a randomly chosen piece of wire. The area corresponding to values of X greater than 1 is shaded. This area is equallo P(X > 1). Solution
We wish to find P(X > 1) . Since no wire has more than three flaws, the proportion of wires that have more than one flaw can be found by add ing the proportion that have two flaws to the propot1ion that have three fl aws. In symbols, P (X > I ) = P(X = 2) + P (X = 3) . The probability mass fu nction specifies that P (X = 2) = 0. 12 and P(X = 3) = 0.01 . Therefore P(X > 1) = 0.1 2 + 0.01 = 0. 13. This probability is given by the area under the probability histogram corresponding to those rectangles centered at values greater than I (see Figure 3.5). There are two such rectangles; their areas are P (X = 2) = 0.1 2 and P (X = 3) = O.Ol. This is another way to show that P (X > 1) = 0. I 2 + 0.01 = 0.13. In Chapter 4, we wil I see that probabilities for discrete random vaiiabies can sometimes be approximated by computing the area under a curve. Representing the discrete probabilities with a probability histogram will make it easier to understand how this is done.
Continuous Random Variables Figure 1.8 (in Section 1.3) presents a histogram for the emissions, in grams of particulates per gallon of fuel consumed, of a sample of 62 vehicles. Note that emissions is a continuous variable, because its possible values are not restricted to some d iscretely spaced set. The class intervals are chosen so that each interval contains a reasonably large number of vehicles. If the sample were larger, we could make the intervals narrower. In particular, if we had information on the entire population, containing millions of vehicles, we could make the intervals extremely narrow. The histogram would then look q uite smooth and could be approximated with a curve, which might look like Figure 3.6 (page 96). If a vehicle were chosen at random fro m this population to have its emissions measured, the emissions level X would be a random vaiiable. The probability that X fall s between any two values a and b is equal to the area under the histogram between a and b. Because the histogram in this case is represented by a curve, the probability would be found by computing an integral.
96
CHAPTER 3
Probabilit y
FIGURE 3.6 The histogram for a large conti nuous population could be drawn with extremely narrow rectangles and might look li ke this curve.
The random variable X described here is an example of a continuous random variable. A conti nuous random variable is defined to be a random variable whose probabilities are represented by areas under a curve. T his curve is called the probability density function. Because the probability dens ity function is a curve, the computations of probabilities involve integrals, rather than the sums that are used in the discrete case.
A random variable is continuous if its probabili ties are given by areas under a curve. The curve is called a probability density function for the random variable. The probabili ty density function is sometimes called the probability distribution.
Computing Probabilities with the Probabil ity Density Function Let X be a continuous random variable. Let the function f(x) be the probability density function of X. Let a and b be any two numbers, with a < b. The prop ortion of the population whose values of X lie between a and b is given by f(x) dx, the area under the probability de nsity fu nction between a and b. This is the probability that the random variable X takes on a value between a and b. Note that the area under the curve does not depend on whether the endpoints a and b are included in the interval. Therefore, p robabilities involving X do not depend on whether e ndpoints are included.
J:
Le t X be a continuous random variable with probability density function f(x) . Let a and b be any two numbers, with a < b. Then P(a S X S b) = P(a S X < b)= P(a < X S b)= P(a <X< b)=
In addition, P(X S h)= P(X < b)= P(X
~ a)= P(X > a)=
1: 1
1b
f(x) dx
f(x)dx
(3.16)
f(x)dx
(3.17)
00
3.3
Random Variables
97
If f(x) is the probability density function of a random variable X, then the area under the entire curve fro m -oo to oo is the probability that the value of X is between -oo and oo. This probabil ity must be equal to 1, because the value of X is always between - oo and oo . Therefore the area under the entire curve f(x) is equal to l.
Summary
·
Let X be a continuous random variable with probability density function f(x). Then
1:
f(x)dx =I
£xample A hole is drilled in a sheet-metal component, and then a shaft is inserted through the hole. The shaft clearance is equal to the difference between the radius of the hole and the radius of the shaft. Let the random variable X denote the clearance, in milli meters. The probability density functio n of X is f(x) = {
~.25( 1 -
4
x
)
O <x< I
otherwise
Components with clearances larger than 0.8 nun must be scrapped. What proportion of components are scrapped? Solution
Figure 3.7 presents the probability density functi on of X. Note that the density f (x ) is 0 for x ::; 0 and for x 2: I . This indicates that the clearances are always between 0 and l nm1. The proportion of components that must be scrapped is P(X > 0.8), which is equal to the area under the probability density function to the right of 0.8. 1.4 1.2
0.8 0.6 0.4 0.2
0 0
0.2
0.4
0.6
0.8
FIGURE 3.7 Graph of the probabibty density function of X, the clearance of a shaft. The area shaded is equal to P(X > 0.8).
98
CHAPTER
3
Probability
This area is given by P(X > 0.8) =
( "' f(x) dx
.fo.s =
t
lo.s
I .25(1 - x 4 ) dx
= 1. 25
(X - ~5 ) I~-8
= 0.0819
The Cumulative Distribution Function of a Continuous Random Variable The cumulative distribution function of a continuous random variable X is F(x) P(X ::':: x), just as it is for a discrete random variable. For a discrete random variable, F (x) can be found by summing values of the probability mass function. For a continuous random variable, the value of F(x) is obtained by integrating the probability density function. Since F(x) = P(X ::':: x), it follows from Equation (3. 16) that F (x) f~oo f(t) dt , where f(t) is the probability density function.
Definition Let X be a continuous random variable with probability density function f(x). The cumulative distribution function of X is the function F(x) = P(X ::':: x) =
1~ f(t)dt
(3.18)
Example
~
Refer to Example 3.21. Find the cumulative distribu tion function F(x) and plot it. Solution
The probability density function of X is given by f(t) = 0 if t ::s 0, f(t) = 1.25(1- t 4 ) if 0 < t < 1, and f(t) = 0 if t ::: 1. The cumulative distribution function is given by F(x) = f~00 f(t)dt. Since f(t) is defined separately on three different intervals, the computation of the cumulative distribution function involves three separate cases. If X ::':: 0: F(x) =
1:
f(t) dt
00
=;·X
Odt
-oo
=0
3.3
Random Variables
IfO < x < l : F(x) =
= =
1~ f(t) dt
1: 1°
f(t) dt
+fox f(t) dt
+
Jor 1.25( 1 _ t
odt
-oo
4
)dt
=0 + 1.25(r-~) l :
(x- ~ ) 5
·= 1.25
If X > 1: F(x ) =
1: 1° 1°
f(t) dt
00
=
f(t) dt
-oo
=
Odt
+
-oo
+
t f(t) dt + J1r f(t) dt
lo
t 1.25(1 -
lo
4
t )dt
+
lx 1
~O+L25(t-~)1:+ 0
=0+1+0 = I
Therefore x::s O
0<X < 1
X::: A plot of F(x) is presented here.
0.75 0.50 0.25
I
Odt
99
100
CHAPTER 3
Probability
Note that the cumulative distribution function F(x) in Example 3.22 is a continuous function-there are no jumps in its graph. This is characteristic of continuous random variables . The cumulative distribution function of a continuous random variable will always be continuous, while the cumul ative distribution function of a discrete random variable will never be continuous.
Example Refer to Example 3.21. Use the cumulative distribution function to find the probability that the shaft clearance is less than 0.5 mm. Solution
Let X denote the shaft clearance. We need to find P(X ::: 0.5). This is equivalent to finding F(0.5), where F (x) is the cumulative distribution function. Using the results of Example 3.22, F(0.5) = 1.25(0.5- 0.5 5 / 5) = 0.617.
Mean and Variance for Continuous Random Variables The population mean and variance of a continuous random variable are defined in the same way as those of a discrete random variable, except that the probability density function is used instead of the probability mass function . Specifically, if X is a continuous random variable, its population mean is defi ned to be the center of mass of its probability density function, and its population variance is the moment of inertia around a vertical axis through the population mean. The formulas are analogous to Equations (3.13) through (3.15), with the sums replaced by integrals. As was the case with discrete random variables, we will sometimes drop the word "population" and refer to the population mean, population variance, and population standard deviation more simply as the mean, variance, and standard deviation, respectively.
Let X be a continuous random variable with probability density function f(x). Then the mean of X is given by
11-x =
1:
xf(x) dx
(3 .1 9)
The mean of X is sometimes called tbe expectation, or expected value, of X and may also be denoted by E(X) or by f-L.
3.3
Definition
Random Variables
-
.
101
;
Let X be a continuous random variable with probability density function f(x). Then •
The variance of X is given by a}=
•
2
(3 .20)
(x - f.Lx ) f(x) dx
An altemate formula for the variance is given by cr; =
• •
1: 1:
2
x f(x) dx -
~J-i
(3.2 1)
The variance of X may also be denoted by V (X) or by cr 2 . The standard deviation is the square root of the variance: crx
= foi.
Example Refer to Example 3.21. Find the mean clearance and the variance of the clearance. Solution
1:
Using Equation (3.19), we can find the mean clearance: f.Lx =
xf(x) dx
r' x[l.25(l -
=
.fo
x 4 ) ] dx
Having computed JJ-x = 0.4167, we can now compute a}. It is easiest to use the alternate formula, Eq uation (3.2 1): cr;
= =
1:
2
x f(x) dx -
f.L~
fo' x [1.25(1-x )] dx- (0.4 167)
~ 1 25
2
4
c: x;)1:-
= 0.0645
(0.4167)'
2
102
Probability
CHAPTER 3
Exercises for Section 3.3 1. Dctennine whether each of the followi ng random variables is discrete or continuous. a. The number of heads in 100 tosses of a coin.
in a randomly chosen titanium atom, the probability mass function of X is given as follows: X
24 25 26 27 28 0.0825 0.0744 0.7372 0.0541 0.0518
b. The length of a rod randomly chosen from a day's production.
p(x)
c. T he final exam score of a randomly chosen student from last semester's engineering statistics class.
a. Find J.L x b. Find ax.
d. The age of a randomly chosen Colorado School of Mines student. e. The age that a randomly chosen Colorado School of Mines student will be on his or her next birthday.
2. Computer crups often contain surface imperfections. For a certain type of computer chip, the probabil ity mass function of the number of defects X is presented in the following table. X
I0
2 0. 15
3 0.10
4 0.05
a. Find P (X 52).
p(x)
={
= 1, 2, 3,
ex
x
0
otherwise
or 4
where c is a constant. a. Find the value of the constant c so that p(x) is a probability mass function. b. Find P (X
b. Find P (X > 1).
= 2).
c. Find the mean number of properly functioning
c. Find J.Lx· d. Find
components.
a;.
3. A chemical supply company srups a certain solvent in I 0-gallon drums. Let X represent the number of dmms ordered by a randomly chosen customer. Assume X has the following probability mass function:
2 p(x)
5. A certai n type of component is packaged in lots of four. Let X represent the number of properly functioning components in a randomly chosen lot. Assu me that the probability that exactly x components function is proportio nal to x; in other words, assume that the probability mass function ~f X is given by
0.4
0.2
3 0.2
4 0.1
5
0.1
a. Find the mean number of dmms ordered.
d. Find the variance of the number of properly functioning components. e. Find the standard deviation of the number of properly functioning components.
6. After manufacture, computer d isks are tested for errors. Let X be the number of errors detected on a randomly chosen disk. The following table presents values of the cumulative distribution function F (x) of X.
b. Find the variance of the number of drums ordered. c. Find the standard deviation of the number of drums ordered. d. Let Y be the number of gallo ns ordered. Find the probability mass function of Y. e. Find the mean number of gallons ordered.
f. Find the variance ofthe number of gallons ordered. g. Find the standard deviatio n of the number of gallons ordered. 4. The element titanium has five stable occurring isotopes, differing from each other in the number of neutro ns an atom contains. If X is the number of neutrons
X
F(x)
0
0.41 0.72 0.83 0.95
1 2 3 4
1.00
a. What is the probability that two or fewer errors are detected? b. What is the probability that more than three errors are detected?
Random Variables
3.3
c. What is the probability that exactly one error is detected?
10. The diameter of a rivet (in mm) is a random variable with probability dens ity function
d. What is the probability that no errors are detected? e. What is the most probable number of errors to be detected? 7. Resistors labeled 100 Q have true resistances that are between 80 Q and 120 n . Let X be the mass of a randomly chosen resistor. The probability density function of X is given by X -80 80 <X< 120 f(x) = 8~0 { otherwise a. What proportion of resistors have resistances less than 90Q?
103
={
f(x)
6(x - 12)(13 - x)
0
12 <X :5 13 otherwise
a. What is the probability that the diameter is less than 12.5 rom? b. Find the mean diameter. c . Find the standard deviation of the diameters.
d. Find the cumulative distribution function of the diameters. e. The specification for the diameter is 12.3 to 12.7 mm. What is the probability that the specification is met?
b. Find the mean resistance. c. Find the standard deviation of the resistances. d. Find the cumulative distribution function of the resistances.
8. Elongation (in %) of steel plates treated with aluminum are random with probability density function f(x)
= { 2~0
20 < X< 30 otherwise
a. What proportion of steel plates have elongations greater than 25%? b. Find the mean elongation. c. Find the variance of the elongations . d. Find the standard deviation of the elongations. e. Find the cumulative di stribution function of the elongations . f. A particular plate elongates 28%. What proportion of plates elongate more than this?
9. The li fetime of a transistor in a certain application has a lifetime that is random with probability density function O.le-O.It t > 0 f(t) = { 0 t :S O a. Find the mean lifetime. b. Find the standard deviation of the lifetimes.
11. The concentration of a reactant is a random variable with probability density function f(x)
.
={
+x 2 ) 0
1.2(x
O<x < l otherwise
a. What is the probability that the concentration is greater than 0.5?
b. Find the mean concentration . c. Find the probabi lity that the concentration is within ±0. 1 of the mean. d. Find the standard deviation a of the concentrations. e. Find the probability that the concentration is withi n ±2a of the mean. f. Find the cumulative distribution functi on of the concentration. 12. The error in the length of a part (absolute value of the difference between the actual length and the target length), in mm , is a random variable with probability density function f(x)
= { I ~~:- 1
0<x<1
otherwise
a. What is the probability that the error is less than 0.2 mm? b. Find the mean error.
c. Find the cumulative distribution function of the lifetime.
c. Find the variance of the error.
d. Find the probability that the lifetime will be less than 12 months.
d. Find the cumulative distribution function of the error.
104
CHAPTER
3
Probability
e. The specification for the enor is 0 to 0.3 1run. What is the probability that the specification is met?
13. The thickness of a washer (i n 1mn) is a random variable with probability density function
f(x)
={
(3/52)x(6- x)
2 < x <4
0
otherwise
a . What is the probability that the thickness is less than 2.5 m? b. What is the probability that the thickness is between 2.5 and 3.5 m ?
d. The term PM 10 refers to particles 10 ~m or less in diameter. What proportion of the contaminating particles are PM 10 ? c. The ter m PM2.5 refers to particles 2.5 ~m or less in diameter. What proportion of the contaminating particles are PM2.s? f. What proportion of the PM 10 particles are PM2 .5 ?
15. The level of impurity (in %) in the product of a certain chemical process is a random variable with probability density function { (3/64)x;(4- x)
0 <x <4
otherwise
c. Find the mean thickness. d. Find the standard deviation o- of t11e thicknesses. e. Find the probabi lity that the thickness is within ±oofthe mean. f. Find the cumulative distribution function of the thickness.
a. What is the probability that the impurity level is greater tl1an 3%? b. What is the probability that ilie impurity level is between 2% and 3%? c. Find the mean impurity level. d. Find the variance of the impurity levels.
14. Particles are a major component of air pollution in many areas. lt is of interest to study the sizes of contaminating particles. Let X represent the diameter, in micro meters, of a randomly chosen particle. Assume that in a certain area, tl1e probability density function of X is inversely proportional to the volume of the particle; that is, assume that
c. Find the cumulative distribution functi on of ilie impurity level.
16. Tbe reading given by a thermometer calibrated in ice water (actual temperature Q•C) is a random variable with probability density function k( l - x 2)
f(x) = x ;:: l X< J
where c is a constant. a. Find the value of c so that j(x) is a probability density function. b. Find the mean particle diameter. c. Find the cumulative distribution function of the particle diameter.
3.4
{ 0
- 1< X < I
otherwise
where k is a constant. a. Find the value of k . b. What is the probability that the thermometer reads above o·c? c. What is the probability that the reading is within 0.2SOC of ilie actual temperature? d. What is the mean reading? e. What is the standard deviation of the read ings?
Functions of Random Variables In practice we often construct new random variables by performing ari thmetic operations on other random variables. For example, we might add a constant to a random variable, multiply a random variable by a constant, or add two or more random variables together. In this section, we describe how to compute means and variances of random variables constructed in these ways, and we present some practical examples.
3.4
Functions of Random Variab les
105
Adding a Constant When a constant is added to a random variable, the mean is increased by the value of the constant, but the variance and standard deviati on are unchanged. For example, assume that steel rods produced by a certain machine have a mean length of 5.0 in. and a variance of a 2 = 0.003 in2 . Each rod is attached to a base that is exactly l.Oin.long. The mean length of the assembl y will be 5.0 + 1.0 = 6.0 in. Since each length is increased by the same amount, the spread in the lengths docs not change, so the variance remains the same. To put this in statistical terms, let X be the length of a rando ml y chosen rod, and let Y = X+ 1 be the length of the assembly. Then JJ-r = J.I.X+l = JJ-x + 1, and a} = a1+1 =a;. In general, when a constant is added to a random variable, the mean is shifted by that constant, and the variance is unchanged.
If X is a random variable and b is a constant, then IJ-X+b = ttx
+b
(3.22) (3.23)
Multiplying by a Constant Often we need to multi ply a random variable by a constant. This might be done, for example, to convert to a more convenient set of units. We continue the example of steel rod production to show how multiplication by a constant affects the mean, variance, and standard deviation of a random variable. If we measure the lengths of the rods described earlier in centimeters rather than inches, the mean length will be (2.54 cm/in.)(5.0 in.) = 12.7 cm.ln statistical terms, let the random variable X be the length in inches of a randomly chosen rod, and let Y = 2.54X be the length in centimeters. Then JJ-r = 2.54ttx. In general, when a random variable is multipl ied by a constant, its mean is multiplied by the same constant. -
-
Summary
~
- --
-
-
•
-
-
-
--
-- -
-
- -
.
•. , -· • -
· . _
-··#''('!
_
_.r
· :
.~
.....::..:;__:_ ---\......&.... ~
If X is a random variable and a is a constant, then (3.24)
When the length X of a rod is measured in inches, the variance a} must have units of in2 . If Y = 2.54X is the length in centimeters, then must have units of cm2 . Therefore 2 we obtain by multiplying a1 by 2.54 , which is the conversion factor from in2 to cm2 . In general, when a random variable is multiplied by a constant, its variance is multiplied by the square of the constant.
ai
ai
106
CHAPTER 3
Probability
Summary If X is a random variable and a is a constant, then (3.25)
crax = lalcrx
(3.26)
If a random variable is multiplied by a constant and then added to another constant, the effect on the mean and variance can be determined by combining Equations (3 .22) and (3.24) and Equations (3.23) and (3.25). The results are presented in the following summary.
Summary _
_
If X is a random variable, and a and b are constants, then JlaX+b = aJlx 2
2
+b
2
craX+b = a crX
(3.27) (3.28) (3.29)
Note that Equations (3.27) through (3.29) are analogous to results for the sample mean and standard dev iation presented in Section 1.2.
Example The molarity of a solute in solution is defined to be the number of moles of solute per liter of solution (1 mole = 6.02 x 1023 molecules). If the molarity of a stock solution of concentrated sulfuric acid (H2 S04 ) is X, and if one part of the solution is mixed with N parts water, the molarity Y of the dilute solution is given by Y = X /(N + 1). Assume that the stock solution is manufactured by a process that produces a molarity with mean 18 and standard deviation 0. 1. If 100 mL of stock solution is added to 300 mL of water, find the mean and standard deviation of the molarity of the dilute solution. Solution
The molarity of the dilute solution is Y = 0.25X . The mean and standard deviation of X are Jlx = 18 and crx = 0. 1, respectively. Therefore J1 Y
=
J10.25X
= 0.25Jlx = 0.25(18.0)
= 4.5
(using Equation 3.24)
3.4
Functions of Random Variables
107
Also,
ay
= ao.zsx = 0.25ax
(using Equation 3.26)
= 0.25(0.1)
= 0.025 Means of linear Combinations of Random Variables Consider the case of adding two random variables. For example, assume that two machines fabricate a certain metal part. The mean daily production of machine A is 100 parts, and the mean daily production of machine B is 150 parts. Clearly the mean daily production from the two machines together is 250 parts. Putting this in mathematical notation, let X be the number of parts produced on a given day by machine A, and let Y be the number of parts produced on the same day by machine B. The total number of parts is X + Y , and we have that ILX+Y = J.Lx + J.Ly. This idea extends to any number of random variables. If X 1, X2 , ..• , X11 are random variables, then the mean of the sum X 1 + X 2 + · · · + X 11 is given by
(3.30)
The sum X1
+ X2 +
· ·· + XII is a special case of a linear combination:
If X 1 , •• • , Xn are random variables and c 1 , random variable
is called a linear combination of X 1 ,
••• ,
••• ,
c11 are constants, then the
X 11 •
To find the mean of a linear combination of random variables, we can combine Equations (3.24) and (3.30): If X and Y are random variables, and a and b are constants, then /.1-aX+bY = !-LaX+ J.i-bY =
OJ.Lx
+ bJ.Ly
(3.3 1)
More generally, if X 1, X2, ... , X 11 are random variables and c1, c2 , ... , c11 are constants, then the mean of the linear combination c 1X 1 + c2 X 2 + · · · + c11 X 11 is given by (3.32)
108
CHAPTER 3
Probability
Independent Random Variables T he notion of independence for random variables is very much li ke the notion of independence for events. Two random variables are independent if knowledge concerning one of them does not affect the probabilities of the other. When two events are independent, the probability that both occur is found by multiplying the probabil ities for each event (see Equations 3.10 and 3.11 in Section 3.2). There are analogous formulas for independent random variables. The notation for these formulas is as follows. Let X be a random variable, and letS be a set of numbers. The notation "X E S" means that the value of the random variable X is in the set S. 1
Definition
.
.
If X and Y are independent random variables, and S and T are sets of numbers, then P(X E Sand Y E T) = P(X E S)P(Y E T )
More generally, if X 1 , S11 are sets, then
•.. ,
(3 .33)
Xn are independent random variables, and S1 ,
•. . ,
P (Xl E sl and Xz E s2 and .. . and XII E Sn) = P(X1 E S1)P(X2 E S2) · · · P(X11 E S11 )
(3.34)
Example
~
I
Cylindrical cans have specifications regarding their height and radius. Let H be the length and R be the radius, in m illimeters, of a randomly sampled can. The probability mass functi on of H is given by P(H = I 19) = 0.2, P(H = 120) = 0.7, and P (H = 12 1) = 0.1. The probability mass functio n of R is given by P(R = 30) = 0.6 and P(R = 31) = 0.4. The volume of a can is given by V = TC R2 H. Assume Rand H are independent. Find the probability that the area is I 08,000 mm3 . Solution
The volume will be equal to 108,000 if H = 120 and R = 30. Therefore P(V = 108,000)
= P(H = 120 and R = 30) = P( H = 120)P(R = 30)
since H and R are independent
= (0.7)(0.6) = 0.42
Variances of Linear Combina t ions of Independent Random Variables We have seen that the mean of a sum of random variables is always equal to the sum of the means (Equation 3.30). In general, the formula for the variance of a sum of random variables is a little more complicated than this. But when random variables are independent, tl1e result is simple: the variance of the sum is tbe sum of the variances.
3.4
Functions of Random Variables
109
If X 1, X2 • ... , Xn are independent random variables, then the variance of the sum X 1 + X2 +···+X, is given by (3 .35) To find the variance of a li near combination of random vmiables, we can combine Equations (3.35) and (3.25): If X 1 , X2, ... , X, are independent random variables and c 1, c2, ... , Cn are constants, then the variance of the li near combination c 1 X 1 + c2X2 + · · · + c, Xn is given by
(3.36) Two frequently encountered linear combinations arc the sum and the difference of two random variables. Interestingly enough, when the random variables arc independent, the variance of the sum is the same as the variance of the difference. If X and Y are independent random variables with variances a; and a~. then the variance of the sum X + Y is 2
2
2
(3.37)
2
2
(3.38)
ax+Y =ax+ O'y The variance of the difference X - Y is 2
ax-Y =ax +ay
The fact that the variance of the difference is the sum of the variances may seem counterintuitive. However, it follows from Equation (3.36) by setting c 1 = 1 and c2 =- 1.
Example
~
An object with initial temperature To is placed in an environment with ambient temperature Ta . According to Newton's law of cooling, the temperature T of the object is given by T = cT0 + (I - c)Ta. where cis a constant that depends on the physical properties of the object and on the elapsed time. Assume that To has mean 25°C and standard deviation 2°C, and Ta has mean soc and standard dev iation I a c. Find the mean ofT at the li me when c = 0.25. Assuming To and Ta to be independent, fi nd the standard deviation ofT at that time.
Solution Using Equation (3.32), we fi nd that the temperatu re T has mean f.J.T
= /J·0.25T0 +0 .757~ = 0.25tLr0 = 6.25 = 10
+ 0.75wr.,
+ 3.75
110
CHAPTER 3
Probability
Since X 1 and X 2 are independent, we can use Equation (3.36) to find the standard deviation ac< 2 a 0.25To+0.75Ta
ac =
+ (0.75) 2 a{" )0.0625(2) 2 + 0.5625(1)2
= Jco.25) 2 a'A =
= 0.90 14
Independence and Simple Random Samples When a simple random sample of numerical values is drawn from a population, each item in the sample can be thought of as a random variable. The items in a simple random sample may be treated as independent, except when the sample is a large proportion (more than 5%) of a finite population (see the discussion of independence in Section 1. 1). From here on, unless explicitly stated to the contrary, we will assume this exception has not occurred, so that the values in a simple random sample may be treated as independent random variables.
Summary If X 1, X2, ... , Xn is a simple random sample, then Xt , X2, .. . , Xn may be treated as independent random variables, all with the same distribution. When X 1 , ••. , X, are independent random variables, all with the same distribution, it is sometimes said that X 1, ... , Xn are independent and identically distributed (i.i.d.).
The Mean and Variance of a Sample Mean The most frequently encountered linear combination is the sample mean. Specifically, if X 1, .•• , Xn is a sim ple random sample from a population with mean M and vari ance a 2 , then the sample mean X is the linear combination I 1 X = -XI+ ... + -XII
n
n
From this fact we can compute the mean and variance of X.
Wx =
M~x, + .. ·+*X"
1 1 = -Mx, + · · · + -J..tx.,
n
n
1
1
= - J..t + .. · +-M n n
=
(n)
=j..t
(~) M
(using Equation 3.32)
3.4
Functions of Random Variables
111
As discussed previously, the items in a simple random sample may be treated as independent random variables. Therefore al_ = afiiXI+ ..· + ~X/1 X
1
2
= - ax n2
I
'
1 2 + ... + -ax n2 "
2
1
=-a +···+-a n2 n2
(using Equation 3.36)
2
n
Summary
·
.:
If X 1, ... , Xn is a simple random sample from a population with mean f.L and variance a 2 , then the sample mean X is a random variable with
(3.39) (3.40) The standard deviation of X is a-- X-
a
(3.41)
.Jri
E xample The lifetime of a light bulb in a certain application has mean 700 hours and standard deviation 20 hours. The light bulbs are packaged 12 to a box. Assuming that the light bulbs in a box are a simple random sample of light bulbs, find the mean and standard deviation of the average lifetime of the light bulbs in a box. Solution
Let T1 , ... , T 12 represent the lifetimes of the 12 light bulbs in a box. This is a simple random sample from a population with mean f.L = 700 and standard deviation a = 20. The average lifetime is T = (T1 + · · · + T12 )/12. Using Equation (3.39), f.Ly
= f.L = 700
Using Equation (3.41),
a
a-= -= T .JT2
5.77
Standard Deviations of Nonlinear Functions of Random Variables The examples we have seen so far involve estimating standard deviations of linear functions of random variables. In many cases we wish to estimate the standard
112
CHAPTER 3
Prob ability
deviation of a nonlinear function of a random variable. For example, suppose the radius R of a circle is measured to be 5.43 em, and the area is therefo re calculated to be A = rr 5.432 = 92.6 cm2 . Furthermore, suppose that due to measurement enor, it is appropriate to model the measured value as a random variable with standard deviation 0.01 em. What is the standard deviation of the calculated area A ? In statistical terms, we know that the standard deviation aR is 0.01 em, and we must calculate the standard deviation of A , where A is the function of R given by A = rr R 2 . ln general, the type of problem we wish to solve is this: Given a random variable X , with know n standard deviation ax, and given a function U = U (X), how do we compute the standard deviation au? If U is a linear function, we can use Equation (3.29) . If U is not linear, we can still approximate au, by multiplying ax by the absolute val ue of the derivative d U jdX . The approximation will be good so long as ax is small . If X is a random variable whose standard deviation ax is small, and if U is a fu nction of X , then (3.42) In practice, we evaluate the derivative dU j d X at the observed value of X. Equati on (3.42) is known as the propagation of error formula.
Propagati on of Erro r Uncerta inti e s Are O nly Ap proxima t e Standard deviations computed by using Equation (3.42) are often o nly rough approximations. For this reason, these standard deviations should be expressed with no more than two significant digits. Indeed, some authors suggest using only one significant digit.
E xample
~
I
The radius R of a circle is measured to be 5.43 em, with a standard deviation of 0.01 em. Estimate the area of the circle, and find the standard deviation of this estimate. Solution The area A is given by A = rr R2 . The estimate of A is rr(5.43 cm) 2 = 92.6 cm2 . Now aR = 0.01 em, and dA /d R = 2rr R = 10.86rr em. We can now fi nd the standard
deviation of A :
aA=~~~ ~aR =
( I 0.86rr cm)(O.Ol em)
= 0.34 cm 2
We estimate the area of the circle to be 92.6 cm2 , with a standard deviation of 0.3 cm2 .
3.4
Fu nctions of Random Variables
11 3
Often we need to estimate a qu antity as a ftmction of several random variabl es. For example, we might measure the mass m and volume V of a rock and compute the density as D = m I V. In practice, we might need to estimate the standard deviation a 0 in terms of a111 and a v. The general problem is to estimate the standard deviation of a quantity that is a function of several independent random variables. The basic fo rmula is given here. If X 1, Xz, .. . , Xn are independen t random variables whose standard deviations ax 1 , ax 2 , • •• , ax., are small, and if U = U (X 1, X2, . .. , X11 ) is a function of X1, X2, ... , Xn, then
(3.43) In practice, we evaluate the partial derivatives at the point (X 1, X 2 ,
. .• ,
X,.).
Equation (3.43) is the multivariate propagation of error formula. It is important to note that it is valid only when the random variables X 1, X 2 , • •. , Xn are independent. As in the case of one random variable, the standard deviations computed by the propagation of error formula arc often only rough approximations.
Example
Assume the mass of a rock is measured to be m = 674.0 ± 1.0 g, and the vol ume of the rock is measured to be V = 261.0 ± 0.1 mL. The density D of the rock is given by D = m./ V. Estimate the density and find the standard deviation of the estimate.
Solution Substituting m = 674.0 g and V = 261.0 mL, the estimate of the density D is 674.0/26 1.0 = 2.582 g/mL. Since D = m/ V , the prutial derivatives of D are
aD = ~ = 0 .00383 1 mL- 1 am v aD -m 2 av = vz = -o.oo9894g/ mL The standard deviation of D is therefore
an=
(aamo)
2
a,~+ (a avo) a~ 2
= Jco .oo383 t )2(J.0) 2 + c-o.oo9894) 2 CO. J)2 = 0.0040 g/mL
We estimate the density of the rock to be 2.582 g/mL, with a standard deviation of 0.004g/mL.
114
CHAPTER
3
Probability
One of the great benefits of the multivariate propagation of error formula is that it enables one to determine which meas urement errors are most responsible for the random variation in the final result. Example 3.31 illustrates this.
E xample
.,
The density of the rock in Example 3.30 is to be estimated again with different equipment, in order to improve the precision. Which would improve the precision of the density estimate more: decreasing the standard deviation of the mass estimate to 0.5 g, or decreasing the standard deviation of the volume estimate to 0.05 mL? Solution
J
From Example 3.30, a 0 = (0.003831) 2 a,~ + (-0.009894) 2ao . We have a choice between having am = 0.5 and av = 0.1 , or having a, = 1.0 and av = 0.05. The first choice results in a 0 = 0.002 g/mL, while the second c hoice results in a 0 = 0.004 g/mL. It is better to reduce am to 0.5 g.
Exercises for Section 3.4 1. If X and Y are independent random variables with means 1-Lx = 9.5 and 1-Lr = 6.8, and standard deviations ax = 0.4 and ar = 0.1, find the means and standard deviations of the following:
a. 3X b. Y- X c. X +4Y
2. The bottom of a cylindrical container has an area of 10 cm2 • The container is filled to a height whose mean is 5 em and whose standard deviation is 0.1 em. Let V denote the volume of fluid in the container. a. Find f.Lv. b. Find av. 3. A process that fills plastic bottles with a beverage has a mean fill volume of 2.013 Land a standard deviation of 0.005 L. A case contai ns 24 bottles. Assuming that the bottles in a case are a simple random sample of bottles filled by this method, find the mean and standard deviation of the average volume per bottle in a case. 4. The force, in N, exerted by gravity on a mass of m kg is given by F = 9.8m. Objects of a certain type have mass whose mean is 2.3 kg with a standard deviation of 0.2 kg. F ind the mean and standard deviation ofF .
5. A piece of plywood is composed of five layers. The layers are a simple random sample from a popula-
tion whose thickness has mean 3.50 mm and standard deviation 0.10 mm. a. Find the mean thickness of a piece of plywood. b. Find the standard dev iation of the thickness of a piece of plywood.
6. The period of a pendulum is esti mated by measuring the starting and stopping times and taking their differe nce. If the starting and stopping times are measured independently, each with standard deviation 0.2 s, what is the standard deviation of the estimated period? 7. The molarity of a solute in solution is defin ed to be the number of moles of solute per liter of solution (I mole = 6.02 x 1023 molecules). If X is the molarity of a solution of magnesium chloride (MgC12 ), and Y is the molarity of a solution of ferric chloride (FeCh), the molarity of chloride ion (Cl-) in a solution made of equal parts of the solutions of MgCh and FeC13 is given by M =X+ 1.5Y. Assume that X has mean 0.125 and standard deviation 0.05, and that Y has mean 0.350 and standard deviation 0. I 0. a. Find iJ-M· b. Assuming X andY to be independent, find aM.
8. Two independent measurements are made of the lifetime of a charmed strange meson. Each measurement has a standard deviation of 7 x I0- 1s seconds. The
Supplementary Exercises for Chapter 3
115
lifetime of the meson is estimated by averaging the two measurements. What is the standard deviation of this estimate?
d. Assuming the distances traveled are independent for each gallon of gas, find the standard deviation of the estimated gas mileage.
9. The four sides of a picture frame consist of two pieces selected from a population whose mean length is 30 em with standard deviation 0.1 em, and two pieces selected from a population whose mean length is 45 em with standard deviation 0.3 em.
12. The Needleman-Wunsch method for aligning DNA sequences assigns 1 point whenever a mismatch occurs, and 3 points whenever a gap (insertion or deletion) appears in a seque nce. Assume that under certain conditions, the number of mismatches has mean 5 and standard deviation 2, and the number of gaps has mean 2 and standard deviation 1.
a. Find the mean perimeter. b. Assuming the four pieces are chosen independently, find the standard deviation of the perimeter.
10. A gas station earns $2.60 in revenue for each gall on of regular gas it sells, $2.75 for each gallon of midgrade gas, and $2.90 for each gallon of premium gas. Let X 1 , X2 , and X 3 denote the numbers of gallons of regular, midgrade, and premium gasoline sold in a day. Assume that XL, x2. and x3have means Jl- 1 = 1500, JJ-2 = 500, and JJ., 3 = 300, and standard deviations a-1 = 180, a-2 = 90, and u 3 = 40, respectively. a. Find the mean daily revenue. b. Assuming X,, X2 , and X3 to be independent, find the standard deviation of the daily revenue. 11. The number of miles traveled per gallon of gasoline for a certain car has a mean of 25 and a standard deviation of 2. The tank holds 20 gallons. a. Find the mean number of miles traveled per tanl<. b. Assume the di stances traveled are independent for each gallon of gas. Find the standard deviation of the number of miles traveled per tank. c. The car owner travels X miles on 20 gallons of gas and estimates her gas mileage as X /20. Find the mean of the estimated gas mileage.
a. Fi nd the mean of the Needleman-Wunsch score. b. Assume the number of gaps is independent of the number of mismatches. Find the variance of the Needleman-Wunsch score. 13. The acceleration g due to gravity is estimated by dropping an object and measuring the time it takes to travel a certain distance. Assume the distance s is known to be exactly 5 m, and the time is measured to be t = 1.0 1 ± 0.02s. Estimate g, and find the standard deviation of the estimate. (Note that g = 2s I t 2 .)
14. One way to measure the water content of a soil is to weigh the soil both before and after drying it in an oven. The water content is W = (M 1 - M2 )/ M 1, where M 1 is the mass before drying and M2 is the mass after drying. Assume that M 1 = 1.32 ± 0.01 kg and M 2 = 1.04 ± 0.01 kg. a. Estimate W, and find the standard deviation of the estimate. b. Which would provide a greater reduction in the standard deviation of W: reducing the standard deviation of M 1 to 0.005 kg or reducing the standard deviation of M2 to 0.005 kg?
Supplementary Exercises for Chapter 3 1. Among the cast aluminum parts manufactured on a certain day, 80% were flawless, 15% had only minor flaws, and 5% had maj or flaws. Find the probability that a randomly chosen part a. has a flaw (major or minor). b. has no major flaw. 2. In a certain type of automobile engine, the cylinder head is fastened to the block by 10 bolts, each of which
should be torqued to 60 N-m. Assume that the torques of the bolts are independent. If each bolt is torq ued correctly with probability 0.99, what is the probability that all the bolts on a cylinder head are torqued correctly? 3. Nuclear power plants have redundant components in important systems to reduce the chance of catastrophic failu re. Assume that a plant has two gauges to measure
116
CHAPTER
3
Probability
the level of coolant in the reactor core and that each gauge has probability 0.0 I of failing. Assume that one potential cause of gauge failure is that the electric cables leading from the core to the control room where the gauges are located may burn up in a fire. Someone wishes to estimate the probability that both gauges fail and makes the follow ing calculation:
= P (first gauge fails)P(second gauge fails) = (0.01)(0.01) = 0.0001 a. What assumption is being made in this calculation? b. Explain why this assumption is probably not justified in the present case. c. Is the probability ofO.OOOl likely to be too high or too low? Explain.
4. The lifetime, in years, of a certain type of fuel cell is a random variable with probability density function 81
=
and variances of the following quantities.
a. 3X b. X+Y c. X- Y d. 2X + 6Y
P(both gauges fail)
f(x)
7. Let X and Y be independent random variables with J.l.x = 2, O'x = 1, J.l.y = 2, and O'y = 3. Find the means
(x: 3) {
4
x >O x:::;O
a. What is the probability that a fuel cell lasts more than 3 years? b. What is the probability that a fuel cell lasts between 1 and 3 years? c. Find the mean lifetime. d. Find the variance of the lifetimes. e . Find the cumulative distribution function of the lifetime. 5. A system consists of four components, connected as shown in the diagram. Suppose that the components func tion independently, and that the probabilities of failure are 0.05 for A, 0.03 forB, 0.07 for C, and 0.14 for D. Find the probability that the system functions .
6. Let A and B be events with P(A) = 0.4 and P(A n B ) = 0.2. For what value of P(B) will A and B be independent'l
8. The article "Traps in Mineral Valuations-Proceed With Care" (W. Lonegan, Journal ofthe Australasian institute ofMining and Metallurgy, 200 1: 18-22) models the value (in millions of dollars) of a m ineral deposit yet to be mined as a random variable X with probability mass function p(x) given by p(lO) = 0.40, p(60) = 0.50, p(80) = 0.10, and p(x) = 0 for values of x other than lO, 60, or 80. a. Is this article treating the value of a mineral deposit as a discrete or a continuous random variable? b. Compute f.l.x · c. Compute 0'x. d. The project will be profitable if the value is more t11an $50 million. What is the probabi lity that the project is profitable? 9. The period T of a simple pendulum is given by T = 2n ...(Lfg, where L is the length of the pendulum and g is the acceleration due to gravity. Assume g = 9.80 m/s2 exactly, and L is measured to be 0.742 m with a standard deviation of 0.005 m. Estimate T , and fi nd the standard deviation of the estimate.
J0. The pressure P, temperature T, and volume V of o ne mole of an ideal gas are related by the equation T = 0. 1203? V, when Pis measured io kilopascals, T is measured in kelvins, and V is measured in liters. a. Assume that P is measured to be 242.52 kPa with a standard deviation of0.03 kPaand Vis measured to be I 0.103 L with a standard deviation of0.002 L. Estimate T , and find the standard deviation of the estimate. b. Which would provide a greater reduction in the standard deviation ofT: reducing the standard deviatio n of P to 0.01 kPa or reducing the standard deviation of V to 0.00 I L?
Supplementary Exercises for Chapter 3
u.
The repair time (in hours) for a <:enain machine is a random variable with probability density function
f(x)
={
2 8 1 ,
defin ed
x>O
a. Find the mean volume absorbed in I min.
0
x::=:O
b. (Hard ) Find the stand ard deviation of the volu me absorbed in 1 min .
b. W hat is the probability that the repair time is between 1.5 and 3 hours? c. Find the mean repair time. d . Find the <:umulative distribution fun ction of the repair times. 12. A process that manufactures piston rings produces rings whose diameters (in centimeters) vary accord ing to the prob ability densi ty fun<:tion 3[1 - l6 (x-
={0
(x -!0)
xe-x
a. What is the probability that the repair time is Jess than 2 hours?
f(x)
by the function f(x) = (2-J 27r)- 1e for -oo < x < oo.
117
lWl
15. In the article "An Investigati on of the Ca-C03-CaF 2 K2Si03-S i02-Fe Flux System Using the Submerged Arc Welding Process o n HSLA- 100 and AIS I- 10 18 Steels" (G. Fredrickson, M.S. thesis, Colorado School of Mines, 1992), the carbon equivalent P of a weld metal is defined to be a linear combination of the weight percentages of carbon (C), manganese (Mn), copper (Cu), chromium (Cr), si licon (Si), nickel (Ni), molybdenum (Mo), vanadium (V), and boron (B). The carbon equivalent is given by
9.75 <X< 10.25 otherwise
a. Find the mean d iameter of rings manufactured by th is prrn;ess. b. Find-Ahe standard deviation of the d iameters of rin~{ manu factured by this process . (Hint: Equation 3.20 may be easier to use than Eq uation 3.21.)
Means and standard d eviations of the weight percents of these chemicals were estimated from measurements on 4 5 weld metals produced on HSLA-100 steel base metal. Assume the means and standard deviations (SD) are as g iven in the following table.
I
c. Firlfl ~c cumulative distribution funct ion of piston nn~wmeters.
d . W hat proportion of pi ston rings h ave d iameters less than 9.75 em? e. What proportion of piston rings have diameters between 9.75 and I0 .25 em? 13. Refer to Exercise 12. A competing process produces rings whose diameters (in centimeters) vary a<:cording to the probability density function
c Mn Cu Cr Si Ni Mo
v B
f(x)
={
15[ 1 - 25(x- IO.OWJ/4
9.85 < x < 10 .25
0
otherwise
Specifications call for the d iameter to be 10.0 ± 0.1 em. Which process is better, this one or the one in Exercise 12? Explain. 14. An environmental scientist is concerned with the rate at which a certain toxic solution is absorbed into the skin. Let X be the volume in microliters of solution absorbed by 1 in2 of skin in 1 min. Assume that the probability density function of X is well approximated
Mean
SD
0.0695 1.0477 0.8649 0 .7356 0.217 1 2.8 146 0.59 13 0.0079 0.0006
0.0018 0.0269 0.0225 0 .0 113 0.0 185 0.0284 0.0031 0.0006 0.0002
a. Find the mean carbon equivalent of weld metals produced from HSLA-1 000 steel base metal. b. Assuming the weight percents to be independent, find the standard deviation of the carbon equ ivalent of weld metals produced from HSLA-1000 steel base metal.
16. The oxygen equivalen<:e num ber of a weld is a number that can be used to predict properties such as hardness, strength, and ductility. The article "Ad vances in
118
CHAPTER
3 Probability
Oxygen Equivalence Equations for Predicting the Properties of Titanium Welds" (D. Harwig, W. Ittiwattana, and H. Castner, The Welding Journal, 2001: 126s-136s) presents several equations fo r computi ng the oxygen equivalence number of a weld. One equation, design