Skip to content

Probability and Statistics- Probability Theories

  1. Sample Space and Events
    • Sample Space (Ω): The sample space is the set of all possible outcomes of a random experiment. It represents the entire range of possible results. For example, when rolling a six-sided die, the sample space is {1, 2, 3, 4, 5, 6}.
    • Events: An event is a subset of the sample space, representing a specific outcome or a set of outcomes. Events are often denoted by letters (e.g., A, B, C). For example, if we define event A as “rolling an even number,” then A = {2, 4, 6}.
  2. Probability Axioms
    • Probability theory relies on three fundamental axioms that define the rules for assigning probabilities to events:
    • Non-Negativity: Probability values are non-negative; that is, for any event A, P(A) ≥ 0.
    • Normalization: The probability of the entire sample space is 1; that is, P(Ω) = 1.
    • Additivity: For mutually exclusive events A and B (events that cannot both occur simultaneously), the probability of their union is the sum of their individual probabilities; that is, if A ∩ B = ∅ (the empty set), then P(A ∪ B) = P(A) + P(B).
  3. Conditional Probability
    • Conditional probability quantifies the likelihood of an event occurring given that another event has already occurred. It is denoted as P(A | B), read as “the probability of A given B.”
    • The formula for conditional probability is: P(A | B) = P(A ∩ B) / P(B).
    • In words, it’s the probability of both A and B happening divided by the probability of B happening. Conditional probability is essential for modeling situations where events depend on previous outcomes.
  4. Independence of Events
    • Two events, A and B, are considered independent if the occurrence (or non-occurrence) of one event does not affect the probability of the other event. Mathematically, events A and B are independent if:
      • P(A ∩ B) = P(A) * P(B)
  5. Bayes’ Theorem
    • Bayes’ Theorem is a fundamental formula in probability theory that enables the revision of probabilities based on new information or evidence. It is widely used in statistics, machine learning, and various applications. The theorem relates conditional probabilities as follows:
      • P(A | B) = [P(B | A) * P(A)] / P(B)
      • Where:
        • P(A | B) is the posterior probability of event A given evidence B.
        • P(B | A) is the likelihood of evidence B given that event A has occurred.
        • P(A) is the prior probability of event A before considering evidence.
        • P(B) is the total probability of evidence B.
    • Bayes’ Theorem allows us to update our beliefs (the prior probability) based on new data (the likelihood) to obtain a revised probability (the posterior probability). It is particularly useful in fields like Bayesian statistics, machine learning, and medical diagnostics.

      We will try to understand above theories with respect to example given below:
# Hypothetical Dataset: Customer Purchases
data2 = {
    'CustomerID': [1, 2, 3, 4, 5],
    'ProductCategory': ['Electronics', 'Clothing', 'Electronics', 'Toys', 'Clothing'],
    'PurchaseAmount': [200, 50, 300, 75, 80]
}

df2 = pd.DataFrame(data2)
df2

  1. Sample Space and Events:

Sample Space (Ω): In this context, the sample space could be all possible customer purchases in the online store, which would include all combinations of ‘CustomerID’, ‘ProductCategory’, and ‘PurchaseAmount’.


Events: Events in this dataset could be specific subsets of purchases. For example:

Event A: Customers who purchased Electronics.

Event B: Customers who spent more than $100.

Event C: Customers who purchased Clothing and spent more than $50.


2. Probability Axioms

Non-Negativity: Probability values are non-negative. For example, the probability of a customer purchase amount being greater than $0 is always ≥ 0.


Normalization: The total probability of all possible events should sum up to 1. For instance, the probability that a customer’s purchase falls into any one of the defined categories should equal 1.


Additivity: The probability of two mutually exclusive events (e.g., customers purchasing either Electronics or Clothing) can be determined by adding their individual probabilities.


  1. Conditional Probability:

Conditional probability can be applied to this dataset by calculating probabilities based on certain conditions.

For example:


P(Electronics | Spending > $100):

Probability of customers purchasing Electronics given that they spent more than $100.


P(Clothing | Spending > $50):

Probability of customers purchasing Clothing given that they spent more than $50.

  1. Independence of Events:

In this dataset, two events could be considered independent if the probability of one event occurring doesn’t depend on the occurrence of the other. For example, the purchase of Electronics and the purchase of Clothing by a customer may be independent events if one doesn’t influence the other.

  1. Bayes’ Theorem:

Bayes’ Theorem could be used for tasks like customer segmentation or product recommendation. For instance, given certain purchase history (evidence), you could calculate the probability of a customer belonging to a specific product category.


Please note that while these concepts can be applied conceptually to datasets like this, probability theory is more extensively used for making predictions and modeling uncertain events rather than simply describing past data. In practice, real-world applications often involve larger and more complex datasets.

Leave a Reply

Your email address will not be published. Required fields are marked *