Loading content...
The Gaussian distribution, commonly known as the bell curve or normal distribution, is arguably the most important probability distribution in all of statistics and machine learning. It describes the behavior of countless natural phenomena—from human heights and measurement errors to the distribution of intelligent behaviors in neural networks.
At the heart of the Gaussian distribution lies the Probability Density Function (PDF), which quantifies the relative likelihood of a continuous random variable taking on a specific value. For a Gaussian distribution with mean μ (mu) and standard deviation σ (sigma), the PDF at a point x is given by:
$$f(x; \mu, \sigma) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x - \mu}{\sigma}\right)^2}$$
Breaking Down the Formula:
Key Properties:
Your Task: Implement a function that computes the PDF value of a Gaussian distribution at a given point x, given the distribution's mean and standard deviation. Round your result to 5 decimal places for consistent floating-point comparison.
Important Note: The standard deviation (σ) will always be positive. A standard deviation of exactly 0 is mathematically undefined for the Gaussian distribution.
x = 16.0, mean = 15.0, std_dev = 2.040.17342For this Gaussian distribution centered at μ = 15.0 with σ = 2.04:
The point x = 16.0 is less than half a standard deviation from the mean, so the density is relatively high.
x = 0.0, mean = 0.0, std_dev = 1.00.39894This is the standard normal distribution (mean = 0, standard deviation = 1). When x equals the mean:
This is the maximum PDF value for the standard normal distribution, occurring exactly at the mean. The value 1/√(2π) ≈ 0.39894 is a fundamental constant in probability theory.
x = 10.0, mean = 10.0, std_dev = 2.00.19947Evaluating the PDF at the mean of a Gaussian with σ = 2.0:
Note that this maximum PDF value (0.19947) is exactly half of the standard normal's peak (0.39894), because the standard deviation is 2 instead of 1. Larger standard deviations create wider, flatter distributions with lower peak densities.
Constraints