Docsity

Intuitive Probability and Random Processes Using MatLab - Steven M. Kay, Notas de estudo de Engenharia Elétrica

Pré-visualização parcial do texto

Baixe Intuitive Probability and Random Processes Using MatLab - Steven M. Kay e outras Notas de estudo em PDF para Engenharia Elétrica, somente na Docsity!

INTUITIVE PROBABILITY

AND

RANDOM PROCESSES

USING MATLAB®

INTUITIVE PROBABILITY

AND

RANDOM PROCESSES

USING MATLAB®

STEVEN M. KAY

University of Rhode Island

^ Springer

To my wife Cindy, whose love and support are without measure and to my daughters Lisa and Ashley, who are a source of joy

NOTE TO INSTRUCTORS

As an aid to instructors interested in using this book for a course, the solutions to
the exercises are available in electronic form. They may be obtained by contacting
the author at [email protected].

V l l l

  1. Inclusion of computer code within the text allows the reader to interpret the mathematical equations more easily by seeing them in an alternative form.
  2. Homework problems based on computer simulations can be assigned to illustrate and reinforce important concepts.
  3. Computer experimentation by the reader is easily accomplished.
  4. Typical results of probabilistic-based algorithms can be illustrated.
  5. Real-world problems can be described and "solved" by implementing the solution in code. Many MATLAB programs and code segments have been included in the book. In fact, most of the figures were generated using MATLAB. The programs and code segments listed within the book are available in the file probbookjiiatlab_code. tex, which can be found at http://www.ele.uri.edu/faculty/kay/New%20web/Books.htm. The use of MATLAB, along with a brief description of its syntax, is introduced early in the book in Chapter 2. It is then immediately applied to simulate outcomes of random variables and to estimate various quantities such as means, variances, prob- ability mass functions, etc. even though these concepts have not as yet been formally introduced. This chapter sequencing is purposeful and is meant to expose the reader to some of the main concepts that will follow in more detail later. In addition, the reader will then immediately be able to simulate random phenomena to learn through doing, in accordance with our philosophy. In summary, we believe that the incorporation of MATLAB into the study of probability and random processes provides a "hands-on" approach to the subject and promotes better understanding. Other pedagogical features of this textbook are the discussion of discrete random variables first to allow easier assimilation of the concepts followed by a parallel dis- cussion for continuous random variables. Although this entails some redundancy, we have found less confusion on the part of the student using this approach. In a similar vein, we first discuss scalar random variables, then bivariate (or two-dimensional) random variables, and finally AT-dimensional random variables, reserving separate chapters for each. All chapters, except for the introductory chapter, begin with a summary of the important concepts and point to the main formulas of the chap- ter, and end with a real-world example. The latter illustrates the utility of the material just studied and provides a powerful motivation for further study. It also will, hopefully, answer the ubiquitous question "Why do we have to study this?". We have tried to include real-world examples from many disciplines to indicate the wide applicability of the material studied. There are numerous problems in each chapter to enhance understanding with some answers listed in Appendix E. The problems consist of four types. There are "formula" problems, which are simple ap- plications of the important formulas of the chapter; "word" problems, which require a problem-solving capability; and "theoretical" problems, which are more abstract

IX

and mathematically demanding; and finally, there are "computer" problems, which are either computer simulations or involve the application of computers to facilitate analytical solutions. A complete solutions manual for all the problems is available to instructors from the author upon request. Finally, we have provided warnings on how to avoid common errors as well as in-line explanations of equations within the derivations for clarification. The book was written mainly to be used as a first-year graduate level course in probability and random processes. As such, we assume that the student has had some exposure to basic probability and therefore Chapters 3-11 can serve as a review and a summary of the notation. We then will cover Chapters 12-15 on probability and selected chapters from Chapters 16-22 on random processes. This book can also be used as a self-contained introduction to probability at the senior undergraduate or graduate level. It is then suggested that Chapters 1-7, 10, 11 be covered. Finally, this book is suitable for self-study and so should be useful to the practitioner as well as the student. The necessary background that has been assumed is a knowledge of calculus (a review is included in Appendix B); some linear/matrix algebra (a review is provided in Appendix C); and linear systems, which is necessary only for Chapters 18-20 (although Appendix D has been provided to summarize and illustrate the important concepts). The author would like to acknowledge the contributions of the many people who over the years have provided stimulating discussions of teaching and research prob- lems and opportunities to apply the results of that research. Thanks are due to my colleagues L. Jackson, R. Kumaresan, L. Pakula, and P. Swaszek of the University of Rhode Island. A debt of gratitude is owed to all my current and former graduate students. They have contributed to the final manuscript through many hours of pedagogical and research discussions as well as by their specific comments and ques- tions. In particular, Lin Huang and Cuichun Xu proofread the entire manuscript and helped with the problem solutions, while Russ Costa provided feedback. Lin Huang also aided with the intricacies of LaTex while Lisa Kay and Jason Berry helped with the artwork and to demystify the workings of Adobe Illustrator 10.^ The author is indebted to the many agencies and program managers who have sponsored his research, including the Naval Undersea Warfare Center, the Naval Air Warfare Cen- ter, the Air Force Office of Scientific Research, and the Office of Naval Research. As always, the author welcomes comments and corrections, which can be sent to [email protected].

Steven M. Kay University of Rhode Island Kingston, RI 02881

^Registered trademark of Adobe Systems Inc.

  • Introduction Preface vii
    • 1.1 What Is Probability?
    • 1.2 Types of Probability Problems
    • 1.3 Probabilistic Modeling
    • 1.4 Analysis versus Computer Simulation
    • 1.5 Some Notes to the Reader
      • References
      • Problems
    • Computer Simulation
  • 2.1 Introduction
    • 2.2 Summary
    • 2.3 Why Use Computer Simulation?
    • 2.4 Computer Simulation of Random Phenomena
    • 2.5 Determining Characteristics of Random Variables
    • 2.6 Real-World Example - Digital Communications - References - Problems
    • 2A Brief Introduction to MATLAB
    • Basic Probability
    • 3.1 Introduction
    • 3.2 Summary
    • 3.3 Review of Set Theory
    • 3.4 Assigning and Determining Probabilities
    • 3.5 Properties of the Probability Function
    • 3.6 Probabilities for Continuous Sample Spaces
    • 3.7 Probabilities for Finite Sample Spaces - Equally Likely Outcomes
    • 3.8 Combinatorics
    • 3.9 Binomial Probability Law
      • 3.10 Real-World Example - Quality Control xii CONTENTS - References - Problems
  • 4 Conditional Probability - 4.1 Introduction - 4.2 Summary - 4.3 Joint Events and the Conditional Probability - 4.4 Statistically Independent Events - 4.5 Bayes' Theorem - 4.6 Multiple Experiments - 4.7 Real-World Example - Cluster Recognition - References - Problems
    • 5 Discrete Random Variables
      • 5.1 Introduction
      • 5.2 Summary
      • 5.3 Definition of Discrete Random Variable
      • 5.4 Probability of Discrete Random Variables
      • 5.6 Approximation of Binomial PMF by Poisson PMF 5.5 Important Probability Mass Functions I l l
        • 5.7 Transformation of Discrete Random Variables
        • 5.8 Cumulative Distribution Function
        • 5.9 Computer Simulation
        • 5.10 Real-World Example - Servicing Customers - References - Problems
    • 6 Expected Values for Discrete Random Variables - 6.1 Introduction - 6.2 Summary - 6.3 Determining Averages from the PMF - 6.4 Expected Values of Some Important Random Variables - 6.5 Expected Value for a Function of a Random Variable - 6.6 Variance and Moments of a Random Variable - 6.7 Characteristic Functions - 6.8 Estimating Means and Variances - 6.9 Real-World Example - Data Compression - References - Problems - 6A Derivation of E[g{X)] Formula - 6B MATLAB Code Used to Estimate Mean and Variance
  • 7 Multiple Discrete Random Variables CONTENTS xiii - 7.1 Introduction - 7.2 Summary - 7.3 Jointly Distributed Random Variables - 7.4 Marginal PMFs and CDFs - 7.5 Independence of Multiple Random Variables - 7.6 Transformations of Multiple Random Variables - 7.7 Expected Values - 7.8 Joint Moments - 7.9 Prediction of a Random Variable Outcome - 7.10 Joint Characteristic Functions - 7.11 Computer Simulation of Random Vectors - 7.12 Real-World Example - Assessing Health Risks - References - Problems - 7A Derivation of the Cauchy-Schwarz Inequality
  • 8 Conditional Probability Mass Functions - 8.1 Introduction - 8.2 Summary - 8.3 Conditional Probability Mass Function - 8.4 Joint, Conditional, and Marginal PMFs - 8.5 Simplifying Probability Calculations using Conditioning - 8.6 Mean of the Conditional PMF - 8.7 Computer Simulation Based on Conditioning - 8.8 Real-World Example - Modeling Human Learning - References - Problems
    • 9 Discrete iV-Dimensional Random Variables - 9.1 Introduction - 9.2 Summary - 9.3 Random Vectors and ProbabiUty Mass Functions - 9.4 Transformations - 9.5 Expected Values - 9.6 Joint Moments and the Characteristic Function - 9.7 Conditional Probability Mass Functions - 9.8 Computer Simulation of Random Vectors - 9.9 Real-World Example - Image Coding - References - Problems
  • 10 Continuous Random Variables xiv CONTENTS - 10.1 Introduction - 10.2 Summary - 10.3 Definition of a Continuous Random Variable - 10.4 The PDF and Its Properties - 10.5 Important PDFs - 10.6 Cumulative Distribution Functions - 10.7 Transformations - 10.8 Mixed Random Variables - 10.9 Computer Simulation - 10. lOReal-World Example - Setting Clipping Levels - References - Problems - lOA Derivation of PDF of a Transformed Continuous Random Variable - lOB MATLAB Subprograms to Compute Q and Inverse Q Functions
    • 11 Expected Values for Continuous Random Variables
      • 11.1 Introduction
      • 11.2 Summary
      • 11.3 Determining the Expected Value
      • 11.4 Expected Values for Important PDFs
      • 11.5 Expected Value for a Function of a Random Variable
        • 11.6 Variance and Moments
        • 11.7 Characteristic Functions
      • 11.8 Probability, Moments, and the Chebyshev Inequality
        • 11.9 Estimating the Mean and Variance
        • U.lOReal-World Example-Critical Software Testing
          • References
          • Problems
          • Variable l l A Partial Proof of Expected Value of Function of Continuous Random
    • 12 Multiple Continuous Random Variables - 12.1 Introduction - 12.2 Summary - 12.3 Jointly Distributed Random Variables - 12.4 Marginal PDFs and the Joint CDF - 12.5 Independence of Multiple Random Variables - 12.6 Transformations - 12.7 Expected Values - 12.8 Joint Moments - 12.9 Prediction of Random Variable Outcome - 12.10 Joint Characteristic Functions
      • 12.11 C o m p u t e r Simulation CONTENTS XV
      • 12.12Real-World Example - Optical Character Recognition - References - Problems
  • 13 Conditional Probability Density Functions - 13.1 Introduction - 13.2 Summary - 13.3 Conditional PDF - 13.4 Joint, Conditional, and Marginal PDFs - 13.5 Simplifying Probability Calculations Using Conditioning - 13.6 Mean of Conditional PDF - 13.7 Computer Simulation of Jointly Continuous Random Variables - 13.8 Real-World Example - Retirement Planning - References - Problems
  • 14 Continuous AT-Dimensional R a n d o m Variables - 14.1 Introduction - 14.2 Summary - 14.3 Random Vectors and PDFs - 14.4 Transformations - 14.5 Expected Values - 14.6 Joint Moments and the Characteristic Function - 14.7 Conditional PDFs - 14.8 Prediction of a Random Variable Outcome - 14.9 Computer Simulation of Gaussian Random Vectors - 14. lOReal-World Example - Signal Detection - References - Problems
    • 15 Probability a n d M o m e n t Approximations Using Limit T h e o r e m s - 15.1 Introduction - 15.2 Summary - 15.3 Convergence and Approximation of a Sum - 15.4 Law of Large Numbers - 15.5 Central Limit Theorem - 15.6 Real-World Example - Opinion Polling - References - Problems - 15A MATLAB Program to Compute Repeated Convolution of PDFs - 15B Proof of Central Limit Theorem
  • 16 Basic Random Processes xvi CONTENTS - 16.1 Introduction - 16.2 Summary - 16.3 What Is a Random Process? - 16.4 Types of Random Processes - 16.5 The Important Property of Stationarity - 16.6 Some More Examples - 16.7 Joint Moments - 16.8 Real-World Example - Statistical Data Analysis - References - Problems
  • 17 Wide Sense Stationary Random Processes - 17.1 Introduction - 17.2 Summary - 17.3 Definition of WSS Random Process - 17.4 Autocorrelation Sequence - 17.5 Ergodicity and Temporal Averages - 17.6 The Power Spectral Density - 17.7 Estimation of the ACS and PSD - 17.8 Continuous-Time WSS Random Processes - 17.9 Real-World Example - Random Vibration Testing - References - Problems
    • 18 Linear Systems and Wide Sense Stationary Random Processes - 18.1 Introduction - 18.2 Summary - 18.3 Random Process at Output of Linear System - 18.4 Interpretation of the PSD - 18.5 Wiener Filtering - 18.6 Continuous-Time Definitions and Formulas - 18.7 Real-World Example - Speech Synthesis - References - Problems - 18A Solution for Infinite Length Predictor
    • 19 Multiple Wide Sense Stationary Random Processes - 19.1 Introduction - 19.2 Summary - 19.3 Jointly Distributed WSS Random Processes - 19.4 The Cross-Power Spectral Density - 19.5 Transformations of Multiple Random Processes
      • 19.6 Continuous-Time Definitions and Formulas CONTENTS xvii
        • 19.7 Cross-Correlation Sequence Estimation
        • 19.8 Real-World Example - Brain Physiology Research
          • References
          • Problems
  • 20 Gaussian Random Processes - 20.1 Introduction - 20.2 Summary - 20.3 Definition of the Gaussian Random Process - 20.4 Linear Transformations - 20.5 Nonlinear Transformations - 20.6 Continuous-Time Definitions and Formulas - 20.7 Special Continuous-Time Gaussian Random Processes - 20.8 Computer Simulation - 20.9 Real-World Example - Estimating Fish Populations - References - Problems - 20A MATLAB Listing for Figure 20.2
  • 21 Poisson Random Processes - 21.1 Introduction - 21.2 Summary - 21.3 Derivation of Poisson Counting Random Process - 21.4 Interarrival Times - 21.5 Arrival Times - 21.6 Compound Poisson Random Process - 21.7 Computer Simulation - 21.8 Real-World Example - Automobile Traffic Signal Planning - References - Problems - 21A Joint PDF for Interarrival Times
    • 22 Markov Chains - 22.1 Introduction - 22.2 Summary - 22.3 Definitions - 22.4 Computation of State Probabilities - 22.5 Ergodic Markov Chains - 22.6 Further Steady-State Characteristics - 22.7 iiT-State Markov Chains - 22.8 Computer Simulation - 22.9 Real-World Example - Strange Markov Chain Dynamics - References xviii CONTENTS - Problems
      • 22A Solving for the Stationary PMF
  • A Glossary of Symbols and Abbrevations
  • B Assorted Math Facts and Formulas - B.l Proof by Induction - B.2 Trigonometry - B.3 Limits - B.4 Sums - B.5 Calculus
    • C Linear and Matrix Algebra
      • C.l Definitions
      • C.2 Special Matrices
      • C.3 Matrix Manipulation and Formulas
      • C.4 Some Properties of PD (PSD) Matrices
        • C.5 Eigendecomposition of Matrices
    • D Summary of Signals, Linear Transforms, and Linear Systems
      • D.l Discrete-Time Signals
      • D.2 Linear Transforms
      • D.3 Discrete-Time Linear Systems
      • D.4 Continuous-Time Signals
      • D.5 Linear Transforms
      • D.6 Continuous-Time Linear Systems
    • E Answers to Selected Problems
      • Index

Chapter 1

Introduction

1.1 W h a t Is Probability?

Probability as defined by Webster's dictionary is "the chance that a given event will occur". Examples that we are familiar with are the probability that it will rain the next day or the probability that you will win the lottery. In the first example, there are many factors that affect the weather—so many, in fact, that we cannot be certain that it will or will not rain the following day. Hence, as a predictive tool we usually assign a number between 0 and 1 (or between 0% and 100%) indicating our degree of certainty that the event, rain, will occur. If we say that there is a 30% chance of rain, we believe that if identical conditions prevail, then 3 times out of 10, rain will occur the next day. Alternatively, we believe that the relative frequency of rain is 3/10. Note that if the science of meteorology had accurate enough models, then it is conceivable that we could determine exactly whether rain would or would not occur. Or we could say that the probability is either 0 or 1. Unfortunately, we have not progressed that far. In the second example, winning the lottery, our chance of success, assuming a fair drawing, is just one out of the number of possible lottery number sequences. In this case, we are uncertain of the outcome, not because of the inaccuracy of our model, but because the experiment has been designed to produce uncertain results. The common thread of these two examples is the presence of a random experi- ment, a set of outcomes, and the probabilities assigned to these outcomes. We will see later that these attributes are common to all probabilistic descriptions. In the lottery example, the experiment is the drawing, the outcomes are the lottery num- ber sequences, and the probabilities assigned are 1/iV, where N = total number of lottery number sequences. Another common thread, which justifies the use of prob- abilistic methods, is the concept of statistical regularity. Although we may never be able to predict with certainty the outcome of an experiment, we are, nonethe- less, able to predict "averages". For example, the average rainfall in the summer in Rhode Island is 9.76 inches, as shown in Figure 1.1, while in Arizona it is only 4.

1.2. TYPES OF PROBABILITY PROBLEMS 3

rainfall in Arizona was 7.3 inches. A somewhat more controlled experiment is the repeated tossing of a fair coin (one that is equally likely to come up heads or tails). We would expect about 50 heads out of 100 tosses, but of course, we could not predict the outcome of any one particular toss. An illustration of this is shown in Figure 1.3. Note that 53 heads were obtained in this particular experiment. This

1 11II I iiii II i + + + +

S

o

heads : •4H- 111 iii mil

tails •+-H- IIII I I I + ^lf + + +

h + + 4*

20 40 60 Toss

80 100

Figure 1.3: Outcomes for repeated fair coin tossings.

example, which is of seemingly little relevance to physical reality, actually serves as a good model for a variety of random phenomena. We will explore one example in the next section. In summary, probability theory provides us with the ability to predict the be- havior of random phenomena in the "long run." To the extent that this information is useful, probability can serve as a valuable tool for assessment and decision mak- ing. Its application is widespread, encountering use in all fields of scientific endeavor such as engineering, medicine, economics, physics, and others (see references at end of chapter).

1.2 Types of Probability Problems

Because of the mathematics required to determine probabilities, probabilistic meth- ods are divided into two distinct types, discrete and continuous. A discrete approach is used when the number of experimental outcomes is finite (or infinite but count- able as illustrated in Problem 1.7). For example, consider the number of persons at a business location that are talking on their respective phones anytime between 9:00 AM and 9:10 AM. Clearly, the possible outcomes are 0 , 1 ,... , AT, where N is the number of persons in the ofiice. On the other hand, if we are interested in the

4 CHAPTER 1. INTRODUCTION

length of time a particular caller is on the phone during that time period, then the outcomes may be anywhere from 0 to T minutes, where T = 10. Now the outcomes are infinite in number since they lie within the interval [0, T]. In the first case, since the outcomes are discrete (and finite), we can assign probabilities to the outcomes { 0 , 1 ,... , N}. An equiprobable assignment would be to assign each outcome a prob- ability of l/(iV +1). In the second case, the outcomes are continuous (and therefore infinite) and so it is not possible to assign a nonzero probability to each outcome (see Problem 1.6). We will henceforth delineate between probabilities assigned to discrete outcomes and those assigned to continuous outcomes, with the discrete case always discussed first. The discrete case is easier to conceptualize and to describe mathematically. It will be important to keep in mind which case is under consideration since otherwise, certain paradoxes may result (as well as much confusion on the part of the student!).

1.3 Probabilistic Modeling

Probability models are simplified approximations to reality. They should be detailed enough to capture important characteristics of the random phenomenon so as to be useful as a prediction device, but not so detailed so as to produce an unwieldy model that is difiicult to use in practice. The example of the number of telephone callers can be modeled by assigning a probability p to each person being on the phone anytime in the given 10-minute interval and assuming that whether one or more persons are on the phone does not affect the probability of others being on the phone. One can thus liken the event of being on the phone to a coin toss— if heads, a person is on the phone and if tails, a person is not on the phone. If there are AT = 4 persons in the office, then the experimental outcome is likened to 4 coin tosses (either in succession or simultaneously—it makes no difference in the modeling). We can then ask for the probability that 3 persons are on the phone by determining the probability of 3 heads out of 4 coin tosses. The solution to this problem will be discussed in Chapter 3, where it is shown that the probability of k heads out of N coin tosses is given by

P[k]=(^)pHl-p)''-' (1.1)

.k
where
N\ N\
kj {N-k)\k\

for A; = 0 , 1 ,... , iV, and where M! = 1 • 2 • 3 • • • M for M a positive integer and by definition 0! = 1. For our example, ii p = 0.75 (we have a group of telemarketers) and iV = 4 a compilation of the probabilities is shown in Figure 1.4. It is seen that the probability that three persons are on the phone is 0.42. Generally, the coin toss