Exponential Distribution
📈 Exponential Distribution in Python
The Exponential Distribution models the time between independent events that occur at a constant rate.
It is closely related to the Poisson Distribution, which models the number of events in a fixed interval.
✅ 1. Characteristics of Exponential Distribution
-
Continuous distribution
-
Parameter:
scale = 1/λ(λ = event rate) -
Probability Density Function (PDF):
f(x)=1scalee−x/scalefor x≥0f(x) = \frac{1}{\text{scale}} e^{-x/\text{scale}} \quad \text{for } x \ge 0
-
Mean =
scale -
Standard Deviation =
scale
Applications:
-
Time between customer arrivals
-
Lifespan of electronic components
-
Waiting times in queues
✅ 2. Generate Exponential Data Using NumPy
Output (example):
-
Values ≥ 0
-
Skewed distribution
✅ 3. Visualize Exponential Distribution
-
Histogram is right-skewed
-
KDE shows the smooth probability density
✅ 4. Change Scale Parameter
-
Smaller scale → more concentrated near 0
-
Larger scale → more spread out
✅ 5. Mean and Standard Deviation
-
Both should approximately equal the
scaleparameter
🧠Summary Table
| Function | Parameters | Description |
|---|---|---|
np.random.exponential() |
scale, size | Generate exponential random numbers |
scale |
Mean / 1/λ | Average time between events |
size |
Number of samples | Output array size |
🎯 Practice Exercises
-
Simulate waiting times between calls with scale=3 for 1000 samples.
-
Compare distributions with scale=1, 2, 5 in one plot.
-
Compute mean and standard deviation of generated data and compare with scale.
