Module 2 — Definitions of Probability

A.I HUB
2 min readAug 2, 2023

--

Image by Naser Tamimi on Unsplash

In this article, we will explore the definition of probability and provide hands-on code snippets using python to demonstrate how to calculate probabilities in various scenarios.

Introduction

Probability is a fundamental concept in mathematics and statistics representing the likelihood of an event occurring.

Let’s have a glance of probability using python programming:

Step 1 — Understanding Probability

Probability measures the chance of an event happenings ranging from 0 which indicates (impossible) to 1 which indicates (certain). It is calculated by dividing the number of favorable outcomes by the total possible outcomes.

Step 2 — Probability For Single Event

Let’s calculate the probability of rolling a fair six sided dice and getting a 3. The probability (P) is given by P(event) = Number of favorable outcomes / total possible outcomes.

Step 3 — Probability For Multiple Events

When events are independent the probability of both events occurring is the product of their individual probabilities.

Step 4 — Probability For Mutually Exclusive Events

For mutually exclusive events, the probability of either event occurring is the sum of their individual probabilities.

Step 5 — Calculating Conditional Probability

Conditional probability is the probability of an event happening given that another event has already occurred. It is calculated as P(A|B) = P(A and B) / P(B).

Conclusion

Probability is a crucial concept in mathematics and statistics that allows us to quantify uncertainty and make informed decisions. After following this step by step guide and using python code snippets, You now have a better understanding of how to calculate probabilities in various scenarios. Embrace the power of probability to solve real-world problems and analyze data effectively.

--

--

A.I HUB

A.I HUB is a learning platform, where you can learn from all sorts of courses for free we help individuals and youngster by providing quality content.