BL2.ru

Discrete random variable: distribution table, mean, variance and CDF online

Enter the values xᵢ and probabilities pᵢ — the calculator finds the expected value, the variance (two ways), the standard deviation, the mode and the median, writes the CDF F(x) by intervals and draws the probability polygon and the step graph of F(x). One unknown probability may be left empty — it is found from Σp = 1.

Distribution table
ixipi
1
2
3
4
Probabilities as decimals (0.25), fractions (1/4) or percent (25%). You can paste columns from Excel. An empty pᵢ next to a filled xᵢ is the unknown probability.
Table from parameters
X is the number of successes in n independent trials with success probability p: P(X = k) = C(n, k)·pᵏ·qⁿ⁻ᵏ, k = 0…n (n up to 100).
Calculate

What a distribution table is

A discrete random variable X takes separate values x₁, x₂, …, xₙ with probabilities p₁, p₂, …, pₙ. The two-row table of values and probabilities is the distribution table. All probabilities are non-negative and add up to one: Σpᵢ = 1. This condition gives a single missing probability: pₖ = 1 − Σ(the others).

Main characteristics

  • Expected value M(X) = Σxᵢ·pᵢ — the average value over many trials.
  • Variance D(X) = Σ(xᵢ − M)²·pᵢ — the spread around the mean. A handy formula: D(X) = M(X²) − (M(X))², where M(X²) = Σxᵢ²·pᵢ. The calculator uses both ways and they agree.
  • Standard deviation σ(X) = √D(X) — the spread in the units of the variable itself.
  • Mode Mo(X) — the value with the highest probability (there can be several).
  • Median Me(X) — the first xᵢ where the cumulative probability reaches 0.5.

Cumulative distribution function

In Russian textbooks F(x) = P(X < x). For a discrete variable it is a step function: 0 for x ≤ x₁, then a jump of pᵢ at every xᵢ, and 1 for x > xₙ. On the graph the filled dot is the value at xᵢ itself (below the jump), the open circle is the level right after the jump. The probability of an interval: P(a ≤ X < b) = F(b) − F(a).

Standard laws

Binomial: successes in n independent trials, M = np, D = npq. Poisson: rare events, M = D = λ. Geometric: the number of the first success, M = 1/p, D = q/p². The “Table from parameters” buttons build such a series in the table, ready to edit.

Example

X takes the values 0, 1, 2, 3 with probabilities 0.1, 0.3, p₃, 0.2. From Σp = 1: p₃ = 1 − 0.6 = 0.4. M(X) = 0·0.1 + 1·0.3 + 2·0.4 + 3·0.2 = 1.7. M(X²) = 0.3 + 1.6 + 1.8 = 3.7, D(X) = 3.7 − 1.7² = 0.81, σ = 0.9. The mode is 2, the median is 2. P(1 ≤ X < 3) = 0.3 + 0.4 = 0.7.

FAQ

How do I find the missing probability in a distribution table?
All probabilities add up to 1. Leave the cell of the unknown pᵢ empty — the calculator subtracts the sum of the others from one. If the known ones already exceed 1 or two cells are empty, it explains what is wrong.
How do I compute the expected value and variance of a discrete random variable?
M(X) = Σxᵢ·pᵢ. The variance is either D(X) = Σ(xᵢ − M)²·pᵢ by definition or D(X) = M(X²) − (M(X))². The calculator shows both with the numbers substituted and a table of the terms.
Why does my F(x) differ from the textbook answer?
Russian textbooks use F(x) = P(X < x), so at xᵢ the value is the level before the jump. Many other sources use F(x) = P(X ≤ x), and then at the jump points the value is the upper level. The intervals are the same, only the inequality signs at the boundaries differ.
What is the difference between the mode and the median?
The mode is the most probable value, the median is the middle by cumulative probability. For 1, 2, 3 with probabilities 0.2, 0.5, 0.3 both equal 2, but for skewed tables they differ.
How do I set a binomial or Poisson distribution?
Pick the law in the “Table from parameters” block, enter n and p (or λ) and press “Fill the table”. The series appears in the table; you can edit it and get all characteristics and graphs.