2024-11-17

Slide 1: What is Probability?

Probability measures the likelihood of an event occurring. It is written as a number between 0 and 1.

Formula:

\[P(E) = \frac{\text{Number of favorable outcomes}}{\text{Total number of possible outcomes}}\]

Example:

  • Selecting Ace from a Deck: Since there are four aces(heart, spade, diamond, club) in a single deck of cards(52), the probability: \[P(A) = \frac{4}{52}\]

Slide 2: Three Types of Probability

  1. Theoretical Probability:
    • Based on known outcomes (e.g., rolling dice, flipping a coin).
  2. Empirical Probability:
    • Based on observed data.
  3. Subjective Probability:
    • Based on personal judgment or experience.

Slide 3: Law of Total Probability

The Law of Total Probability states: \[ P(A) = \sum P(A \cap B_i) \] \(P\) : Probability

\(A\) : Any Event

\(B_i\) : Event

Slide 4: Example of Total Probability

A company receives essential parts from two different suppliers: - Supplier 1 delivers 80% of parts; defect rate is 3%. - Supplier 2 delivers 20% of parts; defect rate is 5%.

The probability that a randomly chosen part is defective:

# Given probabilities
pS1 <- 0.8   # Supplier 1 probability
pS2 <- 0.2   # Supplier 2 probability
pD_given_S1 <- 0.03  # Defect rate for Supplier 1
pD_given_S2 <- 0.05  # Defect rate for Supplier 2
# Total probability of defect
pDefective <- pS1 * pD_given_S1 + pS2 * pD_given_S2
pDefective
## [1] 0.034

Slide 5: Visualization of Slide 4

Slide 6: Conditional Probability

The probability of (A) given (B): \[P(A | B) = \frac{P(A \cap B)}{P(B)}\]

# Given probabilities
pMath <- 0.6
pPhysics_given_Math <- 0.7
# Joint probability
pMath_and_Physics <- pMath * pPhysics_given_Math
pMath_and_Physics
## [1] 0.42

Slide 7: Visualization of Joint Probability

Slide 8: Bayes’ Theorem

Bayes’ Theorem: \[P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)}\] where

  P(A)= Probability of A occurring

  P(B)= Probability of B occurring
  
  P(A | B) = Probability of A given B
  
  P(B | A) = Probability of B given A
  

Slide 9: Example of Bayes’ Theorem

When a test detects a disease 95% when disease is present and 5% false positive rate, what is the probability of having the disease given a positive result?

# Given probabilities
pD <- 0.01  # Probability of having the disease
pPositive_g_D <- 0.95  # True positive rate
pPositive_g_NoD <- 0.05  # False positive rate
pNoD <- 1 - pD  # Probability of not having the disease

# Total probability of positive test
pPositive <- pPositive_g_D * pD + pPositive_g_NoD * pNoD

# Bayes' Theorem
pDisease_given_Positive <- (pPositive_g_D * pD) / pPositive
pDisease_given_Positive
## [1] 0.1610169

Slide 10: Visualization of Slide 9

Slide 11: Conclusion

Key Takeaways:

1.  Probability is foundational in statistics and decision-making.
2.  Use tools like conditional probability 
    and Bayes’ Theorem to model  uncertainty.
3.  Visualizations (e.g., distributions) aid understanding of probabilities.