Premium problem40. Probability of an Exact Continuous Value

Easy Locked

For a continuous X∼N(μ,σ2)X \sim \mathcal{N}(\mu, \sigma^2), return the tuple (p_exact, p_at_least):

  • p_exact is P(X=x)P(X = x)
  • p_at_least is P(X≥x)P(X \geq x)

The first one catches people out. A continuous distribution assigns probability to intervals, not to points, so the probability of any single exact value is zero; the density at x is not a probability.

Use the error function for the tail: P(X≥x)=12 erfc ⁣(x−μσ2)P(X \geq x) = \tfrac{1}{2}\,\mathrm{erfc}\!\left(\tfrac{x-\mu}{\sigma\sqrt{2}}\right)

Input

mu = 0.0
sigma = 1.0
x = 0.0

Output

(0.0, 0.5)

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)