• No results found

Class Notes in Operations Research, Statistics, and Probability, Volume 1

N/A
N/A
Protected

Academic year: 2021

Share "Class Notes in Operations Research, Statistics, and Probability, Volume 1"

Copied!
1012
0
0

Loading.... (view fulltext now)

Full text

(1)

Class Notes in Operations Research, Statistics

and Probability (DRAFT: Third Edition, v4)

Edited by Roger L. Goodwin

Summit Point, WV 25446 Copyright 2005, USA

(2)

ii

Editor’s Note: In graduate school, it became too cumbersome for me to look-up equations, theorems, proofs, and problem solutions from previous courses. I had three boxes full of notes and was going on my fourth. Due to the need to reference my notes periodically, the notes became more unorganized over time. That’s when I decided to typeset them. I have been doing this for over a decade. Later in life, some colleagues asked if I could make these notes available to others (they were talking about themselves). I did. These notes can be downloaded forfreefrom the web site http://www.repec.org/ and can be found in the Library of Congress. Note that the beginning of each chapter lists the professor’s name and affiliation. Additionally, the course number, the date the course was taken, and the text book are given. The reader may also notice that I have made more use of the page space than in the previous editions of this manuscript. Hence, the book is shorter. If this causes the reader problems, then simply copy the proofs onto a blank sheet of paper — one line per algebraic manipulation. In this text, I put several algebraic manipulations on one line to save space. I thank Winston for helping typeset the notes.

(3)

1 Stochastic Models in Computer Science (Dr. Simha) 1

1.1 Stochastic vs Non-stochastic Approaches . . . 1

1.2 Review . . . 1

1.2.1 Review of Sets . . . 1

1.2.2 Review of Sequences . . . 2

1.2.3 Combinations of Sequences . . . 3

1.2.4 Limits and Functions . . . 3

1.2.5 Sequences of Functions . . . 3

1.2.6 Sums and Averages . . . 3

1.2.7 Other Forms of Limits . . . 4

1.3 Basic Probability . . . 5

1.3.1 Discrete and Continuous Sample Spaces . . . 5

1.3.2 Some Basic Properties . . . 6

1.3.3 Countable Additivity . . . 6

1.4 Homework and Answers . . . 7

1.5 Programming Assignment . . . 8

1.6 Card Experiments . . . 14

1.7 Conditional Probability . . . 15

1.8 Law of Total Probability . . . 15

1.9 General Form of Baye’s Formula . . . 16

1.10 Independence . . . 16

1.11 Homework . . . 16

1.12 More on Independence . . . 17

1.13 Random Variables . . . 18

1.14 Discrete Random Variables . . . 18

1.15 Bernoulli Random Variable . . . 18

1.16 Distributions . . . 19

1.16.1 Geometric Distribution . . . 19

1.16.2 Binomial Distribution . . . 19

1.16.3 Discrete Uniform Distribution . . . 19

1.16.4 Cumulative Distribution Function . . . 20

1.16.5 Continuous Random Variables . . . 20

1.16.6 Continuous Uniform Distribution . . . 22

1.16.7 Normal Distribution . . . 22

1.16.8 Exponential Distribution . . . 22

1.16.9 Other Continuous Distributions . . . 23

1.17 Functions of Random Variables . . . 23

1.18 Joint Distributions . . . 24 1.19 Marginal Distributions . . . 24 1.20 Independence . . . 24 1.21 Conditional Probability . . . 25 1.22 Distribution Functions . . . 25 iii

(4)

iv CONTENTS

1.23 Homework and Answers . . . 25

1.24 Convolution(Discrete Case) . . . 28 1.25 Convolution(Continuous Case) . . . 29 1.26 Expectation . . . 29 1.26.1 Expectation(Discrete Case) . . . 29 1.26.2 Expectation(Continuous Case) . . . 30 1.26.3 Expectation of a Function . . . 30 1.26.4 Properties of Expectation . . . 31 1.27 Joint Distributions . . . 33 1.28 Marginal Distributions . . . 33 1.29 Independence . . . 34 1.30 Conditional Distributions . . . 34 1.31 Conditional Expectation . . . 34

1.32 Homework and Answers . . . 36

1.33 Midterm Exam . . . 40

1.34 Theory of Probability . . . 42

1.34.1 The Normal Distribution and the Central Limit Theorem . . . 42

1.34.2 Central Limit Theorem . . . 43

1.34.3 Point Estimation and Confidence Intervals . . . 44

1.34.4 Law of Large Numbers . . . 44

1.34.5 Sample Paths and Modes of Convergence . . . 45

1.34.6 Strong Law of Large Numbers . . . 45

1.34.7 Types of Convergence . . . 46

1.34.8 Variance . . . 47

1.34.9 Chebyshev’s Inequality . . . 48

1.34.10 Weak Law of Large Numbers . . . 48

1.34.11 Example of the Central Limit Theorem . . . 49

1.35 Programming Assignment . . . 50

1.36 Markov Terminology . . . 60

1.36.1 Markov Chains . . . 60

1.36.2 Transition Matrix . . . 62

1.36.3 Existence of Steady State Solutions . . . 68

1.36.4 More Markov Chain Terminology . . . 68

1.36.5 Theory of Markov Chains . . . 70

1.36.6 Continuous Time, Discrete State Space Stochastic Model . . . 70

1.36.7 Poisson Process . . . 71

1.37 Homework and Answers . . . 72

1.38 Final Exam and Answers . . . 74

2 Operations Research II (Dr. Lawrence) 79 2.1 Review of Probability Density Functions(PDF’s) . . . 79

2.2 Markov Chains . . . 80 2.2.1 Stochastic Processes . . . 80 2.2.2 Transition Matrices . . . 81 2.2.3 Markov Terminology . . . 82 2.2.4 Steady States . . . 84 2.2.5 Expected Costs . . . 86 2.2.6 Absorbing States . . . 88

2.2.7 Homework and Answers . . . 90

2.2.8 Summary . . . 102

2.3 Queuing Theory . . . 103

2.3.1 Memoryless Property . . . 103

2.3.2 Poisson Processes . . . 104

(5)

2.3.4 Priority Queuing . . . 107

2.3.5 M/M/s Queue and Jackson Network . . . 108

2.3.6 M/G/1 Model . . . 113

2.3.7 Homework and Answers . . . 114

2.3.8 Handout of Equations . . . 125

2.3.9 Summary . . . 126

2.4 Applications of Queuing Theory . . . 127

2.4.1 M/M/1 Taxi Example . . . 127

2.4.2 The Berth Example . . . 127

2.4.3 Homework and Answers . . . 128

2.5 Inventory Theory . . . 131

2.5.1 Deterministic Inventory Theory . . . 131

2.5.2 Probabilistic Inventory Theory . . . 135

2.5.3 A Stochastic Inventory . . . 136

2.5.4 Inventory with Operating and Waiting Costs . . . 137

2.5.5 Inventory with Shortage Costs . . . 137

2.5.6 Summary . . . 138

2.5.7 Homework and Answers . . . 139

2.6 Forecasting . . . 145

2.6.1 Moving Average and Exponential Smoothing . . . 145

2.6.2 Cyclical Trend Analysis . . . 146

2.6.3 Summary . . . 148

2.7 Markov Decision Making . . . 149

2.7.1 Policy Making . . . 149

2.7.2 Homework . . . 153

2.7.3 Reliability . . . 153

2.7.4 Bayes Risk . . . 157

3 Network Optimization (Dr. Margo Schaefer) 161 3.1 Network Representation . . . 161

3.2 Network Terminology . . . 161

3.3 Shortest Route Problems . . . 163

3.3.1 Dijkstra’s Algorithm . . . 166

3.3.2 Dynamic Programming . . . 168

3.3.3 Algorithmic Complexity . . . 172

3.3.4 Minimal Spanning Trees . . . 172

3.3.5 Shortest Path Problems as Transshipment Problems . . . 174

3.3.6 Shortest Route as an LP . . . 175

3.4 Constructing Project Network Diagrams . . . 178

3.4.1 LP Formulation . . . 185

3.5 CPM Models . . . 186

3.5.1 Time Charts . . . 187

3.5.2 LP Formations for Optimal Crashing . . . 188

3.6 Activity on the Node Networks . . . 189

3.7 PERT . . . 204

3.7.1 Critical Path Method . . . 205

3.7.2 Difficulties with PERT . . . 207

3.7.3 Alternative to PERT . . . 208

3.7.4 Solving a Generalized Network . . . 212

3.7.5 Complex GPN Calculations . . . 213

3.8 Homework and Answers . . . 213

3.9 Maximum Flow Problems . . . 222

3.9.1 Branch and Bound . . . 222

(6)

vi CONTENTS

3.11 Minimum Cost Network Flow Problem . . . 225

3.12 Homework and Answers . . . 227

3.13 The Transportation Problem . . . 261

3.13.1 Transportation Simplex Method . . . 262

3.14 Network Location Problems . . . 266

3.14.1 Classifying Location Problems . . . 268

3.14.2 Solutions to the Center Problems . . . 270

3.14.3 Median Problems . . . 274

3.15 Euler Networks and Postman Problems . . . 277

3.15.1 Euler Tours . . . 277

3.15.2 Constructing Euler Tours . . . 278

3.15.3 The Chinese Postman Problem for Undirected Graphs . . . 278

3.15.4 The Postman Problem for Directed Graphs . . . 284

3.16 References . . . 285

4 Theory of Statistics (Dr. Ram Dahiya) 287 4.1 Estimating Parameters . . . 287

4.1.1 Inference Based on Random Samples . . . 287

4.1.2 Method of Moments . . . 290

4.1.3 Internal Estimation . . . 291

4.1.4 Means of Two Populations . . . 292

4.2 Confidence Intervals . . . 294

4.2.1 Confidence Intervals ofσ2 . . . 294

4.2.2 Confidence Interval of the Binomial . . . 295

4.2.3 Sample Size . . . 297

4.2.4 The Binomial Proportions . . . 297

4.2.5 Homework and Answers . . . 297

4.3 Maximum Likelihood Estimator . . . 303

4.3.1 The MLEs of Two Parameters . . . 306

4.3.2 Rao-Cramer Inequality . . . 306

4.3.3 Chebyshev’s Theorem . . . 307

4.4 Testing of Hypotheses about Parameters . . . 307

4.4.1 Power Tests . . . 308

4.4.2 Testing About Proportions . . . 308

4.4.3 Testing About Two Proportions . . . 309

4.4.4 Homework . . . 310

4.4.5 Find the Power at Two Points . . . 316

4.4.6 More on Hypothesis Testing . . . 316

4.4.7 Testing Aboutσ . . . 317

4.4.8 Power of the Chi Square Test . . . 317

4.4.9 Power of Two Normals . . . 317

4.4.10 Homework and Answers . . . 318

4.4.11 One-way ANOVA . . . 325

4.4.12 Two-way ANOVA . . . 327

4.4.13 Two-way ANOVA with Replication . . . 329

4.4.14 Linear Regression . . . 329

4.4.15 Homework . . . 330

4.4.16 Correlation Coefficient . . . 333

4.4.17 Mid-term Exam . . . 334

4.5 Linear Model Test Statistics . . . 335

4.6 Homework and Answers . . . 336

4.7 Confidence Interval ofY and E(Y) . . . 341

4.8 Multivariate Hypergeometric Distribution . . . 342

(7)

4.10 Conditional Distributions . . . 345

4.11 Conditional Mean and Variance . . . 345

4.12 Bivariate Normal Distribution . . . 346

4.13 Correlation Analysis . . . 347

4.14 Testing About the Distribution . . . 347

4.15 More on the Chi Square Goodness of Fit Test . . . 349

4.16 Comparison of Two Multinomials . . . 350

4.17 Comparison of Several Multinomials . . . 351

4.18 Contingency Tables . . . 351

4.19 Non-parametric Methods . . . 352

4.19.1 Estimation ofp . . . 353

4.19.2 Confidence Intervals forp . . . 354

4.19.3 Homework . . . 354

4.19.4 Testing about the Median . . . 358

4.19.5 Testing forp for a Fixedp . . . 358

4.19.6 Wilcoxon Test for Median . . . 359

4.19.7 Two Sample Median Test . . . 360

4.19.8 Wilcoxon Two Sample Test . . . 360

4.19.9 Run Test . . . 361

4.19.10 Kolmogorov-Sminolv Goodness-of-fit Test . . . 362

4.20 Final Exam . . . 362

4.21 Homework . . . 363

5 Design and Analysis of Experiments (Dr. Naik) 369 5.1 Terminology . . . 369

5.2 Completely Randomized Design(CRD) . . . 370

5.2.1 Estimation of Model Parameters . . . 374

5.2.2 Standard errors of ˆμi . . . 374

5.2.3 Confidence Interval forμi . . . 374

5.2.4 Testing of Hypotheses . . . 374

5.2.5 Data Obtained Using CRD . . . 376

5.2.6 Another Form of 1-Way ANOVA Model . . . 376

5.2.7 Unequal Replications . . . 376

5.3 Contrasts . . . 377

5.3.1 Estimation of Contrasts . . . 377

5.3.2 Multiple Comparisons . . . 379

5.4 Homework and Answers . . . 380

5.5 Random Effects Model . . . 386

5.6 CRD with Nesting . . . 387

5.7 Two-stage Nested Design . . . 390

5.8 Randomized Block Design(RBD) . . . 391

5.8.1 Confidence Interval of (τj−τj) . . . 392

5.9 Residual Analysis . . . 393

5.10 Latin Square Design . . . 393

5.11 Summary . . . 395

5.12 Factorial Designs . . . 395

5.12.1 2-Factor Factorial Design . . . 398

5.13 2-Factor, Crossed Designs . . . 400

5.13.1 2-Factor Factorial Design withrBlocks . . . 400

5.13.2 2-Factor Random Effects Design . . . 400

5.13.3 2-Factor Mixed Effects Design . . . 402

5.14 3-Way Factorial Design . . . 402

5.15 Homework and Answers . . . 404

(8)

viii CONTENTS

5.17 2k Factorial Designs . . . 411

5.17.1 Description of Yate’s Algorithm . . . 412

5.18 2k Design with Blocking . . . 414

5.19 Two Factor Factorial Design with r= 1 . . . 414

5.20 2k Design withr= 1 . . . 414

5.21 Homework and Answers . . . 415

5.22 Midterm Exam . . . 419

5.23 An Example of 23 with Blocking . . . 420

5.24 Fractional Factorial Designs . . . 421

5.24.1 Construction of 122k Design . . . 422

5.24.2 Analysis of the Data . . . 423

5.24.3 Q-Q Plots . . . 424

5.25 Confounding . . . 425

5.25.1 Partial Confounding . . . 426

5.26 BIBD Design . . . 428

5.26.1 Analysis of the Data . . . 429

5.27 Split Plot Design . . . 430

5.27.1 Analysis of the Data . . . 430

5.27.2 Repeated Measures Data . . . 432

5.27.3 Cross-over Trials . . . 432

5.27.4 AB/BA Design . . . 432

5.28 Homework . . . 433

5.29 Homework and Answers . . . 433

5.30 Final Exam . . . 435

6 Nonparametric Statistics (Dr. Lee) 437 6.1 Rank Tests for Comparing 2 Treatments . . . 437

6.1.1 Untied Observations . . . 437

6.1.2 Tied Observations . . . 440

6.1.3 Relationship ofWsto the Mann-Whitney Statistic . . . 442

6.1.4 Two Sided Alternative . . . 443

6.2 Siegel-Tukey and Smirnov Tests . . . 443

6.2.1 The Smirnov Test . . . 444

6.2.2 Tabulated Null Distribution . . . 444

6.3 Homework and Answers . . . 445

6.4 Variance ofWxy whenm=n= 2 . . . 448

6.5 Population Models . . . 449

6.5.1 Null Distribution ofWs whenF is Discrete . . . 449

6.5.2 Power of the Rank Sum Test . . . 450

6.5.3 Power of the Wilcoxon Test . . . 451

6.5.4 Asymptotic Power . . . 452

6.5.5 Calculating Power . . . 453

6.5.6 Confidence Limits for Δ andθ . . . 454

6.6 Homework and Answers . . . 454

6.7 Mid-term Exam and Answers . . . 455

6.8 Paired Comparisons of Two Treatments . . . 457

6.8.1 The Sign Test . . . 458

6.8.2 Null Distribution ofSN . . . 458

6.8.3 Null Mean/Variance and Asymptotic Distribution . . . 458

6.8.4 Notation . . . 458

6.8.5 Conditional Distribution ofSN . . . 458

6.9 The Wilcoxon Signed Rank Test . . . 459

6.9.1 Correction for TiesVs . . . 461

(9)

6.10 Population Models/The One Sample Problem . . . 462

6.10.1 Shift Model . . . 464

6.10.2 Estimating the Shift Parameter . . . 464

6.10.3 Power of the Sign Test . . . 466

6.10.4 Approximate Power of the Sign Test . . . 466

6.10.5 Estimating a Location Parameter . . . 468

6.10.6 Estimating the Center of Symmetryθ . . . 468

6.10.7 More on the Signed Rank Statistic . . . 468

6.11 Confidence Limits . . . 469

6.11.1 Population Median . . . 470

6.11.2 Center of Symmetry . . . 470

6.12 Homework and Answers . . . 471

6.13 Comparison of More Than Two Treatments . . . 474

6.13.1 Kruskal-Wallis Test . . . 475

6.13.2 Tied Observations . . . 476

6.13.3 2×t Contingency Tables . . . 477

6.13.4 Multiple Comparisons . . . 478

6.13.5 One-sided Procedures . . . 479

7 SAS Programming (Dr. Morgan) 483 7.1 SAS Data Sets . . . 483

7.1.1 Reading Raw Data Assignment . . . 485

7.1.2 Printing Example . . . 486

7.1.3 Inputting Raw Data . . . 486

7.1.4 INPUT Formats Assignment . . . 486

7.1.5 Permanent Data Sets . . . 487

7.1.6 Options when Reading Datasets . . . 487

7.1.7 Creating SAS Variables Assignment . . . 488

7.2 PROC CONTENTS Assignment . . . 488

7.3 PROC MEANS . . . 489

7.3.1 PROC MEANS Assignment . . . 489

7.4 PROC UNIVARIATE . . . 490

7.4.1 PROC UNIVARIATE Assignment . . . 492

7.5 PROC FREQ and PROC CHART . . . 493

7.5.1 PROC FREQ/PROC CHART Assignment . . . 493

7.6 Combining Datasets and Handling Dates . . . 494

7.6.1 Assignment . . . 494

7.7 PROC FORMAT . . . 496

7.7.1 PROC FORMAT Assignment . . . 496

7.8 Data Analysis PROCS . . . 497

7.8.1 Assignment . . . 497

8 Linear Regression (Dr. Morgan) 499 8.1 Simple Linear Regression . . . 499

8.1.1 Point Estimates . . . 501

8.1.2 Homework and Answers . . . 502

8.1.3 Model Assumptions and MS(E) . . . 503

8.1.4 Inference in Simple Linear Regression . . . 504

8.1.5 Inference forβ0 . . . 505

8.1.6 Inference fory . . . 505

8.1.7 Simple Coefficients of Determination and Correlation . . . 505

8.1.8 An F-Test for Simple Linear Regression . . . 506

8.1.9 Homework and Answers . . . 506

(10)

x CONTENTS

8.2 Assumptions Behind Regression . . . 509

8.2.1 Shapiro-Wilks Test of Normality . . . 509

8.2.2 Lack of Independence . . . 509

8.2.3 Sign Testing for Checking Assumption 2 . . . 510

8.2.4 Homework . . . 511

8.3 Matrix Algebra . . . 513

8.3.1 The Transpose of a Matrix . . . 513

8.3.2 Sums and Differences of Matrices . . . 513

8.3.3 Matrix Multiplication . . . 514

8.3.4 The Identity Matrix and Inverses . . . 514

8.4 Multiple Regression . . . 515

8.5 Homework and Answers . . . 517

8.6 Test #1 . . . 519

8.7 The General Linear Regression Model . . . 520

8.7.1 Special Cases . . . 520

8.7.2 Assumptions, Standard Errors, and Residual Analysis . . . 521

8.7.3 Multiple Coefficient of Determination and Correlation . . . 521

8.7.4 Overall F-Test and the Basic ANOVA Table . . . 521

8.7.5 Inference forβj . . . 522

8.7.6 Confidence Intervals and Prediction Intervals . . . 522

8.8 More on Multiple Regression . . . 522

8.8.1 Interaction . . . 522

8.8.2 Testing Part of a Model . . . 523

8.9 Outliers and Influential Observations . . . 524

8.10 Multicollinearity(Ill Conditioning) . . . 526

8.10.1 Partial Leverage Plots . . . 527

8.11 Model Building . . . 528

8.11.1 Some Model Comparison Criteria . . . 528

8.11.2 Backwards, Forward, and Stepwise Selection Procedures . . . 530

8.11.3 TransformingX andY to Get a Linear Fit . . . 531

8.12 Homework and Answers . . . 533

8.13 Remedies for Non-Constant Error Variance . . . 534

8.13.1 Weighted Analysis . . . 534

8.13.2 Transformations ofY to Stabilize Variance . . . 536

8.14 Dummy Variables(Indicators) . . . 538

8.14.1 Piece-wise Linear Regression . . . 539

8.15 Homework and Answers . . . 541

8.16 1-Factor Experiments . . . 543

8.17 2-Factor Experiments . . . 546

8.18 Homework and Answers . . . 550

8.19 Logistic Regression . . . 552

8.19.1 Fitting the Logistic Regression Model . . . 553

8.19.2 Testing for Significance of the Coefficients . . . 554

8.19.3 The Multiple Logistic Regression Model . . . 555

8.19.4 Lack-of-Fit . . . 556

8.19.5 Interpreting the Regression Coefficients . . . 558

8.20 References . . . 561

9 Clinical Trials (Dr. Lee) 563 9.1 Outline . . . 563

9.1.1 Clinical Trial Phases . . . 564

9.1.2 The Study Protocol . . . 564

9.1.3 Essentials of Good Clinical Trial Design . . . 565

(11)

9.1.5 General Criteria for Inclusion and Exclusion . . . 566

9.1.6 Example of Selection Criteria . . . 566

9.1.7 Baseline Assessment . . . 567

9.1.8 Four Major Study Designs . . . 568

9.1.9 Methods of Randomization . . . 570

9.1.10 Blinding or Masking of Treatment Assignment . . . 571

9.1.11 Monitoring Compliance . . . 571

9.1.12 Exclusions, Withdrawals, and Losses . . . 572

9.1.13 Treatment Efficacy and Effectiveness . . . 574

9.2 Background and Review . . . 574

9.3 Large Sample Tests . . . 575

9.4 General Approach to Sample Size Determination . . . 576

9.4.1 Sample Size and Power Calculations . . . 577

9.5 General Sample Size and the Power Equation . . . 578

9.5.1 Further Background . . . 579

9.6 Comparing Slopes with Repeated Measures . . . 583

9.6.1 Estimators of Subject Specific Slopes . . . 583

9.6.2 Paired Binary Response . . . 586

9.7 Simple Linear Regression . . . 588

9.7.1 Model for Clinical Trials . . . 589

9.8 Comparing Slopes for 2 Treatment Groups . . . 589

9.9 Homework and Answers . . . 589

9.10 Dummy Variables . . . 591

9.11 2×2 Frequency Tables . . . 592

9.11.1 Binomial Sampling Model . . . 593

9.11.2 Multinomial Sampling Model . . . 593

9.11.3 Chi-Square Statistic . . . 593

9.11.4 Continuity Correction . . . 593

9.11.5 Summary of the Chi-Square Statistics . . . 594

9.11.6 Relationship to the Standardized Differences . . . 594

9.11.7 The Odds Ratio . . . 594

9.11.8 Odds Ratio Estimate . . . 595

9.11.9 Properties of the Odds Ratio . . . 595

9.11.10 Large Sample Confidence Limits . . . 596

9.11.11 Basis for the Confidence Limit . . . 596

9.12 Homework and Answers . . . 596

9.13 Comparing Two Population Proportions . . . 602

9.13.1 Odds Ratio . . . 602

9.13.2 Log Odds Ratio . . . 602

9.13.3 The Likelihood Function . . . 602

9.13.4 Re parameterization . . . 603

9.13.5 Re parameterizing the Likelihood Function . . . 603

9.13.6 Fisher’s Exact Test . . . 603

9.13.7 Conditional Distribution ofx|S=s . . . 604

9.13.8 The Null Distribution . . . 604

9.13.9 Null Mean and Variance . . . 604

9.13.10 Relationship to a 2×2 Table . . . 604

9.13.11 The Likelihood Ratio Test . . . 605

9.13.12 Large Sample Conditional Tests . . . 605

9.13.13 Small Sample Case of Fisher’s Exact Test . . . 606

9.14 Example of Grouping by an Explanatory Variable . . . 606

9.15 Summary of Peto, et. al. (1976) Part I . . . 610

9.16 Homework and Answers . . . 611

(12)

xii CONTENTS

9.18 Censoring . . . 617

9.18.1 Censored Survival Times . . . 618

9.18.2 Survival Function and Hazard Rate . . . 618

9.19 The Hazard Rate Function . . . 619

9.20 Estimates for ¯F(t) . . . 620

9.20.1 Life Table Method . . . 621

9.21 Proportional Hazard Rate Model . . . 622

9.21.1 The Kaplan-Meier Estimator . . . 623

9.21.2 Examples Illustrating the Kaplan-Meier Estimator and the Log Rank Test . . . 625

9.21.3 Example (Peto, et. al., 1977) . . . 625

9.21.4 Example Based on the Combined Data . . . 626

9.21.5 Hypothesis Testing . . . 627

9.21.6 Adjusted Log Rank Statistic . . . 629

9.21.7 Adjusted Log Rank Statistic . . . 629

9.22 Asymptotic Distribution of the Log Rank Statistic . . . 634

9.22.1 Confidence Limits for the Relative Hazard Rate Model . . . 634

9.23 Sample Size and the Power of the Log Rank Test . . . 634

9.24 Estimating the Proportion of Deaths Occuring in a Maximum Duration Trial . . . 635

9.25 Sample Size and Power of the Log Rank Test . . . 636

9.25.1 Calculatingp . . . 636

9.26 Sequential Monitoring . . . 637

9.26.1 Introduction . . . 637

9.26.2 Repeated Tests . . . 638

9.26.3 Some Limitations . . . 638

9.26.4 Layout of the Data . . . 638

9.26.5 Information Fractions . . . 639

9.26.6 Sequential Monitoring of Clinical Trials . . . 639

9.26.7 Formulation as a Sequential Testing Problem . . . 640

9.27 Comparing Slopes in a Linear Random Effects Model with Repeated Measures . . . 641

9.28 αSpending Functions . . . 642

9.28.1 An Approximate Solution to the Sequential Testing Problem . . . 642

9.29 Computing Boundaries and Sample Size Using LAND and GLAN . . . 644

9.30 Designing a Trial with Sequential Monitoring . . . 650

9.31 Homework and Answers . . . 651

9.32 Final Exam Review . . . 653

9.33 References . . . 654

10 Mathematical Statistics I (Dr. Morgan) 655 10.1 Notions from Set Theory . . . 655

10.2 Introduction to Probability . . . 656

10.2.1 Finite Sample Spaces . . . 659

10.2.2 Interpretations of Probabilities . . . 660

10.2.3 Conditional Probability and Independence . . . 661

10.2.4 Discrete Random Variables . . . 664

10.2.5 Continuous Random Variables . . . 667

10.2.6 Properties of the Distribution Function . . . 668

10.2.7 Mathematical Expectation . . . 670

10.2.8 Chebyshev’s Inequality . . . 673

10.3 Multivariate Distributions . . . 673

10.4 Homework . . . 675

10.5 More on Two Random Variables . . . 675

10.6 Conditional Distributions and Expectations . . . 676

10.7 Correlation Coefficient . . . 679

(13)

10.9 Independent Random Variables . . . 681

10.10Homework Answers . . . 681

10.11Test and Answers . . . 682

10.12Independent RVs, Expectations, and MGFs . . . 687

10.12.1 Extension to Several Random Variables . . . 689

10.12.2 Discrete and Continuous Cases . . . 690

10.12.3 Distribution Functions fornRandom Variables . . . 690

10.12.4 Marginal Densities . . . 691

10.12.5 Joint Independence . . . 692

10.13Some Homework Answers . . . 692

10.14Indicators . . . 693

10.15Binomial, Negative Binomial, and Multivariate Distributions . . . 694

10.16The Poisson Distribution . . . 697

10.17The Gamma Distribution . . . 697

10.18The Normal Distribution . . . 700

10.19Bivariate Normal Distribution . . . 702

10.20Distribution of Functions of RVs . . . 703

10.211:1 Transformations . . . 704

10.22Change of Variables Technique . . . 705

10.23The Beta,T,andF Distributions . . . 705

10.23.1 Extensions . . . 708

10.24Extension of Substitution of Variables . . . 710

10.25Ordered Statistics . . . 710

10.26Homework Answers . . . 712

10.27Moment Generating Function Technique . . . 716

10.28Distribution of ¯xands2 . . . 717

10.29Convergence in Distribution . . . 719

10.30Homework Answers . . . 720

10.31Homework Answers . . . 721

10.32References . . . 725

11 Mathematical Statistics II (Dr. Dahiya) 727 11.1 Background . . . 727

11.2 Estimation of Parameters . . . 729

11.3 Consistent Estimator . . . 733

11.3.1 Estimating a Function ofθ . . . 734

11.3.2 Use of Moment Estimators . . . 735

11.4 Homework and Answers . . . 735

11.5 Interval Estimation . . . 740

11.5.1 Comparing Two Means . . . 742

11.5.2 Confidence Intervals for Two Binomials . . . 743

11.5.3 Confidence Intervals ofσ . . . 743

11.6 Testing Hypotheses . . . 744

11.6.1 Testing About the Binomialp. . . 744

11.6.2 Two-Sided Alternative Tests . . . 745

11.6.3 Testing About the Normal Mean Whenσis Unknown . . . 745

11.6.4 Testing About the Means of Two Normals . . . 746

11.6.5 p-value . . . 746

11.6.6 Testing About Variances . . . 746

11.7 Chi-Square Goodness of Fit Test . . . 746

11.7.1 The Chi-Square Test When the Parameters Are Unknown . . . 747

11.7.2 Testing for Two Multinomial Distributions . . . 748

11.7.3 Independence of Two Attributes . . . 749

(14)

xiv CONTENTS

11.9 Finding the Unbiased Minimum Variance Estimator . . . 750

11.10Factorization Theorem . . . 751

11.11Sufficiency When the Range ofxDepends onθ . . . 752

11.11.1 Results Related to Sufficient Statistics . . . 753

11.12Rao-Blackwell Theorem . . . 753

11.13Complete Family . . . 754

11.13.1 The Laplace Transform . . . 755

11.14Implications of Complete Sufficient Statistics . . . 755

11.14.1 The Exponential Family . . . 755

11.14.2 Factorization . . . 756

11.14.3 Case of Several Parameters . . . 758

11.14.4 Minimum Set of Sufficient Statistics . . . 758

11.14.5 Ancillary Statistic . . . 759

11.14.6 Location Invariance Statistic . . . 759

11.14.7 Scale Invariant . . . 759

11.14.8 Location and Scale Parameters . . . 760

11.15Baysian Estimation . . . 760

11.15.1 Loss Functions . . . 760

11.16Rao-Cramer Inequality . . . 761

11.17Homework and Answers . . . 762

11.18More on the Rao-Cramer Lower Bound . . . 770

11.19The Cauchy Distribution . . . 771

11.20Asymptotic Distribution of the MLEθ . . . 772

11.21Midterm Exam and Answers . . . 774

11.22Robust Estimation . . . 777

11.23Best Critical Regions . . . 778

11.24Uniformly Most Powerful Test . . . 780

11.25Likelihood Ratio Test . . . 781

11.26Sequential Probability Ratio Test . . . 782

11.27Quadratic Forms . . . 784

11.28One-Way ANOVA . . . 785

11.28.1 General Result (Normal Distribution) . . . 786

11.29Homework and Answers . . . 786

11.302-Way ANOVA (Con’t) . . . 797

11.31Two-Way ANOVA withc= 1 . . . 797

11.32Regression Problem . . . 798

11.33Homework and Answers . . . 799

11.34Short Review . . . 806

11.35Distributions of Quadratic Forms . . . 807

11.36Non-Parametric Methods . . . 807

11.36.1 Estimatingξp . . . 808

11.36.2 The Sign Test . . . 808

11.36.3 Wilcoxon Test for the Median . . . 809

11.36.4 Median Test . . . 810

11.36.5 Run Test . . . 810

11.36.6 Mann-Whitney Wilcoxon Test . . . 811

11.37Homework and Answers . . . 812

12 Linear Models (Dr. John P. Morgan) 817 12.1 Notation . . . 818

12.2 Introduction to Vectors and Matrices . . . 818

12.3 Generalized Inverses . . . 822

12.4 Homework and Answers . . . 823

(15)

12.6 G-Inverses for Symmetric, Non-Negative Definite Matrices . . . 832

12.7 Homework and Answers . . . 832

12.8 Quadratic Forms and Idempotent Matrices . . . 841

12.9 Homework and Answers . . . 846

12.10Normal,F, t,andχ2 Distributions . . . 849

12.10.1 Multivariate Normal Distribution . . . 850

12.10.2 Non-Central Chi-Square Distribution . . . 851

12.10.3 Non-centralF Distribution . . . 852

12.10.4 Distributions of Quadratic Forms . . . 852

12.11Homework and Answers . . . 855

12.12Test and Answers . . . 858

12.13Full Rank Model Regression . . . 861

12.13.1 Distributional Properties . . . 863

12.13.2 Tests of Hypotheses . . . 863

12.13.3 Likelihood Ratio Test . . . 864

12.13.4 The Reduced ModelKTb= 0. . . . 866

12.13.5 Summary . . . 867

12.14Departure from Multi-linearity (Lack-of-Fit) . . . 868

12.15Confidence Intervals . . . 869

12.15.1 SAS . . . 870

12.16Models Not of Full Rank . . . 876

12.17Test of Hypotheses (V =σ2I) . . . 879

12.17.1 A Reduced Model . . . 880

12.17.2 Non-Estimable Functions . . . 881

12.17.3 Orthogonal Contrasts and Decomposition ofSS(R) . . . 881

12.17.4 Using Constraints to Find Solutions . . . 882

12.18Homework and Answers . . . 882

12.19Two Elementary Models . . . 888

12.19.1 The One-Way Classification Model . . . 888

12.19.2 Two-Way Nested Classification . . . 892

12.20Homework and Answers . . . 894

12.21Two-Way Crossed Classification Design . . . 899

12.21.1 Without Interaction . . . 899

12.22Homework and Answers . . . 904

12.23Test and Answers . . . 908

12.24Connectedness in 2-Way Crossed Classification . . . 910

12.25Two-Way Crossed Classification with Interaction . . . 913

12.26Homework . . . 916

13 Survival Analysis (Dr. Dahiya) 919 13.1 Censored Data . . . 919

13.2 Survival Function . . . 921

13.2.1 Hazard Function . . . 922

13.2.2 Estimation ofh(t) with Non-Parametric Methods . . . 923

13.2.3 Cumulative Distribution Hazard Function . . . 923

13.2.4 Behavior ofh(t) for Different Distributions . . . 923

13.3 Estimation of Survival Functions . . . 924

13.4 Standard Life Estimators in Case of Withdraws or Censoring . . . 926

13.5 Properties of the Product Limit Estimator . . . 928

13.5.1 Estimator ofV ar(s(x)) . . . 928

13.6 Life Tables . . . 929

13.6.1 Full Sample Case and the Product Limit Estimator . . . 929

13.6.2 Cohort Life Tables and Current Life Tables . . . 931

(16)

xvi CONTENTS

13.7 Relative and Corrected Survival Rates . . . 932

13.7.1 Corrected Survival Rates . . . 932

13.7.2 Cox-Mantel Test . . . 932

13.7.3 Cox Proportional Hazards Model . . . 933

13.7.4 m-Sample Test . . . 935

13.7.5 Estimation ofs(t|x) for the Cox Proportional Hazard Model . . . 936

13.8 Review of Statistical Tests and Distributions for Survival Analyzes . . . 937

13.8.1 Cox-Mantel Test . . . 937

13.8.2 Log-Rank Test . . . 938

13.8.3 Chi-Square Test . . . 938

13.8.4 Cox’sF−Test . . . 938

13.8.5 Mantel and Hanzel Test . . . 939

13.8.6 Other-Than Linear Distributions . . . 939

13.8.7 Other Distributions . . . 940

13.8.8 Gompers Distribution . . . 940

13.9 Homework 1 and Answers . . . 941

13.10PlottingF(x) andFn(x) . . . 942

13.10.1 Hazard Plotting . . . 943

13.11Goodness-of-Fit Tests . . . 943

13.11.1 Pearson Chi-Square Goodness-of-Fit . . . 944

13.11.2 Goodness-of-Fit for Censored Data . . . 944

13.12Homework 3 Goes Here . . . 949

13.13Regression Methods for Distribution Fitting . . . 949

13.13.1 Weighted Least Squares Estimator . . . 949

13.13.2 Chi-Square Test for the Fit of a Given Model . . . 950

13.14Comparing Two Survival Distributions . . . 951

13.15References . . . 951

14 Modeling Project (Dr. Naik, Advisor) 953 14.1 Model Selection . . . 954

14.1.1 Correlation Analysis . . . 954

14.2 Data Analysis . . . 955

14.2.1 Residual Analysis . . . 955

14.3 Normality Remedy . . . 956

14.4 Re-Analysis of the Data . . . 956

14.5 Conclusions . . . 956

A 957 A.1 SAS Source Code . . . 957

A.2 Repeated Measures Analysis using PROC GLM . . . 962

A.2.1 Selected Partial Correlation Coefficients . . . 962

A.2.2 Hypotheses Tests . . . 963

A.3 Repeated Measures Analysis using PROC MIXED . . . 965

A.3.1 Estimates ofρandσ2 . . . 965

A.3.2 Tests of Hypotheses . . . 966

A.3.3 Least Squares Means . . . 967

A.3.4 Tukey Pairwise Comparisons . . . 968

A.3.5 Residual Analysis . . . 969

A.4 Analysis with the Unbalanced Data Set . . . 971

A.4.1 Tests of Hypotheses . . . 971

A.4.2 Estimates Fittingyijk =μij+ijk . . . 972

A.4.3 Least Squares Means of Interaction Terms Only . . . 973

A.4.4 Tukey Pairwise Comparisons of the AB Interaction Terms . . . 975

(17)
(18)

Chapter 1

Stochastic Models in Computer

Science

Dr. Simha, College of William and Mary CSCI 524, Fall 1991

Text used: Solomon, Frederick,Probability and Stochastic Processes,Prentice Hall, 1987

1.1

Stochastic vs Non-stochastic Approaches

Find the expected income from rental of a pier. A non-stochastic approach is to get the schedule for the year(not reliable information) and compute the total rent. A stochastic approach is to compare the schedule with the previous year’s data; take samples from last year’s data; find the average number of ships per day; multiply ¯xby the rental fee per day by 365.

Differences

Non-stochastic Stochastic

Assumes full knowledge Postulate from last year’s data Large amount of data Small amount of data

Large cancellation Easy calculation If the data is accurate, then the

answer is accurate

At best, a guess

When data is impossible to obtain, a stochastic method must be used. Why study stochastic modeling in computer science?

Useful in evaluating designs(algorithms, architectures).

Modeling system behavior(operating systems).

Computational aspects of stochastic modeling.

Theoretical foundation.

1.2

Review

1.2.1

Review of Sets

Sets: union and intersection. Only infinite set will be used. {1,2,3, ...}= ℵ, the set of natural numbers.

{...,−3,2,1,0,1,2,3, ...}= Z, the set of integers. Q = ab, a, b Z, b = 0, is the set of rational num-1

(19)

bers(finite length). is the set of real numbers(infinite length). Thecardinality is the size of sets, denoted by||.

1.2.2

Review of Sequences

A sequence is a collection of real numbers indexed by natural numbers. Formally, a mapping of: ℵ → . 1.3,2.3,3.3, ...: an =n+.3. Generally, sequences a1, a2, a3, ..., an. If an = n1, then limn→∞an = 0.

Lim-its may or may not be in the sequence given. Suppose, an = 1 n1. Then, limn→∞an = 1. Definition:

limn→∞an=L, iff for every >0,∃N(),such that the following is true: ∀n > N(),|an−L|< .

Example: Suppose|an−0|=n10= 1n. e= 0.01,1011 ,1021 ,1031 , ... Prove the following two expressions:

lim n→∞ 1 n = 0. lim n→∞ 1 n = 0.001.

Givene >0,whichnssatisfy

n1 0< e?

Only if,n >1.By takingN() = 1,we know∀n > N(),

n1 0<

Prove the second equation: lim

n→∞ 1

n = 0.001.

Proof: Suppose the limit is true. Then,∃N() function. Given¯ >0,∀n >N(),¯

n1 0.001< .

Choose= 0.0005.Picknlarger than max ¯ N(0.0005), 1 0.0005 . Then n1 <0.0005.Therefore, n1 0.001 >0.0005 =.

Example: an= 1.So, 1,1,1,1, ...limn→∞1 = 1. N() = 1.

Example: an = (1)n. 1,+1,1,+1, ...limn→∞−1n = 1,for anyL. ForN(),pick= 0.5, N(0.5).Do not choose= 10.It’s too big.

(20)

1.2. REVIEW 3

1.2.3

Combinations of Sequences

Suppose, an →a,and bn →b.Letcn=an+bn.Then,cn →a+b.limn→∞cn = limn→∞an+bn =a+b.

To prove use the limit definition and construct aandb.

Example: an =n1;bn= 1 +n1. an→0. bn→1.So,cn= 1 +n1+1n = 1 +n2 = 1.Similarly,an−bn→a−b,

anbn→ab, abnn ab. can→ca,wherec is a constant.

1.2.4

Limits and Functions

f : → ,egf(x) =x2.Supposex1, x2, ..., xnis a sequence such thatxn→x.¯ Then,f(limn→∞xn) =fx).

Next, letyn =f(xn).Then, y1, y2, ..., yn is a sequence. Doesyn →fx)? Not true whenfx) is

discontinu-ous. f(x) =x2. xn = 3 +n1.So,xn→3 = ¯x. yn =f(xn) =x2n= 9 + 6n+n12. yn→9 =fx). Example: f(x) = 0, if 0≤x≤3. x2, ifx >3.

xn= 3 +n1.So,xn→3 = ¯x.Thus,fx) = 0.But,yn = 9.

1.2.5

Sequences of Functions

f1(x), f2(x), ...Eachfn : → .

Example:

fn(x) =x2+1

n.

Choosex= 3.Then,f1(3), f2(3), ...= 9 + 1,9 +12,9 +31, ...,9 +n1.So,fn(3)9, fn(4)16.More generally,

fn(x)→x2. fn(x) =f(x) =x2.

1.2.6

Sums and Averages

Given a sequence a1, a2, a3, ....construct:

1. The sequence of partial sums. b1=a1. b2=a1+a2.... bn=a1+a2+...+an. n

i=1 ai.

2. The sequence of partial averages. c1=a1. c2=(a1+a2)

2 .... cn= a1+···+n an = 1 n n i=1 ai. Example: an = 1 2 n , bn = n i=1 1 2 i , cn= 1 n n i=1 1 2 i . Let an = xn,0 < x < 1. bn = x+x2 +· · ·+xn = 1−xx(1−xn). an 0. bn 1−xx. limn→∞bn = limn→∞ ni=1ai= ni=1ai.

(21)

Partial averages. Suppose an = 5.5,5,5, .... an→5.

cn= a1+· · ·+an

n =

5n 5 = 5. So,cn 5.Suppose that

an = 5, ifnis even. 6, ifnis odd. an= 6,5,6,5, .... an converges to nothing. cn 5.5. an = 5, ifnis even. 6, ifnis odd. cn= a1+· · ·+an n = 1 n n 2 6 + n 2 5 , neven. 1 n n+ 1 2 6 + n−1 2 5 , nodd. cn→ 6+5 2 , ifn is even. 6+5 2 +21n, ifn is odd. cn 6+52 = 5.5.

Example: Toss a fair coin. Obtain $1.00 if heads, $0.00 dollars otherwise. Repeat the experimentntimes. What is the average win?

1 + 1 + 0 + 1 +· · ·+ 0 + 1

n =cn

cn 12.That is, the probability of obtaining heads.

1.2.7

Other Forms of Limits

1. Instead of writingan= 1n,writea(n) = n1.

2. Sometimes a superscript is used. lim

n→∞a (n)

x .

3. Sometimes the sequence is not specified. lim

x→3f(x).

4. Sometimes one out of several variables is taken in a limit. f(x, y, n) =x+y

n.

(22)

1.3. BASIC PROBABILITY 5

1.3

Basic Probability

Some terminology.

1. experiment - or single observation which can be performed at least in thought, any number of times under the same relevant conditions. Examples include: tossing a coin, drawing a card from a deck. 2. sample space - the set of possible outcomes or results or observations.

3. event -a subset of the sample space, Ω.

IfA is an event and W ∈Aoccurs, we say that ‘A occurred.’ ΩΩ. ∅ ⊆Ω = the empty set. {1},{2}, ... areelementary events.

Example: A coin flip. Ω = {H, T}. Events are{H}, and{T}. An experiment would be 3 coin flips. An example of an outcome from an experiment: {HHHT T T H}.In general there are 2|Ω|unique combinations.

1.3.1

Discrete and Continuous Sample Spaces

A discrete sample space is a countable set such: 1. Finite.

2. Some cardinality as|ℵ|.

is an example of an uncountable set. Some examples:

• {1,2,3,4,5,6}= Ω is discrete and finite.

• {1,2,3, ...}= Ω is discrete and infinite.

[12.3,169.45] is continuous and uncountably infinite. This can refer to height, weight, time of day, etc. Probabilities are numbers associated with events. Given a sample space, Ω, a probability measure is a collection of real numbers, one for each event A in Ω. P(A) for A which satisfy:

1. P(Ω) = 1.

2. 0≤P(A)1 for every A⊆Ω.

3. For disjoint events A, B⊆Ω, P(A∪B) =P(A) +P(B).

Example: A coin flip. Ω = {H, T}. : P() = 0. {H} : P({H}) = 12. {t} : P({T}) = 12. {H, T} : P({H}) +P({T}) = 1.

Example: Throwing a die. Ω ={1,2,3,4,5,6}. Events Number P() = 0 {1} P({1}) = 16 . . . . . . {6} P({6}) = 16 {1,2} P({1,2}) = 26 . . . . . .

(23)

In general, for any event{x1, ..., xk} ⊆ {1,2, ..., k}.DefineP({x1, ..., xk}) =P({x1})+···+P({xk}).Axioms

1-3 stated above are satisfied. Adistributionis a way in which you describe the probability.

1.3.2

Some Basic Properties

1. Consider A, B Ω, such that A B. Then, B −A = P(B)−P(A). proof: B = A∪(B −A). P(B) =P(A) +P(B−A).

2. ForA⊆Ω,defineAc= ΩA.Then,P(Ac) = 1P(A). proof: AAc= Ω. P(Ω) =P(A) +P(Ac).

1 =P(A) +P(Ac).

3. A1, ..., Anaredisjoint events. Then,

P n i=1 Ai = n i=1 P(Ai).

4. A, B Ω not necessarily disjoint events. Then, P(A∪B) = P(A) +P(B)−P(A∩B). proof: A∪B= [A(A∩B)]∪[B(A∩B)]∪(A∩B). P(A∪B) =P(A)−P(A∩B)+P(B)−P(A∩B)+P(∩B) = P(A) +P(B)−P(A∩B).

Example: A die throw. Suppose we want P(result is an odd number). Ω = {1,2,3,4,5,6}.Event A =

{1,3,5}. P({i}) = 16, i= 1,2,3,4,5,6. P({1,3,5}) =P({1})∪P({3})∪P({5}) = 16 +16+16 =12.

1.3.3

Countable Additivity

Consider an infinite sequence of eventsA1, A2, A3, ...where eachAi⊆Ω.

Example: Ω ={1,2,3,4, ...}A1={1,2}, A2={2,3}etc.

Replace axiom 3 with: SupposeA1, A2, ...are disjoint. Then, P i=1 Ai = i=1 P(Ai).

Example: Ω ={1,2,3, ...}. A1={1}, A2={2}, ..., An={n}.Suppose thatP({n}) = 21n.Then, I=1 Ai= Ω. P(Ω) =P i=1 Ai = i=1 P(Ai) = i=1 1 2i = 1 2 + 1 22 + 1 23 +· · ·= 1 2 11 2 = 1.

Example: A complex experiment. 3 coin flips, 1 die throw, and 1 card drawing. Ω1={H, T},Ω2={H, T}, Ω3={H, T},Ω4={1,2,3,4,5,6},Ω5={As, ..., Kd}.

To find the cross product of sets given 2 sets A={a1, ..., an} andB ={b1, ..., bm}. A×B ={(x, y) :x∈

A, y∈B}={(a1, b1), ...,(an, bm)}.As an example: No={1,3,5, ...};Ne={2,4,6, ...}. No×Ne={(x, y) :

(24)

1.4. HOMEWORK AND ANSWERS 7

In the previous example, Ω = Ω1×Ω2×Ω3×Ω4×Ω5={(x1, x2, x3, x4, x5) :xi∈Ωi}.eg: (H, T, H,3, Ad)Ω,

is called an outcome of the experiment.

Look for sources of randomness to break-down an experiment.

Example: Two die throws is a complex experiment. The elementary experiments are the first throw and the second throw. Ω1={1,2,3,4,5,6}; Ω2={1,2,3,4,5,6}.Ω = Ω1×Ω2={(x, y) :x∈Ω1, y∈Ω2}. eg. A={(1,1),(2,2),(3,3)}is an event of the experiment.

A⊆Ω P(A) {(1,1)} 1616 =361 {(1,2)} 1616 =361 . . . . . . {(6,6)} 1616 =361 . . . . . .

1.4

Homework and Answers

1. Consider the sequence an =5+34nn and answer the following:

(a) Show informally thatan 43.

lim n→∞ 4n 5 + 3n = limn→∞ 4n n 5+3n n = lim n→∞ 4 5 n+ 3 = 4 0 + 3 = 4 3.

(b) Provide a formal proof of the same thing using the definition of a limit, i.e., construct the N() function for this case.

5 + 3n4n 4 3 < , 12n15 + 9n4(5 + 3n)< , 12n15 + 9n2012n< , 15 + 9n20 < .

Carry out the division and solve forn.SetN() =n.

(c) Show thatan does not converge to zero. Show that anyN() function fails to work.

2. A speeding vehicle is ticketed by a police officer, who notes the license plate number(consisting of six characters). Assuming we are interested in observing the plate number, identify the sample space and the event corresponding to “the license plate contains at least three A’s.”

(25)

The sample space is constructed as follow: Ω1={a, b, c, ..., z}.Ω2={a, b, c, ..., z}.Ω3={a, b, c, ..., z}. Ω4 = {a, b, c, ..., z}. Ω5 = {a, b, c, ..., z}. Ω6 = {a, b, c, ..., z}. Ω = Ω1×Ω2 ×Ω3×Ω4 ×Ω5×Ω6. Ω ={(x, y, z, t, u, w) :x∈Ω1, y∈Ω2, z∈Ω3, t∈Ω4, u∈Ω5, v∈Ω6and three letters are ’A.’}

It is assumed that license plates contain all characters and no numbers.

3. A fair coin is tossed once and its outcome is observed. If the outcome is ‘heads,’ the coin is tossed again and the outcome recorded. Write down the sample space for this experiment. Is it a complex experiment? Can it be naturally decomposed into more elementary experiments? If so, is the sample space expressible as a cross-product? Give an example of an event. Assign a probability measure and compute(with explanation) the probability of obtaining two ‘heads.’

The sample space is: Ω = {HH, HT, T1, ..., T6}. Yes, the experiment is a complex experiment in that there are 2 sources of randomness — flipping a coin and throwing a die. The experiment can be decomposed into two separate sample spaces. Ω1 = {H, T}.Ω2 = {T,1, ...,6}.Ω = Ω1×Ω2 =

{(x, y) :x∈Ω1;y Ω2; (T, y) : y ∈ {1, ...,6}}An example of an event would be A={(HT),(T1)}. The probability of {(T T)} is zero since it is not part of the sample space. The probability of

{(HH)} is given as follow: A = 1-st flip is heads. B = 2-nd flip is heads. P(B|A) = 12. P(A) = 12. P(A∩B) =P(B|A)P(A) =1212 = 14.

4. Let Ω be any finite sample space withnelements, i.e.,|Ω|=n.For each eventA⊆Ω,defineP(A) = |An|. Show that this association of numbers with events is a valid probability measure(show that the three axioms are satisfied). Give an example of an experiment for which this would be a suitable probability measure.

By definition,P(Ω) = |Ω|n =nn = 1.

1.5

Programming Assignment

This is a short programming assignment designed to get you comfortable with infinite sequences of real numbers. In this programming assignment, you will study sequences of real numbers to determine if certain types of limits exist. For an infinite sequence of real numbersa1, a2, a3, ...(each ai is aterm orelement of

the sequence) one is often interested in answering the following questions:

1. Does the sequencea1, a2, a3, ...converge to any limit, i.e., do terms in the sequence appear to get closer to any particular number, and if so, what is that number?

2. Construct a new sequence b1=a1, b2=a1+a2, ..., bn= ni=1ai, ...Does the sequence ofpartial sums

b1, b2, b3, ...converge to any limit?

3. Construct yet another sequence c1=a1, c2= a1+a2

2 , ..., cn=n1 ni=1ai, ...Does this sequence ofpartial

averages converge to anything?

You are given some code which will produce terms from three sequences from which you are to find answers to the above questionsfor each of the three different sequences. This is implemented as a PASCALfunction get from sequence(i: integer) which will return the next term in thei-th sequence (i = 1,2,3) when called. Thus, if we denote the first two terms of the third sequence as a1 and a2 then they may be obtained as follows:

start over;

get from sequence(3);

(26)

1.5. PROGRAMMING ASSIGNMENT 9 The procedurestart overensures that the first call toget from sequence (following a call tostart over ) generates the very first term in the sequence. Thus, to get the first two elements once again, it is necessary to callstart overbefore usingget from sequence.

Deliverables for this assignment:

You should hand in two neat copies(one for my records) of:

Supporting documentation for the program: a paragraph describing your code.

A complete listing of your code together with procedures I have supplied. Your code will contain copious in-line documentation, of course.

Annotated output from your program. For each sequence: 1. Print the first 20 terms.

2. Print the 100th term of the sequence, the 100th term in the corresponding sequence of partial sums and partial averages.

3. Do the same for the 10000th terms of the sequence, the sequence of partial sums, and partial averages.

What do the various sequences(and the constructed sequences of partial sums and partial averages) appear to converge to? Can you argue that these are the limits for the sequence?

Note:

Use at least 6 decimal places of accuracy when printing real numbers.

Do not confuse the sequence number with the subscript of a particular element or with constructed versions of a particular sequence. Thus, the 2-nd sequence(i = 2 inget from sequence(i)) has its first, second, third,..., etc terms. Corresponding sequences of partial sums and partial averages are constructed using terms entirely from the 2-nd sequence. Thus the three sequences each have two additional constructed sequences which you must consider.

You may write your program in C if you like.

You are encouraged to play around with the sequences to see what convergence behavior they demon-strate.

This is NOT a long assignment. You should not need more than 50(text) lines of code.

Have fun!

program first_assignment (input, output); const

m = 2147483647; (* const used in random # generator *) num_proc = 10;

var

p,s: array[0..num_proc] of real; x_seed: integer;

index_A, index_B: integer;

(27)

(* Random number generator *) function x_random: real;

const a = 16807; q = 127773; r = 2836; var t,lo,hi: integer; begin

hi:= x_seed div q; lo:= x_seed - q*hi; t:= a*lo - r*hi; if (t>0) then x_seed:= t else x_seed:= t+m; x_random:= x_seed/m; end; (*...*) (* initialize the random number generator *) procedure put_seed(x: integer);

begin

if (0<x) and (x<m) then x_seed:= x; end;

(*...*) (* Reset all sequences *) procedure start_over; begin put_seed(7774755); index_A:= 1; index_B:= 1; end; (*...*) procedure initialize; var i: integer; begin start_over; p[0]:= 0.4; s[0]:= p[0];

for i:= 1 to num_proc do begin

p[i]:= 0.6/num_proc; s[i]:= s[i-1] + p[i]; end;

(28)

1.5. PROGRAMMING ASSIGNMENT 11

(*...*) (* This function returns the next term in the specified sequence*) function get_from_sequence(x: integer):real;

var i: integer; u: real; begin case x of 1: begin get_from_sequence:= 1-1/sqr(index_A); index_A:= index_A + 1; end; 2: begin get_from_sequence:= 1/index_B; index_B:= index_B + 1; end; 3: begin u:= x_random; i:= 0;

while (u>s[i]) and (i<10) do i:= i + 1; get_from_sequence:= i; end; end; end; (*...*) (* main program - insert your code here. You may break your code*) (* into several procedures/functions. *) procedure terms(sqnc: integer);

var

i: integer; n: real; begin

start_over;

writeln(outfile, ’The first 20 terms of sequence’,sqnc:2, ’ are: ’); for i:= 1 to 20 do

begin

n:= get_from_sequence(sqnc); writeln(outfile, n:8:6); end;

for i:= 21 to 100 do get_from_sequence(sqnc); writeln(outfile);

writeln(outfile); writeln(outfile);

write(outfile, ’The 100-th term of sequence’,sqnc:2,’ = ’); writeln(outfile, n:12:6);

writeln(outfile);

for i:= 101 to 10000 do n:= get_from_sequence(sqnc);

write(outfile,’The 10000-th term of sequence’,sqnc:2,’ = ’); writeln(outfile,n:18:16);

(29)

writeln(outfile); writeln(outfile); end;

procedure partial_sums(sqnc: integer); var

i: integer; n: real; k: real;

writeln(outfile, ’ The first 20 terms of partial sums of sequence’, sqnc:2,’ are ’); for i:= 1 to 20 do begin n:= get_from_sequence(sqnc); k:= k+n; writeln(outfile, k:8:6); end; for i:= 21 to 100 do begin n:= get_from_sequence(sqnc); k:= k+n; end; writeln(outfile); writeln(outfile); writeln(outfile);

write(outfile,’The 100-th term of partial sums of sequence’, sqnc:2,’ = ’,k:12:6); writeln(outfile); for i:= 101 to 10000 do begin n:= get_from_sequence(sqnc); k:= k+n; end; writeln(outfile); writeln(outfile);

write(outfile,’The 10000-th term of partial sums of sequence’, sqnc:2,’ = ’,k:12:6);

writeln(outfile); writeln(outfile); writeln(outfile); end;

procedure partial_averages(sqnc: integer);

(* the following procedure computes the partial average of a given sequence *) var i: integer; n: real; k: real; m: integer; begin start_over; k:= 0.0;

(30)

1.5. PROGRAMMING ASSIGNMENT 13 sqnc:2,’ = ’); m:= 1; while n<=20 do begin for i:= 1 to m do begin n:= get_from_sequence(sqnc); k:= k+n; end; k:= k/i; writeln(outfile, k:8:6); m:= m+1; start_over; k:= 0.0; end; for i:= 1 to 100 do begin n:= get_from_sequence(sqnc); k:= k+n; end; writeln(outfile); writeln(outfile); k:= k/i;

write(outfile,’The 100-th term of partial averages of sequence’, sqnc:2,’ = ’,k:12:6); start_over; k:= 0.0; for i:= 1 to 10000 do begin n:= get_from_sequence(sqnc); k:= k+n; end; writeln(outfile); writeln(outfile); k:= k/i;

write(outfile,’The 10000-th term of partial averages of sequence’, sqnc:2,’ = ’,k:24:22); writeln(outfile); writeln(outfile); writeln(outfile); writeln(outfile); end; (*...*) begin initialize; for i:= 1 to 3 do begin terms(i); partial_sums(i); partial_averages(i); end; end.

(31)

Sequence 1 Here an = 1 n12. As n → ∞, n12 0 and so an 1. A more formal proof would use

N() = 12, but you were not required to provide this. Next, consider the sequence of partial sums

bn = ni=1ai. One may decompose each term in the sequence of partial sums into two parts: bn = n

i=1ai = n− ni=1i12. Any decent calculus textbook will(should) tell you that ni=1i12 converges.

It happens to converge to π2

6 .So the second part of our decomposition gets closer and closer to the constant π2

6.You might have discovered this for yourself by printing out the latter sum and observing the convergence. The first part diverges. Since, for any constant c,the sequence n+c→ ∞,we must have bn → ∞. Finally, consider the sequence of partial averages cn = n1 ni=1ai. Again, the same

decomposition gives us: cn =n1 ni=1ai= 1n1 ni=1i12.Since the latter sum converges to a constant,

n

i=1i12 gets closer to π 2

6 for largen. Hence n1 n

i=1i12 will converge to zero. Thus, cn 1. Formal

proofs for the last two cases are slightly more complicated and were not required.

Sequence 2 The second sequence isan= n1.We have seen thatan 0 already. Again, your calculus book

would tell you that the sequence of partial sums,bn= ni=11i diverges, although it’s not experimentally

obvious. It’s not very difficult to show divergence by expressing the sum as an integral. It can be shown that bn≥ln(n+ 1) +C1,for some constant C1. Since ln(n+ 1) diverges, bn,diverges. It can also be

shown thatbn≤ln(n) +C2whereC2is also a constant. Thus for each term in the sequence of partial averages is less than ln(n)+C2

n and so the sequence of partial averages converges to zero. Most of the

arguments were for sequence 1; I did, however, take off a few points for a complete lack of reasoning or very wrong answers.

Sequence 3 This sequence is random, as most of you observed. The sequence itself and the sequence of partial sums do not converge. However, the sequence of partial averages will appear to converge to 3.3. Limits for random sequences are treated a little differently, as we shall see later. The sequence of partial averages does indeed converge to 3.3, but in different sense than for real sequences. You were not expected to mention this — I only took off points for incorrect observations.

1.6

Card Experiments

Example: 51 cards, throw one out, say the king of spades. Again, let A = {card is a spade}, B =

{card is an ace}. P(A|B) = PP(A(B∩B)). P(B|A) = PP(A(A∩B)). A = {1, ...,12}, and B = {1,14,27,40}. Find,

P({1,...,12})∩P({1,14,27,40}) P({1,14,27,40}) = 1 51 4 41 = 1 4. P(B|A) = 1 51 12 51 = 1 12. P(A) = 1251 =P(A|B). P(B) =514 =P(B|A). Example: A first card is drawn and not replaced. A second card is drawn. Let A= “1-st card is ace of spades,” and B= “second card is two of spades.” Ω1 = {1, ...,52}, and Ω2 = {1, ...,52}. Ω =

{(x, y) : x Ω1, y Ω2 andx = y}. A = {(1, y) : y Ω2, y = 1}. B = {(x,2) : x Ω1, x = 2}. P(A) = 521 P(B) =P(2nd card is 2|1st card is 1) =511. A∩B ={(1,2)}. P(A∩B) =P(B|A)P(A) = 521 511. P({x, y}) = 52(51)1 , x= y. P(B) =P({(i,2)) :i∈Ω, i= 2}) = P({(1,2),(3,2),(...),(52,2)}=P({(1,2)}+

· · ·+P({(52,2)}) = 51(52)1 +· · ·+52(51)1 =521.

Example: A urn has 3 red balls and 2 blue balls. Pick two balls without replacement. Let A=‘both are the same color.’ Find P(A). Ω1 = {R, B}, Ω2 = {R, B}. Ω = {(R, R),(R, B),(B, R),(B, B)} A =

{(R, R),(B, B)}The probability measure,P(1-st is red) = 53. P(1-st is blue) = 25. P(2-nd is red|1-st is red) = 2

4. P(2-nd is blue|1-st is blue) = 14. P(2-nd is red|1-st is blue) = 43. P(2-nd is blue|1-st is red) = 24. P({(R, R)}) = P(1-st red2-nd red) =P({(R, B),(R, R)}∩{(R, R),(B, R)}) =P(2-nd red|1-st red)P(1-st red) = 2435=

6

20. P({(R, B)}) =P(2-nd blue|1-st red)P(1-st red) = 2435 = 206. P({(B, B)}) = 202. P(A) =P({(R, R),(B, B)}) = P({(R, R)}) +P({(B, B)}) = 206 +202 =208.

Example: 3 card draw without replacement. A = {1-st card spade}, B = {2-nd card spade}, C =

(32)

1.7. CONDITIONAL PROBABILITY 15 11

5012511352.

1.7

Conditional Probability

Example: 2 card drawing. Draw the first card and do not replace it. Draw another card. Ω1={1, ...,52}, Ω2={1, ...,52}.Ω ={(x, y) :x∈Ω1;y∈Ω2, x=y}.eg (3,3)∈/ Ω.

Example: Examine the CPU of a multiuser machine. Count the number of users logged on. Count the number of batch jobs. Count the number of interactive jobs. Ω1 = {1,2,3, ..., n}, Ω2 = {1,2,3, ..., n}, Ω3{1,2,3, ..., n}.Ω = Ω1×Ω2×Ω3={(0, x, y) :y >0}.

Example: Two die throws (independent experiment). P({i, j}) = P({i})P({j}), i, j ∈ {1,2,3,4,5,6}, whereP({i}) = 16.

Example: Toss a coin(dependent experiment). If heads, set second toss to tails; else set second toss to heads. Ω ={(H, T),(T, H)}. P({H, T}) = 12 =P({H})P({T}).

Example: A single die throw(conditional probability). Ω ={1,2,3,4,5,6}.LetA={1,6},andB={5,6}. P(A) =P({1}) +P({6}) = 61+16 = 13. Repeat the experimentntimes. Let fA(n) be the number of times

Aoccurs. Let fB(n) be the number of timesB occurs. Look at fA(nn) 13 =P(A). Suppose we know that

B occurred. What is the probability thatA occurred also? Note that for bothA andB to occur, A∩B. LetfA∩B(n) be the number of times bothAandB occurs. Then, fAf∩B(B(nn)) =

fA∩B(n) n fB(n) n P(A∩B) P(B) =P(A|B). P(A|B) = P(PA(BB)).In the example,P(A|B) = PP(A(B∩B)) = {1P,6}∩{5({5,6}),6})=PP({5({6}),6}) = 16 2 6 = 1 2.

Example: Draw a card. LetAbe that the card is a spade. LetBbe that the card is an ace. Ω ={1, ...,52}. A={1, ...,13},andB ={1,14,27,40}.FindP(A|B). P({i}) = 521, i∈ {1, ...,52}. P(A|B) =P(spade|ace) =

P(A∩B) P(B) = P({1P,14({1}),27,40}) = 1 52 4 52 = 1 4. P(B|A) =P(ace|spade) = PP(A(∩AB)) = P({1P({1}),...,13}) = 1 52 13 52 = 1 13. Notice that P(A|B) =P(A).Events A and B are independent iffP(A∩B) =P(A)P(B), P(A|B) =P(A), and P(B|A) =P(B). P(A|B) = PP(A(B∩B)) =P(AP)(BP()B) =P(A).

1.8

Law of Total Probability

Let Ω be a sample space. B1, B2, ..., Bnis a partition of Ω if

1. Bi∩Bj =∅.

2. ni=1Bi= Ω.

The law of total probability forA⊆Ω, P(A) =P((A∩B1)∪...∪(A∩Bn)) =P(A∩B1) +...+P(A∩Bn) =

P(A|B1)P(B1) +...+P(A|Bn)P(Bn).

Example: Two card draw without replacement. LetAbe that the ‘second card is an ace.’ IfB1is ‘first card is an ace,’ andB2is ‘first card is not an ace.’ Then,P(A) =P(A|B1)P(B1)+P(A|B2)P(B2) = 513 524 +514 4852.

Example: A factory has three machines. MachineA produces 20% of the products. MachineB produces 30% of the products. Machine C produces 50% of the products. For machine A, 6% of the products

(33)

are defective. For machine B, 7% of the products are defective. For machine C, 8% of the products are defective. Select a product randomly and let E be the event that the product is defective. What isP(E)? SA= product made by A, SB = product made by B, SC= product made by C. P(SA) = 0.2, P(SB) = 0.3,

P(SC) = 0.5. P(E|SA) = 0.06, P(E|SB) = 0.07, P(E|SC) = 0.08. SA∪SB∪SC∪= Ω. SA∩SB =∅. P(E) =

P(E|SA)P(SA)+P(E|SB)P(SB)+P(E|SC)P(SC) = (0.06)(0.2)+(0.07)(0.3)+(0.08)(0.5).As an alternative,

let Ω1 = {A, B, C}. Ω2 = {D, N}. Ω = Ω1×Ω2. P({(A, D)}) = P(defect|made on A)P(made on A) = P(E|SA)P(SA). P(SA|E) +P(PSA∩(E)E) =(0.06)(0.2)+(00.

References

Related documents

Results of the survey are categorized into the following four areas: primary method used to conduct student evaluations, Internet collection of student evaluation data,

Such a collegiate cul- ture, like honors cultures everywhere, is best achieved by open and trusting relationships of the students with each other and the instructor, discussions

Guide to Graduate Education | 14 Academic Year 2014-15 along with the student’s application to the current program, the student must contact the Division of Graduate Studies

The limited explanatory value of these broad and general conditions suggests that only by looking at local conditions and dynamics can we get better insights

(ENG) TÍTOL ACTIVITAT 8: : LABORATORI DE DISSENY D'OSCIL·LADORS DE RF Guided activities: 1h 30m Self study: 4h Guided activities: 2h Self study: 5h Guided activities: 1h

In this study, the effect of anhydrous calcium phosphate, an efflorescent pharmaceutical powder of reduced moisture content, ideal for moisture-sensitive materials; and

Experiments were designed with different ecological conditions like prey density, volume of water, container shape, presence of vegetation, predator density and time of

( F ) Quantification of Fast blue labelling in the hindlimb sensorimotor area confirmed that animals showing good recovery of function (black bar) have significantly more