# Probability

In games of chance, probability has a very intuitive definition. However, this is not the case in other contexts. Today, probability theory is being used much more broadly with the word *probability* commonly used in everyday language. Google’s auto-complete of “What are the chances of” give us: “having twins”, “rain today”, “getting struck by lightning”, and “getting cancer”. One of the goals of this section of the book is to help us in comprehending how probability is useful for understanding and describing real-world events when performing data analysis. Probability theory is useful whenever our data is affected by chance in some manner. All the other sections in this book build upon probability theory. A knowledge of probability is therefore indispensable for addressing most data analysis challenges.

Given that knowing how to compute probabilities gives strategic advantage in games of chance, many smart individuals throughout history, including famous mathematicians such as Cardano, Fermat, and Pascal, spent time and energy thinking through the math of these games. As a result, Probability Theory was born. Probability continues to be highly useful in modern games of chance. For example, in poker, we can compute the probability of winning a hand based on the cards on the table. Additionally, casinos depend on probability theory to develop games that almost certainly guarantee a profit. We will use casino games to illustrate the fundamental concepts.

This part of the book discusses concepts that can be found in many comprehensive books on probability theory. These books delve into the mathematical theories and formulas behind probability.

This book, however, takes a different approach. Instead of diving into the mathematical theories, it uses R to demonstrate these concepts. This helps readers visualize and better understand the principles of probability in practical terms, as they can see the results and outcomes by running code.

Despite this practical approach, the book does not immediately apply these probability concepts to real-world data. This connection between probability theory and real data will be made in a subsequent section or part of the book.

In other words, while you’re learning about probability now, it’ll be a bit longer before you see how these concepts relate directly to real datasets.