7.3: Defining Randomness
- Page ID
- 64111
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Is a coin flip random? There are many who will state that a coin flip is random while others will state that if we knew all the relevant physical and dynamical characteristics of a coin flip, then certainly the knowledge that we have of physics would be able to tell us exactly how the coin would land. And in fact, research has shown that coin flips can be manipulated in some specialized cases to a certain extent to create situations where coins flips may not be random (Clark and Westerberg 2009; Vulovic and Prange 1986). Similar arguments occur for rolling a die and other physical random generating devices such as spinners. In fact, the nature of randomness can be seen to have deep philosophical implications (Ometto 2016; Beltrami 2020).
For our purposes we do not need to get very philosophical, and indeed while data analysts and scientists use the mathematical theory of randomness daily, a very simple definition suffices. We will start by recalling the definition of an experiment which we first encountered in Chapter 3. In that chapter we defined an experiment as any process that produces observations that provide evidence that can be used to determine if a hypothesis is true or not. The important part of this definition is that an experiment produces something that can be observed. The idea that we may use such an observation to help us support or refute a hypothesis is important for statistical studies and in studies based on data science, but for our discussion in this chapter we will focus on the idea of an observable process.
We usually think of experiments as things that go on in a lab, with beakers and chemicals or electronic equipment. Our definition of experiment is much more general. In fact, anything that we observe every day is an experiment. Experiments can be as simple as flipping a coin to observe whether it lands on heads or tails, to more complex endeavors such as applying pressure to a car windshield do determine how much pressure it can withstand before breaking. It is worth noting that we do not actually have to do anything physically to perform an experiment. We could simply wait until noon and note whether it is raining. We do not have to be manipulating a system to perform an experiment.
Now we need to address the concept of randomness. When we observe randomness, we are observing the result of an experiment, and therefore it is natural to start with the concept of an experiment and define a random experiment. In our first definition of randomness, we stated that there is a lack of definite pattern or predictability in what is observed. In the definition below we use a more precise definition of what we mean when there is a lack of predictability.
A random experiment is any experiment whose outcome cannot be predicted with absolute certainty.
In some research articles you may also see the word stochastic used instead of random. The two words mean essentially the same thing. The key phrase used in the definition above is “absolute certainty.” From a practical point of view, an outcome can be predicted with absolute certainty if you can predict the outcome of an experiment every time without ever failing. For example, is friend is flipping a coin, you might be able to predict the outcome of the coin flip a few times just by luck. However, the definition above insists that you must be able to predict the outcome every single time the coin is flipped without ever making a mistake. There are very few situations where this could be done with a coin flip, and therefore we would conclude that a coin flip is random.
So where does this leave us on the philosophical side of things? Is a coin flip or a die roll random, or are they part of a mechanical universe that could be predicted every time without error? The key for our development is that we will never know enough about the experiments we observe for us to predict the result without error. Even if we could construct a laboratory and a coin flipping device that we could predict perfectly, the predictions would only work for that setup. We could not predict the outcome of any other coin flips in the universe. Thus, it does not matter whether a coin flip is truly random or not. What matters is that we cannot predict the outcome with absolute certainty; so, it acts randomly from our perspective whether it really is random or not.
To anyone who has played video games this is a perspective that may be well appreciated. Seemingly random events in video games, from the outcome of a slot machine app to the movements of that final boss in a roleplaying game that is attempting to end your (virtual) life, are all based on what are called pseudo-random sequence generators. A pseudo-random sequence generator is simply a numerical sequence that will look random to anyone looking at the sequence but is based on a completely deterministic, but complex, mathematical sequence. That is, if you knew the current position of the sequence, then you could predict with absolute certainty what the next number would be without error. From the player’s perspective, we never know where we are in the sequence or even the exact mathematical specification that generates the sequence, and the corresponding illusion is good enough for us to be fooled into thinking that it is random. The behavior is so complex that it looks random to us.
An interesting application of randomness and pseudo-random sequence generators is in encryption technologies used on the internet. We will not go into the technical details, but secure online communications rely on the use of random number sequences. In 1995, computer scientist Phillip Hallam-Baker discovered that an implementation of a common secure communication method used on the internet used a pseudo-random sequence generator, and the starting place in the sequence was derived from the time of day, the process ID, and the parent process ID. The problem was that someone could potentially guess these values, which would predict the starting place in the sequence, and could then compromise a secure online session (Tashian 2017). To overcome this problem, computer scientists developed one of the most famous secure methods for determining the start of a pseudo-random sequence, which is based on taking a digital photograph of the current state of a wall of lava lamps (see Figure \(\PageIndex{1}\)). The chaotic swirls of the paraffin in the lamps are unpredictable, thereby providing a physical device for starting the sequence. This method was invented by Landon Curt Noll, Robert G. Mende, and Sanjeev Sisodiya in 1996 (Peterson 2001).
The concept of randomness discussed above is more than sufficient for us to have a basic understanding of how randomness is used in conjunction with the scientific method. The next step is to have some basic understanding of how statisticians describe how of certain outcomes are observed from random experiments. When statisticians talk about how rare or how frequent observations are they use a measure called probability, or chance.

