Negative Binomial Distribution Visualization with Probability Bars
Loading the math board and drawing, please wait…
This GeoGebra example dynamically visualizes the probability mass function of the negative binomial distribution, showing the distribution of the number of trials needed to achieve a fixed number of successes. Core mathematical concepts include the negative binomial distribution, probability mass function, expectation and variance, and its relationship to the binomial and geometric distributions. Construction highlights: using Sequence to generate trial counts, Max and CountIf to count qualifying trials, building probability list1 and height list heights, then plotting bar vertices via Points1 and Points2, with sliders n, p, t to adjust parameters in real time, and text1 to display probability values. Suitable for high school to undergraduate probability and statistics courses, this example helps students intuitively grasp how discrete distributions change with parameters and how the negative binomial relates to binomial and geometric distributions.
GeoGebra Commands & Parameters
Sequence(Pascal[n, p, i, false], i, 1, 2000, 1) → probSequence(i, i, 1, 2000, 1) → numbersSequence(RandomDiscrete[numbers, prob], i, 1, t, 1) → list1Sequence(CountIf[x ≟ i, list1], i, 0, 2000, 1) → heightsSequence((i - 0.5, Element[heights, i + 1]), i, 0, 2000, 1) → Points1Sequence((i + 0.5, Element[heights, i + 1]), i, 0, 2000, 1) → Points2Max(Sequence[y(Element[Points1, i]), i, 1, Length[Points1]]) → hMax(Sequence[Element[list1, i], i, 1, Length[list1]]) → wCountIf(a ≤ x ∧ x ≤ b, list1) → cSequence(Polygon[(i - 0.9, 0), (i + 0.5, 0), Element[Points2, i + 1], Element[Points1, i + 1]], i, 0, 2000, 1) → list2
AI Drawing Prompt Reference
Create a visualization of the negative binomial distribution's probability mass function. The horizontal axis represents the number of trials from 0 to 2000, and the vertical axis shows the frequency of each trial count. The graph consists of a series of vertical bars, each centered at an integer, with width 1, and height proportional to the observed frequency from random sampling. Bars are formed by connecting bottom and top vertices, with top vertices determined by frequency data. Include three sliders to adjust the number of successes, success probability, and sample size, causing bar heights to update dynamically. A text label displays the current probability value. The overall graph illustrates how the discrete distribution changes with parameters.
The prompt above was compiled from the original drawing commands and is for reference only.