ABSTRACT

This chapter introduces the concept of a random variable. We define the probability mass function of a discrete random variable. From the start, random variables are simulated with sample and replicate and the simulated results compared with theoretical computations. Expected value is defined mathematically, and estimated with simulation and the law of large numbers. We introduce binomial and geometric random variables in the common setting of Bernoulli trials and derive formulas for the pmf and expected value of these distributions. The student learns R's families of functions for working with distributions: d-, p-, and r- for the pmf, cumulative distribution function, and random sampling.

Students explore the behavior of rvs and expected value under transformations, and this leads to the definition of variance and standard deviation of a random variable. We extend the notion of independence from events to rvs, and state the additivity of variance for independent rvs. The Poisson process and Poisson rvs are introduced, followed by the negative binomial and hypergeometric random variables. A vignette discusses explicit loops in R, which are of general programming utility but unneeded for the work in this textbook.