class: center, middle, inverse, title-slide .title[ # MATH 204 Introduction to Statistics ] .subtitle[ ## Lecture 7: Introduction to Probability ] .author[ ### JMG ] --- ## Goals for Lecture * Introduce basic concepts and terminology for probability. Textbook section 3.1 -- * Introduce the ideas of random process, outcome, event, probability, and probability distribution. Textbook sections 3.1.2, 3.1.3, 3.1.4, and 3.1.5. -- * We discuss mutually exclusive and independent events. Textbook sections 3.1.3, 3.1.7, 2.1.5. -- * We will also use R to illustrate some of the basic probability concepts. --- ## Why Do We Study Probability? - Probability forms the foundation of statistics. -- - Probability provides us with a precise language for discussing uncertainty. -- * Suppose we want to know about the average amount of coffee students consume. If we take repeated samples, we will likely get a different mean value for each sample. How much variation is to be expected for the sample mean? This is a question that probability provides us with the tools to answer. --- ## Probability Video Please review this video at your earliest convenience:
--- ## Random Processes - Consider the game of rolling a single six-sided (fair) die. .center[ <img src="https://www.dropbox.com/s/jh4segwkakz1qpr/a_die.png?raw=1" width="50%" /> ] --- ## Dice as a Random Process - Tossing a single die provides an example of a **random process.** -- - A random process is any process with a well-defined but unpredictable set of possible outcomes. -- - For example, we know that tossing a die will result in "rolling" a value of one of 1, 2, 3, 4, 5, or 6. However, we can not predict with absolute certainty which value we will roll on any given toss of the die. -- - Can you think of another example of a random process? Can you think of an example of a process that is not a random process? --- ## Outcomes of a Random Process - An outcome for a random process is any one of the possible results from the random process. -- - For example, the set of outcomes for the random process of tossing a single six-sided die is the values 1, 2, 3, 4, 5, 6. -- - Any collection of outcomes is called an **event**. -- - For example, the event of rolling a even value is made up of the collection of outcomes 2, 4, 6. -- - Two events are said to be **mutually exclusive** if they cannot both happen at the same time. For example, the events of rolling an even number and rolling an odd number after tossing a six-sided die are two mutually exclusive events. -- - On the other hand the events of rolling an even number and rolling a number less than five are NOT mutually exclusive. --- ## Assigning Probabilities > The probability of an outcome is the proportion of times the outcome would occur if we observed the random process an infinite number of times. -- - The probability of any individual outcome for the random process of tossing a six-sided (fair) die is `\(\frac{1}{6}\)`. -- - Note that in general a probability value must be a number between 0 and 1 since it is a proportion. --- ## Some Notation - In probability theory, we often denote events by capital letters such as `\(A\)`, `\(B\)`, etc., or sometimes even with subscripts such as `\(A_{1}\)`, `\(A_{2}\)`, etc. -- - We denote the probability of an event, say `\(A\)` by `\(P(A)\)`. -- - For example, if `\(A\)` is the event of rolling an even number after tossing a six-sided (fair) die, then `\(P(A) = \frac{1}{2}\)`. --- ## The Addition Rule - If `\(A_{1}\)` and `\(A_{2}\)` are **mutually exclusive** events, then `\(P(A_{1} \text{ or } A_{2}) = P(A_{1}) + P(A_{2})\)`. -- - For example, let `\(A_{1}\)` be the event of rolling a number less than 3 and let `\(A_{2}\)` be the event of rolling a number greater than or equal to 4. (Explain why these events are mutually exclusive.) Then $$ `\begin{align*} P(A_{1} \text{ or } A_{2})&= P(\text{rolling less than 3, or greater or equal to 4}) \\ &= P(\text{ rolling 1, 2, 4, 5, 6}) \\ & = \frac{5}{6} \end{align*}` $$ -- On the other hand, $$ `\begin{align*} P(A_{1}) + P(A_{2}) &= P(\text{rolling less than 3}) + P(\text{rolling greater or equal to 4}) \\ &= P(\text{rolling 1, 2}) + P(\text{rolling 4, 5, 6}) \\ &= \frac{2}{6} + \frac{3}{6} \\ &= \frac{5}{6} \end{align*}` $$ --- ## The Complement of an Event - The complement of an event is the collection of all outcomes that **do not** belong to that event. If `\(A\)` is an event, we denote its complement by `\(A^{C}\)`. -- - Suppose that `\(A\)` is the event of rolling a value less than or equal to 2. Then `\(A^{C}\)` is the event of rolling a value greater or equal to 3. -- - Explain why an event and it's complement are necessarily mutually exclusive. -- - If `\(P(A)\)` is the probability of an event, then `\(P(A^{C}) = 1 - P(A)\)`. Likewise, `\(P(A) = 1 - P(A^C)\)`. -- - The probability of rolling a value of 3 is `\(\frac{1}{6}\)`. By the last rule, the probability of rolling any other value besides 3 is `\(1 - \frac{1}{6} = \frac{5}{6}\)`. --- ## Probability Distributions A **probability distribution** is a table of all mutually excusive outcomes and their associated probabilities. -- - For example, consider the random process of tossing two six-sided fair dice and recording the sum of the value of the two dice. Then the possible outcomes are the values 2 through 12. The following table displays the probability for each outcome. -- <table class="table" style="margin-left: auto; margin-right: auto;"> <tbody> <tr> <td style="text-align:left;"> Dice sum </td> <td style="text-align:left;"> 2 </td> <td style="text-align:left;"> 3 </td> <td style="text-align:left;"> 4 </td> <td style="text-align:left;"> 5 </td> <td style="text-align:left;"> 6 </td> <td style="text-align:left;"> 7 </td> <td style="text-align:left;"> 8 </td> <td style="text-align:left;"> 9 </td> <td style="text-align:left;"> 10 </td> <td style="text-align:left;"> 11 </td> <td style="text-align:left;"> 12 </td> </tr> <tr> <td style="text-align:left;"> Probability </td> <td style="text-align:left;"> 1/36 </td> <td style="text-align:left;"> 2/36 </td> <td style="text-align:left;"> 3/36 </td> <td style="text-align:left;"> 4/36 </td> <td style="text-align:left;"> 5/36 </td> <td style="text-align:left;"> 6/36 </td> <td style="text-align:left;"> 5/36 </td> <td style="text-align:left;"> 4/36 </td> <td style="text-align:left;"> 3/36 </td> <td style="text-align:left;"> 2/36 </td> <td style="text-align:left;"> 1/36 </td> </tr> </tbody> </table> --- ## Displaying Probability Distributions Often, we can display a probability distribution as a barplot; For example, <img src="index_files/figure-html/prob_bar-1.png" style="display: block; margin: auto;" /> --- ## Independent Events - Suppose we want to solve the following problem: Toss two coins one at a time, what is the probability that they both land heads up? -- - It is a fact that knowing the outcome of the first coin toss provides no information about what the outcome of the second coin toss will be. -- - This example illustrates the concept of **independence** or **independent events**. --- ## Working with Independent Events - If two events `\(A_{1}\)` and `\(A_{2}\)` are independent, then `$$P(A_{1} \text{ and } A_{2}) = P(A_{1}) P(A_{2})$$` -- - We can use this to solve our question from the last slide. The event of landing two heads can be thought of as the event `\(A_{1} \text{ and } A_{2}\)` where `\(A_{1}\)` is the event that the first toss lands heads and `\(A_{2}\)` is the event that the second toss lands heads. Then `$$P(A_{1} \text{ and } A_{2}) = P(A_{1}) P(A_{2}) = \frac{1}{2}\frac{1}{2} = \frac{1}{4}$$` -- - Here is an example of two events that are NOT independent. Suppose that `\(A_{1}\)` is the event of rolling an even number from a die toss and `\(A_{2}\)` is the event of rolling an odd number from a die toss. Then `\(A_{1}\)` and `\(A_{2}\)` are not independent. In fact, mutually exclusive events are only indepent if the probability of one of them is zero. --- ## An Application of Independence Suppose we randomly select a person. Furthermore, suppose that the probability of randomly selecting a left-handed person is `\(0.48\)` and suppose that probability of randomly selecting a person who likes cats is `\(0.33\)`. We would expect that handedness and predilection for cats are independent. Thus, the probability of randomly selecting a left-handed person who likes cats is ```r 0.48*0.33 ``` ``` ## [1] 0.1584 ``` --- ## Summary In this lecture, we covered the topics of -- - Random processes, outcomes, events, probabilities, and probability distributions -- - We discussed mutually exclusive and independent events --- ## Notes --- ## Notes --- ## Notes