PMF/PDF Calculator

Distribution Visualization

Bernoulli Distribution

The Bernoulli distribution is a discrete probability distribution of a random variable which takes the value 1 with probability p and the value 0 with probability q = 1 - p.

\[ P(X = k) = p^k (1-p)^{1-k}, \quad k \in \{0, 1\} \]

Properties:

  • Support: \(k \in \{0, 1\}\)
  • Mean: \(E[X] = p\)
  • Variance: \(Var[X] = p(1-p)\)

Understanding PMF and PDF

Probability Mass Function (PMF)

The Probability Mass Function (PMF) gives the probability that a discrete random variable X is exactly equal to some value x.

\[ P(X = x) = P_X(x) \]

Properties of PMF:

  • Non-negative: \(P_X(x) \geq 0\) for all \(x\)
  • Sum to 1: \(\sum_{x \in \text{Range}(X)} P_X(x) = 1\)
  • PMF is defined only for discrete random variables

Example: Bernoulli PMF

For a fair coin toss where X = 1 represents "heads" and X = 0 represents "tails":

\[ P(X = 1) = p = 0.5 \] \[ P(X = 0) = 1-p = 0.5 \]

Probability Density Function (PDF)

The Probability Density Function (PDF) describes the relative likelihood that a continuous random variable X takes on a given value x.

\[ f_X(x) \]

Unlike the PMF, the PDF does not directly give probabilities. Instead, the probability that X takes a value in an interval [a, b] is given by:

\[ P(a \leq X \leq b) = \int_a^b f_X(x) \, dx \]

Properties of PDF:

  • Non-negative: \(f_X(x) \geq 0\) for all \(x\)
  • Integrates to 1: \(\int_{-\infty}^{\infty} f_X(x) \, dx = 1\)
  • PDF is defined only for continuous random variables

Example: Uniform PDF

For a random variable X that is uniformly distributed between a and b:

\[ f_X(x) = \begin{cases} \frac{1}{b-a}, & \text{if } a \leq x \leq b \\ 0, & \text{otherwise} \end{cases} \]

Key Differences: PMF vs. PDF

Property Probability Mass Function (PMF) Probability Density Function (PDF)
Type of Random Variable Discrete Continuous
Values Direct probabilities Density values (not probabilities)
Calculation of P(X = x) P(X = x) = PMF(x) P(X = x) = 0 (for any single point)
Range Probabilities P(a ≤ X ≤ b) = ∑x∈[a,b] PMF(x) P(a ≤ X ≤ b) = ∫ab PDF(x) dx
Sum/Integral all x PMF(x) = 1 -∞ PDF(x) dx = 1

Applications of PMF and PDF

Finance & Risk Analysis

PMFs and PDFs are used to model financial returns, assess investment risks, and price options. The normal distribution's PDF is often used to model stock price changes.

Medical Research

PMFs like the binomial distribution model success/failure in clinical trials, while PDFs like the normal distribution describe the distribution of physical measurements in a population.

Telecommunications

The Poisson PMF models call arrivals at a call center, while exponential PDFs model the time between consecutive calls or data packet arrivals in networks.

Engineering & Reliability

PDFs like the exponential or Weibull distribution model component lifetimes, while PMFs help analyze discrete failure counts in complex systems.

Test Your Knowledge

Quick Quiz: PMF & PDF

1. Which of the following statements is true about the probability mass function (PMF)?

A. It is used for continuous random variables
B. It can have values greater than 1
C. It gives the probability that a discrete random variable equals a specific value
D. The sum of all PMF values can be any number

2. For a continuous random variable X, what is P(X = a) where a is any specific value?

A. Equal to the PDF at point a
B. Always 0
C. Equal to the CDF at point a
D. Depends on the specific distribution