Table Of ContentProbability and Statistics for
Engineering and the Sciences
with Modeling using R
Probability and statistics courses are more popular than ever. Regardless of your major or
your profession, you will most likely use concepts from probability and statistics often in your
career.
The primary goal behind this book is offering the fexibility for instructors to build most
undergraduate courses upon it. This book is designed for a one-semester course in introductory
probability and statistics (not calculus based) or a one-semester course in a calculus-based
probability and statistics course.
The book focuses on engineering examples and applications, while also including social
sciences and more examples. Depending on the chapter fows, a course can be tailored for
students at all levels and from all backgrounds.
Over many years of teaching this course, the authors created problems based on real data,
student projects, and labs. Students have suggested these enhance their experience and
learning. The authors hope to share projects and labs with other instructors and students to
make the course more interesting for both.
R is an excellent platform to use. This book uses R with real data sets. The labs can be used
for group work, in class, or for self-directed study. These project labs have been class-tested for
many years with good results and encourage students to apply the key concepts and the use of
technology to analyze and present results.
Dr. William P. Fox is a visiting professor of Computational Operations Research in the
Mathematics Department at the College of William and Mary. He is an emeritus professor
in the Department of Defense Analysis at the Naval Postgraduate School. He earned his BS
degree from the United States Military Academy, MS in operations research from the Naval
Postgraduate School, and his PhD in Industrial Engineering from Clemson University. He
has taught at the United States Military Academy and at Francis Marion University. He has
many publications and scholarly activities including 16 books, 21 book chapters and technical
reports, 150 journal articles, and more than 150 conference presentations and mathematical
modeling workshops.
Rodney X. Sturdivant, PhD, is director of the Statistical Consulting Center and an associate
professor in the Department of Statistical Science at Baylor University. He has been senior
research biostatistician with the Henry M. Jackson Foundation for the Advancement of Military
Medicine supporting the Uniformed Services University of Health Science. Previously, he
was professor of Applied Statistics at Azusa Pacifc University. He was associate professor of
Clinical Public Health in the Biostatistics Division of the College of Public Health at The Ohio
State University. He retired as a Colonel after 27-year career in the U.S. Army. He completed his
military service as an Academy Professor and Professor of Applied Statistics in the Department
of Mathematical Sciences at the United States Military Academy, West Point. He earned a B.S.
from West Point, an M.S. in statistics and an M.S. in operations research from Stanford, and a
PhD in biostatistics from the University of Massachusetts - Amherst.
Textbooks in Mathematics
Series editors:
Al Boggess, Kenneth H. Rosen
Geometry and Its Applications, Third Edition
Walter J. Meyer
Transition to Advanced Mathematics
Danilo R. Diedrichs and Stephen Lovett
Modeling Change and Uncertainty
Machine Learning and Other Techniques
William P. Fox and Robert E. Burks
Abstract Algebra
A First Course, Second Edition
Stephen Lovett
Multiplicative Differential Calculus
Svetlin Georgiev, Khaled Zennir
Applied Differential Equations
The Primary Course
Vladimir A. Dobrushkin
Introduction to Computational Mathematics: An Outline
William C. Bauldry
Mathematical Modeling the Life Sciences
Numerical Recipes in Python and MATLABTM
N.G. Cogan
Classical Analysis
An Approach through Problems
Hongwei Chen
Classical Vector Algebra
Vladimir Lepetic
Introduction to Number Theory
Mark Hunacek
Probability and Statistics for Engineering and the Sciences with Modeling using R
William P. Fox and Rodney X. Sturdivant
For more information on this series, please visit www.routledge.com/Textbooks-in-Mathematics/
book-series/CANDHTEXBOOMTH
Probability and Statistics for
Engineering and the Sciences
with Modeling using R
William P. Fox and Rodney X. Sturdivant
First edition published 2023
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487–2742
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
© 2023 William P. Fox and Rodney X. Sturdivant
Reasonable efforts have been made to publish reliable data and information, but the author and
publisher cannot assume responsibility for the validity of all materials or the consequences of their use.
The authors and publishers have attempted to trace the copyright holders of all material reproduced in
this publication and apologize to copyright holders if permission to publish in this form has not been
obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or
hereafter invented, including photocopying, microfilming, and recording, or in any information storage
or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com
or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978–
750–8400. For works that are not available on CCC please contact mpkbookspermissions@tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used
only for identification and explanation without intent to infringe.
ISBN: 9781032330471 (hbk)
ISBN: 9781032330501 (pbk)
ISBN: 9781003317906 (ebk)
DOI: 10.1201/9781003317906
Typeset in Palatino
by Apex CoVantage, LLC
To our wives, Hamilton and Mandy. To Frank R. Giordano, 1942–2022, our
mentor and friend, who helped us in many ways along our careers.
Contents
Preface.............................................................................................................................................xv
Acknowledgments ..................................................................................................................... xvii
1 Introduction to Statistical Modeling and Models and R ...............................................1
1.1 What Is Modeling?........................................................................................................1
1.2 Overview and the Modeling Process.........................................................................2
1.3 The Modeling Process..................................................................................................3
1.3.1 Mathematical Modeling..................................................................................4
1.3.2 Models and Real-World Systems...................................................................4
1.3.3 Model Construction.........................................................................................5
1.4 Making Assumptions ...................................................................................................7
1.5 Illustrative Modeling Examples..................................................................................8
1.6 Technology...................................................................................................................10
1.6.1 What Is R? ....................................................................................................... 10
1.6.1.1 Introduction to R ............................................................................ 10
1.6.2 The R Environment ....................................................................................... 11
1.6.3 R, Data, and Manipulating Data..................................................................12
1.6.3.1 Importing Data from EXCEL (as a csv fle) to RStudio.............12
1.7 Chapter 1 Exercises.....................................................................................................15
1.8 Chapter 1 Projects ....................................................................................................... 16
1.9 References and Additional Readings.......................................................................17
2 Introduction to Data............................................................................................................. 19
2.1 Finding Basic Statistics...............................................................................................19
2.2 Chapter 2 Exercises.....................................................................................................21
2.3 Displaying the Data....................................................................................................22
2.3.1 Data Ambiguity .............................................................................................22
2.3.2 Data Distortion...............................................................................................22
2.3.3 Data Distraction .............................................................................................23
2.3.4 Two Chart Types That Should Always Be Avoided..................................25
2.3.5 Good Graphical Displays..............................................................................25
2.4 Chapter 2 Exercises.....................................................................................................26
2.5 References and Suggested Readings........................................................................26
2.6 Good Displays of Categorical Data ..........................................................................27
2.6.1 Bar Charts .......................................................................................................30
2.7 Chapter 2 Exercises.....................................................................................................31
2.8 Displaying Quantitative Data ................................................................................... 32
2.8.1 Symmetry........................................................................................................ 32
2.8.2 Stem and Leaf Plots .......................................................................................33
2.9 Chapter 2 Exercises.....................................................................................................35
2.9.1 Displaying Quantitative Data with Histograms.......................................35
2.10 Chapter 2 Exercises.....................................................................................................39
vii
viii Contents
2.11 Displaying Quantitative Data Using Boxplots and for Comparisons.................40
2.11.1 Unequal Lengths............................................................................................43
2.11.2 Comparisons...................................................................................................46
2.11.3 R (Retrieving Data) for Obtaining Displays ..............................................46
2.12 Chapter 2 Exercises.....................................................................................................50
2.13 Summary: Displays of Data.......................................................................................50
2.13.1 Categorical Data Displays.............................................................................50
2.13.2 Quantitative Displays.................................................................................... 51
2.14 Chapter 2 Exercises.....................................................................................................51
3 Statistical Measures .............................................................................................................55
3.1 Measures of Central Tendency or Location.............................................................55
3.1.1 Describing the Data.......................................................................................55
3.1.2 The Mean.........................................................................................................55
3.1.3 The Median.....................................................................................................56
3.1.4 The Trimmed Mean.......................................................................................57
3.1.5 The Mode ........................................................................................................ 57
3.2 Measures of Dispersion..............................................................................................58
3.2.1 The Variance and Standard Deviation........................................................58
3.2.2 The Range and Interquartile Range (IQR) .................................................60
3.3 Measures of Symmetry and Skewness .................................................................... 61
3.4 Summary with Descriptive Statistics Using R........................................................ 62
3.4.1 Measures of Location .................................................................................... 62
3.4.2 Measures of Spread .......................................................................................64
3.4.3 Measures of Symmetry and Skewness .......................................................65
3.5 Summary of Measures ...............................................................................................66
3.5.1 Defnition of “Skewness” ..............................................................................66
3.5.2 Defnition of “Mean” .....................................................................................67
3.5.3 Statistics and Measures Summary .............................................................. 67
3.5.4 R (Retrieved Data and Descriptive Statistics) ............................................67
3.6 Chapter 3 Exercises .....................................................................................................69
4 Classical Probability ............................................................................................................75
4.1 Introduction to Classical Probability .......................................................................75
4.1.1 The Law of Large Numbers.......................................................................... 76
4.2 Counting .......................................................................................................................79
4.2.1 The Multiplication Rule ................................................................................80
4.2.2 Permutations and Combinations .................................................................81
4.2.3 Combinations .................................................................................................82
4.2.4 Computing Permutations and Combinations in R ...................................83
4.3 Chapter 4 Exercises .....................................................................................................87
4.4 Probability from Data .................................................................................................92
4.4.1 Intersections and Unions ..............................................................................92
4.4.2 The Addition Rule..........................................................................................94
4.4.3 Rule for Mutually Exclusive Sets .................................................................95
4.4.4 Addition Rule for Mutually Exclusive Events ...........................................95
4.4.5 Complement Rule ..........................................................................................95
4.4.6 Conditional Probability............................................................................... 100
Contents ix
4.4.7 Independence ............................................................................................... 102
4.4.8 Defnition of Independent Events.............................................................. 103
4.4.9 Mutually Exclusive and Independence .................................................... 104
4.4.10 Review/Summary ........................................................................................ 105
4.4.11 Sampling and Experiments ........................................................................106
4.4.12 Tree Diagrams .............................................................................................. 106
4.4.13 Review of Probability Laws ........................................................................ 107
4.5 Chapter 4 Exercises ...................................................................................................108
4.6 Bayes’ Theorem ......................................................................................................... 110
4.6.1 Bayes’ Theorem ............................................................................................ 113
4.7 Chapter 4 Exercises ...................................................................................................120
5 Discrete Distributions .......................................................................................................125
5.1 Introduction to Discrete Random Variables and Distributions .........................125
5.2 Bernoulli Distribution ..............................................................................................128
5.3 Binomial Distribution ............................................................................................... 131
5.4 Poisson Distribution ................................................................................................. 137
5.5 Chapter 5 Exercises ...................................................................................................139
5.6 Other Discrete Distributions: Hypergeometric, Geometric,
Negative Binomial .................................................................................................... 142
5.6.1 Hypergeometric Distribution .................................................................... 142
5.6.2 Geometric Distribution ............................................................................... 145
5.6.3 Negative Binomial Distribution ................................................................. 147
5.7 Discrete Distribution Summary of Known Distributions .................................. 149
5.7.1 Binomial Distribution ................................................................................. 149
5.7.2 Poisson Distribution .................................................................................... 149
5.7.3 Geometric Distribution ............................................................................... 149
5.7.4 Hypergeometric Distribution .................................................................... 150
5.7.5 Negative Binomial Distribution ................................................................. 150
5.8 Chapter 5 Exercises ...................................................................................................150
5.9 Chebyshev’s Inequality ............................................................................................ 151
5.10 Chapter 5 Exercises ...................................................................................................153
6 Continuous Probability Models ......................................................................................155
6.1 Introduction ............................................................................................................... 155
6.2 Uniform Distribution ............................................................................................... 156
6.3 Exponential Distribution ......................................................................................... 162
6.3.1 Reliability ......................................................................................................163
6.4 The Normal Distribution ......................................................................................... 170
6.5 Checking Normality .................................................................................................172
6.5.1 Inverse of Normal Distribution ................................................................. 175
6.6 Chapter 6 Exercises ................................................................................................... 176
7 Other Continuous Distribution (Some Calculus Required): Triangular,
Unnamed, Beta, Gamma ...................................................................................................181
7.1 Right Triangular Distribution ................................................................................. 181
7.2 General Triangular Distributions ...........................................................................183
7.3 General Continuous Distributions ......................................................................... 186