## Two-Event Probability Calculator

Calculate and visualize probabilities for events A and B with various conditions.

Note: When entering probabilities, please specify whether the events are independent or dependent:

- For independent events: The probability of both events occurring (\( P(A \cap B) \)) will be calculated as the product of their individual probabilities (\( P(A) \times P(B) \)).
- For dependent events: Please enter the actual joint probability \( P(A \cap B) \) directly, as it may differ from the product of individual probabilities.

## Understanding Two-Event Probabilities

**Basic Probability Definitions:**

\( P(A) \): Probability of event A occurring.

\( P(B) \): Probability of event B occurring.

**Complementary Events:**

\( P(A') \): Probability that A does not occur.

\( P(B') \): Probability that B does not occur.

### Addition Rule

The probability that at least one of A or B occurs is given by the addition rule:

\( P(A \cup B) = P(A) + P(B) - P(A \cap B) \)

This formula accounts for the overlap where both events A and B occur (intersection) to avoid double-counting.

### Multiplication Rule

If events A and B are independent, the probability of both A and B occurring together (intersection) is:

\( P(A \cap B) = P(A) \times P(B) \)

For dependent events, \( P(A \cap B) \) is determined by other given conditions or data on joint probability.

### Conditional Probability

The probability of A occurring given that B has occurred is:

\( P(A|B) = \frac{P(A \cap B)}{P(B)} \)

Similarly, the probability of B occurring given that A has occurred is:

\( P(B|A) = \frac{P(A \cap B)}{P(A)} \)

### Other Relevant Conditions

\( P(A' \cap B') \): Probability that neither A nor B occurs.

\( P(A \setminus B) \): Probability that only A occurs (A occurs without B).

\( P(B \setminus A) \): Probability that only B occurs (B occurs without A).

\( P(A \cap B') \): Probability that A occurs without B.

\( P(A' \cap B) \): Probability that B occurs without A.

\( P(A \cup B') \): Probability that A occurs or B does not occur.

\( P(A' \cup B) \): Probability that A does not occur or B occurs.

### Symmetric Difference (Exclusive OR)

\( P(A \triangle B) \): Probability that either A or B occurs, but not both. This is also known as the symmetric difference:

\( P(A \triangle B) = P(A) + P(B) - 2 \times P(A \cap B) \)

### Complement Rules

\( P((A \cap B)') \): Probability that at least one of A or B does not occur (complement of the intersection).

\( P((A \cup B)') \): Probability that neither A nor B occurs (complement of the union).

## Three-Event Probability Calculator

Calculate probabilities for events A, B, and C with various conditions.

Note: When entering probabilities, please specify whether the events are independent or dependent:

- For independent events: The probability of both events occurring (\( P(A \cap B) \)) will be calculated as the product of their individual probabilities (\( P(A) \times P(B) \)).
- For dependent events: Please enter the actual joint probability \( P(A \cap B) \) directly, as it may differ from the product of individual probabilities.

## Understanding Three-Event Probabilities

**Basic Probability Definitions:**

\( P(A) \): Probability of event A occurring.

\( P(B) \): Probability of event B occurring.

\( P(C) \): Probability of event C occurring.

**Complementary Events:**

\( P(A') \): Probability that A does not occur.

\( P(B') \): Probability that B does not occur.

\( P(C') \): Probability that C does not occur.

\( P(A' \cap B' \cap C') \): Probability that none of A, B, or C occurs.

### Addition Rule for Union

The probability that at least one of A, B, or C occurs is given by:

\( P(A \cup B \cup C) = P(A) + P(B) + P(C) - P(A \cap B) - P(A \cap C) - P(B \cap C) + P(A \cap B \cap C) \)

This formula accounts for all pairwise and three-way intersections to avoid over-counting when all events could happen together.

### Multiplication Rule

If events A, B, and C are independent, the probability of all three events occurring together (intersection) is:

\( P(A \cap B \cap C) = P(A) \times P(B) \times P(C) \)

For dependent events, \( P(A \cap B \cap C) \) would be determined by known conditions or given intersection probabilities.

### Conditional Probabilities

The probability of A occurring given that both B and C have occurred is:

\( P(A|B \cap C) = \frac{P(A \cap B \cap C)}{P(B \cap C)} \)

Conditional probabilities can also be defined for other combinations, depending on the relationships between events.

### Exclusive Occurrences

\( P(A \setminus (B \cup C)) \): Probability that only A occurs (A occurs without B or C).

\( P(B \setminus (A \cup C)) \): Probability that only B occurs (B occurs without A or C).

\( P(C \setminus (A \cup B)) \): Probability that only C occurs (C occurs without A or B).

### Symmetric Difference (Exclusive OR)

\( P((A \triangle B) \triangle C) \): Probability that an odd number of events (either one or three) occurs. This is known as the symmetric difference for three events:

\( P((A \triangle B) \triangle C) = P(A) + P(B) + P(C) - 2 \times (P(A \cap B) + P(A \cap C) + P(B \cap C)) + 3 \times P(A \cap B \cap C) \)

### Other Relevant Conditions

\( P(A \cap B) \): Probability that both A and B occur.

\( P(A \cap C) \): Probability that both A and C occur.

\( P(B \cap C) \): Probability that both B and C occur.

\( P(A \cap B \cap C) \): Probability that all three events occur.

### Complement Rules

\( P((A \cap B \cap C)') \): Probability that at least one of A, B, or C does not occur (complement of the intersection).

\( P((A \cup B \cup C)') \): Probability that none of A, B, or C occurs (complement of the union).

### Special Case: Probability of Exactly One Event Occurring

To calculate the probability that exactly one event occurs, sum the probabilities for each event occurring alone:

\( P(A) \times (1 - P(B)) \times (1 - P(C)) + (1 - P(A)) \times P(B) \times (1 - P(C)) + (1 - P(A)) \times (1 - P(B)) \times P(C) \)

### Special Case: Probability That None Occur

To calculate the probability that none of A, B, or C occur, use the complement of the union:

\( P(\emptyset) = 1 - (P(A) + P(B) + P(C) - P(A) \times P(B) - P(A) \times P(C) - P(B) \times P(C) + P(A) \times P(B) \times P(C)) \)

Suf is a senior advisor in data science with deep expertise in Natural Language Processing, Complex Networks, and Anomaly Detection. Formerly a postdoctoral research fellow, he applied advanced physics techniques to tackle real-world, data-heavy industry challenges. Before that, he was a particle physicist at the ATLAS Experiment of the Large Hadron Collider. Now, he’s focused on bringing more fun and curiosity to the world of science and research online.