# Negative Binomial Distribution Calculator

This calculator computes the probability of achieving a specified number of failures before achieving a certain number of successes, based on the probability of success for a single trial. Input the values to calculate and visualize the distribution.

**P(X = ):**

**P(X < ):**

**P(X ≤ ):**

**P(X > ):**

**P(X ≥ ):**

## Understanding the Negative Binomial Distribution

The **Negative Binomial distribution** represents the probability of observing a certain number of failures before a fixed number of successes, given a constant probability of success on each trial. It's widely used in scenarios where repeated independent trials are conducted, such as quality control or sports analytics.

### Key Components of the Negative Binomial Distribution

**Probability of Success (p):**The probability of achieving success on a single trial.**Number of Successes (r):**The number of successful outcomes required.**Number of Failures (k):**The number of failures observed before the required successes are achieved.

### Negative Binomial Formula

The probability mass function (PMF) for the Negative Binomial distribution is given by the formula:

### Example Calculation

Suppose we want to calculate the probability of observing exactly 4 failures before achieving 3 successes, with a success probability of 0.5.

- \( p = 0.5 \) (probability of success)
- \( k = 4 \) (number of failures)
- \( r = 3 \) (number of successes)

The probability is calculated as follows:

Therefore, the probability of observing exactly 4 failures before 3 successes is approximately 0.1172, or 11.72%.

### Further Reading

Suf is a senior advisor in data science with deep expertise in Natural Language Processing, Complex Networks, and Anomaly Detection. Formerly a postdoctoral research fellow, he applied advanced physics techniques to tackle real-world, data-heavy industry challenges. Before that, he was a particle physicist at the ATLAS Experiment of the Large Hadron Collider. Now, he’s focused on bringing more fun and curiosity to the world of science and research online.