Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
NegativeBinomialDistribution
  • See Also
    • BinomialDistribution
    • GeometricDistribution
    • BernoulliDistribution
    • PascalDistribution
    • LogSeriesDistribution
    • BetaNegativeBinomialDistribution
  • Related Guides
    • Discrete Univariate Distributions
    • Urn Model Distributions
    • Distributions Used in Actuarial Science
  • Tech Notes
    • Discrete Distributions
    • See Also
      • BinomialDistribution
      • GeometricDistribution
      • BernoulliDistribution
      • PascalDistribution
      • LogSeriesDistribution
      • BetaNegativeBinomialDistribution
    • Related Guides
      • Discrete Univariate Distributions
      • Urn Model Distributions
      • Distributions Used in Actuarial Science
    • Tech Notes
      • Discrete Distributions

NegativeBinomialDistribution[n,p]

represents a negative binomial distribution with parameters n and p.

Details
Details and Options Details and Options
Background & Context
Examples  
Basic Examples  
Scope  
Applications  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • BinomialDistribution
    • GeometricDistribution
    • BernoulliDistribution
    • PascalDistribution
    • LogSeriesDistribution
    • BetaNegativeBinomialDistribution
  • Related Guides
    • Discrete Univariate Distributions
    • Urn Model Distributions
    • Distributions Used in Actuarial Science
  • Tech Notes
    • Discrete Distributions
    • See Also
      • BinomialDistribution
      • GeometricDistribution
      • BernoulliDistribution
      • PascalDistribution
      • LogSeriesDistribution
      • BetaNegativeBinomialDistribution
    • Related Guides
      • Discrete Univariate Distributions
      • Urn Model Distributions
      • Distributions Used in Actuarial Science
    • Tech Notes
      • Discrete Distributions

NegativeBinomialDistribution

NegativeBinomialDistribution[n,p]

represents a negative binomial distribution with parameters n and p.

Details

  • The probability for value in a negative binomial distribution is for non-negative integers, and is zero otherwise. »
  • NegativeBinomialDistribution allows n to be any non-negative real number and p to be any positive real number less than or equal to 1.
  • If n is a positive integer, NegativeBinomialDistribution[n,p] gives the distribution of the number of failures in a sequence of trials with success probability p before n successes occur.
  • NegativeBinomialDistribution for noninteger parameter n is also known as Pólya distribution.
  • NegativeBinomialDistribution allows n and p to be a dimensionless quantity. »
  • NegativeBinomialDistribution can be used with such functions as Mean, CDF, and RandomVariate. »

Background & Context

  • NegativeBinomialDistribution[n,p] represents a discrete statistical distribution defined for integer values and determined by the positive real parameters n and p (where ). The negative binomial distribution has a probability density function (PDF) that is discrete and unimodal. Depending on context, the Pascal and Pólya–Aeppli distributions (PascalDistribution and PolyaAeppliDistribution, respectively) may each be referred to as negative binomial distributions, though each is distinct from the negative binomial distribution discussed above.
  • When n is a positive integer, NegativeBinomialDistribution[n,p] gives the distribution of the number of failures in a sequence of trials with success probability p before n successes occur. This is closely related to the Pascal distribution (PascalDistribution) and dates back to Pascal's work in the 17^(th)century. For noninteger parameter n, the negative binomial distribution is also known as the Pólya distribution. For general n, several distributions dating to the 1940s have been proposed and referred to as negative binomial distributions, though the above-stated NegativeBinomialDistribution (which was proposed considerably later) is the most widely used in modern applications. The negative binomial distribution has played an increasingly significant role in probability and stochastics since the 1990s and has also been used to model phenomena including accident statistics, birth-and-death processes, consumer expenditure, biometrics, and retail inventory management.
  • RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a negative binomial distribution. Distributed[x,NegativeBinomialDistribution[n,p]] , written more concisely as xNegativeBinomialDistribution[n,p], can be used to assert that a random variable x is distributed according to a negative binomial distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
  • The probability density and cumulative distribution functions for negative binomial distributions may be given using PDF[NegativeBinomialDistribution[n,p]] and CDF[NegativeBinomialDistribution[n,p]]. The mean, median, variance, covariance, raw moments, and central moments may be computed using Mean, Median, Variance, Covariance, Moment, and CentralMoment, respectively.
  • DistributionFitTest can be used to test if a given dataset is consistent with a negative binomial distribution, EstimatedDistribution to estimate a negative binomial parametric distribution from given data, and FindDistributionParameters to fit data to a negative binomial distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic negative binomial distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic negative binomial distribution.
  • TransformedDistribution can be used to represent a transformed negative binomial distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a negative binomial distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving negative binomial distributions.
  • NegativeBinomialDistribution is related to a number of other distributions. It is a univariate case of the more general NegativeMultinomialDistribution in the sense that the PDF of NegativeBinomialDistribution[n,p] with respect to a variable x is precisely the same as that of NegativeMultinomialDistribution[n,{1-p}] written in terms of the vector {x}. NegativeBinomialDistribution[1,p] is identically GeometricDistribution[p], while NegativeBinomialDistribution can be obtained as a transformed distribution (TransformedDistribution) of both PascalDistribution and GeometricDistribution. Using a parameter mixture distribution (ParameterMixtureDistribution), NegativeBinomialDistribution can be realized from PoissonDistribution, GammaDistribution, BetaDistribution, and BetaPrimeDistribution, while also being related to CompoundPoissonDistribution via more complex transformations. NegativeBinomialDistribution is also related to BinomialDistribution, MultinomialDistribution, BernoulliDistribution, BetaBinomialDistribution, HypergeometricDistribution, and PoissonDistribution.

Examples

open all close all

Basic Examples  (3)

Probability mass function:

Cumulative distribution function:

Mean and variance:

Scope  (8)

Generate a sample of pseudorandom numbers from a negative binomial distribution:

Compare its histogram to the PDF:

Distribution parameters estimation:

Estimate the distribution parameters from sample data:

Compare the density histogram of the sample with the PDF of the estimated distribution:

Skewness:

For large n, the distribution becomes more symmetric:

Limiting values:

Kurtosis:

For large values of n, kurtosis gets close to the kurtosis of the standard NormalDistribution:

Limiting values:

Different moments with closed forms as functions of parameters:

Moment:

CentralMoment:

FactorialMoment:

Closed form for symbolic order:

Cumulant:

Hazard function:

Quantile function:

Use dimensionless Quantity to define NegativeBinomialDistribution:

Applications  (7)

The CDF of NegativeBinomialDistribution is an example of a right-continuous function:

The number of tails before getting 4 heads with a fair coin:

Plot the distribution of tail counts:

Compute the probability of getting at least 6 tails before getting 4 heads:

Compute the expected number of tails before getting 4 heads:

A coin was flipped 10 times and the 8^(th) head occurred at the 10^(th) flip. Find the probability of such an event if the coin is fair:

Assuming the coin may not be fair, find the most likely value for :

A basketball player shoots free throws until he hits 4 of them. His probability of scoring in any one of them is 0.7. Simulate the process:

Find the number of shots the player is expected to shoot:

Find the probability that the player requires 4 shots:

Assume the probability of fouling for each minute interval is 0.1 independently. Simulate the fouling process for 30 minutes:

A basketball player fouls out after 6 fouls. Find the expected playing time until foul out:

A shipment of products is inspected in batches of 60 and each batch is inspected up to rejection when the 10^(th) defective item is found. Find the probability of a batch being rejected if 20% of the items are defective:

Alternatively, compute the same result by truncating the distribution:

Simulate the number of non-defective products in rejected batches:

Illustrate the ratio in each batch:

Find the average ratio of non-defective to defective products in rejected batches:

A data stream containing data packets is repeatedly sent without order information. Find the distribution of the number of unordered data stream arrivals until all the packets arrive in the right order for the second time:

Find the probability that packets will arrive the second time in the correct order after at most 18 fails:

Find the average number of fails until the second ordered data stream:

Simulate the number of fails until the second ordered data stream:

Properties & Relations  (11)

NegativeBinomialDistribution[n,p] converges to a normal distribution when n->∞:

Negative binomial distribution is closed under addition:

The limit of negative binomial distribution when the mean is fixed is PoissonDistribution:

Relationships to other distributions:

Negative binomial distribution simplifies to GeometricDistribution:

Negative binomial distribution and PascalDistribution differ by a shift:

Sum of n independent variables from GeometricDistribution has negative binomial distribution:

General proof for an arbitrary number of sum components:

A univariate NegativeMultinomialDistribution is a negative binomial distribution:

NegativeBinomialDistribution is a mixture of PoissonDistribution and GammaDistribution:

BetaNegativeBinomialDistribution is a mixture of negative binomial distribution and BetaDistribution:

A limit of zero-truncated NegativeBinomialDistribution is a LogSeriesDistribution:

Possible Issues  (2)

NegativeBinomialDistribution is not defined when n is non-positive:

NegativeBinomialDistribution is not defined when p is not between zero and one:

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

See Also

BinomialDistribution  GeometricDistribution  BernoulliDistribution  PascalDistribution  LogSeriesDistribution  BetaNegativeBinomialDistribution

Tech Notes

    ▪
  • Discrete Distributions

Related Guides

    ▪
  • Discrete Univariate Distributions
  • ▪
  • Urn Model Distributions
  • ▪
  • Distributions Used in Actuarial Science

History

Introduced in 2007 (6.0) | Updated in 2016 (10.4)

Wolfram Research (2007), NegativeBinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html (updated 2016).

Text

Wolfram Research (2007), NegativeBinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html (updated 2016).

CMS

Wolfram Language. 2007. "NegativeBinomialDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html.

APA

Wolfram Language. (2007). NegativeBinomialDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html

BibTeX

@misc{reference.wolfram_2025_negativebinomialdistribution, author="Wolfram Research", title="{NegativeBinomialDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html}", note=[Accessed: 01-May-2026]}

BibLaTeX

@online{reference.wolfram_2025_negativebinomialdistribution, organization={Wolfram Research}, title={NegativeBinomialDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html}, note=[Accessed: 01-May-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English