ForHosting KIT · Math

Discrete RV standard deviation

A fair die, with the values 1 to 6 at probability 1/6 each, has a mean of 3.5. Enter your own table of values and probabilities, which must add up to one, and get the mean, second moment, variance and standard deviation. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Values
1, 2, 3, 4, 5, 6
Probabilities
0.1666666667, 0.1666666667, 0.1666666667, 0.1666666667, 0.1666666667, 0.1666666667
You get
N
6
Sum probabilities
1
Mean
3.5
Variance
2.9166666667

The standard deviation of a discrete random variable measures how far typical outcomes sit from the probability-weighted mean when every possible value has an explicit probability. Unlike the ordinary sample standard deviation of a raw data list, this calculator takes two parallel arrays — the finite support values and the matching probabilities — checks that the probabilities form a valid measure that sums to one, and returns the closed-form mean, second moment, variance, and standard deviation. Students use it to check dice and grade tables, game designers weight payoffs by win chances, and analysts convert scenario sheets into a single risk number.

What discrete standard deviation means and how it differs from sample σ

The mean of X is the probability-weighted sum of every value: it is the long-run average you would observe if the experiment were repeated forever under the same measure. Two distributions can share the same mean yet behave very differently: one may put almost all mass near the center while another places large mass on far tails. Variance captures that spread as the expected squared deviation from the mean, equivalently the second moment minus the square of the mean.

Standard deviation is the non-negative square root of variance and restores the original units of the outcomes, which is why homework keys and risk reports usually quote both the mean and the standard deviation side by side. This is not the same object as the sample standard deviation of a raw list of observations. Sample formulas divide by n minus one and treat every point as equally likely; discrete formulas weight each support point by its probability and never apply Bessel correction.

If you only have unweighted measurements, use the ordinary standard deviation tool. If you already have a probability table, this page is the correct closed-form path. Because every quantity is a finite sum of products, the formulas are classical and fully deterministic: the same values and the same probabilities must always produce the same mean, the same variance, and the same standard deviation for automated tests and lesson keys.

How this calculator validates inputs and computes σ in one pass

Call the capability with two required arrays of equal length: values, the finite numeric support points, and probabilities, the weight of each point. After validation, the core walks the support once, accumulating the probability-weighted sum of the values and the probability-weighted sum of their squares. Mean is that first weighted sum; variance is the second moment minus the square of the mean, with a microscopic clamp so floating round-off cannot invent a negative variance for a valid measure; standard deviation is the non-negative square root of variance.

The response also reports n, the observed sum of probabilities, and the second moment so you can audit intermediate steps without re-deriving them.

Practical use, pricing, limits, and when to choose this tool

Use the browser tool when you want an immediate discrete standard deviation while checking a homework answer, sizing a simple game of chance, or explaining risk without installing a statistics package. Results are fully deterministic: the same values and probabilities always yield the same mean, variance, and standard deviation. There is no language model, no external probability service, and no randomness, so the capability is safe to pin in continuous-integration checks and reproducible lesson materials.

Choose this page when your search intent is specifically the standard deviation of a discrete random variable given a probability table. If you need only the expected value narrative or a broader moment bundle framed around E of X, the dedicated expected-value calculator covers that landing. If you have an unweighted data series rather than probabilities, the population and sample standard deviation calculator is the right fit.

Together those tools cover the common SEO paths without forcing one page to answer every statistics query.

Homework and introductory probability labs

Students and graders verify mean, variance, and standard deviation for dice, coins, and custom discrete tables, including the hard rule that probabilities must sum to one.

Games of chance and payoff risk

Designers weight payoffs by win probabilities to obtain expected return and discrete standard deviation before shipping a balance pass or tutorial example.

Scenario and risk dashboards

Analysts convert finite scenario values and probabilities into a stable mean, variance, and standard deviation for reports and automated oracles.

What happens if the probabilities do not sum to one?

The message reports the observed sum so you can renormalize or correct the list. Validation failures are not charged.

How are variance and standard deviation computed?

Variance is E[X²] minus (E[X])² from a single pass over the support. Standard deviation is the square root of that variance, always non-negative for a valid probability measure.

Is the discrete random variable standard deviation calculator free?

The browser tool runs free on your device.

Does this simulate random samples from the distribution?

No. It evaluates the closed-form discrete moments deterministically. The same values and probabilities always return the same mean, variance, and standard deviation.

How is this different from the standard deviation of a list of data?

Here each value is weighted by its probability and there is no n minus one correction. A plain list treats every observation as equally likely; if you only have unweighted measurements, use an ordinary standard deviation calculator instead.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/std-dev-discrete-rv

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/std-dev-discrete-rv \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":[1,2,3,4,5,6],"probabilities":[0.16666666666666666,0.16666666666666666,0.16666666666666666,0.16666666666666666,0.16666666666666666,0.1666666666666667]}'
{
  "values": [
    1,
    2,
    3,
    4,
    5,
    6
  ],
  "probabilities": [
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.16666666666666666,
    0.1666666666666667
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.std_dev_discrete_rv",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The arithmetic is fully deterministic, runs free in your browser, and is available over the API at $0.002 per successful request. Lists that do not sum to one are rejected with a clear invalid_input error so broken models never produce silent nonsense spreads.

What discrete standard deviation means and how it differs from sample σ

A discrete random variable X is fully described by a finite list of possible values x_one through x_n together with probabilities p_one through p_n that are non-negative and sum exactly to one.

How this calculator validates inputs and computes σ in one pass

The engine also accepts the aliases outcomes and x for values, and probs and p for probabilities, so scripts that already speak in those terms do not need a rename step. Validation rejects missing fields, empty arrays, mismatched lengths, non-finite numbers, negative probabilities, probabilities above one, and any list whose sum is not one within a tiny floating tolerance, all with invalid_input and without charging balance. Accepted lists keep the loop bounded for Worker isolates: up to ten thousand support points cover common classroom and business examples while still finishing quickly on edge runtimes.

Practical use, pricing, limits, and when to choose this tool

Each successful request is one billable item at $0.002; failed validation does not consume balance. Wire the endpoint into decision-theory tutorials, fair-game checks, portfolio scenario sheets, or coding-interview sandboxes where you already prefer closed-form moment arithmetic over approximate simulation histograms that never quite land on the same spread twice.

How do I compute the standard deviation of a discrete random variable?

Send JSON with values (array of numbers) and probabilities (matching array of weights that sum to 1) to stat.std_dev_discrete_rv. The response returns standard_deviation, variance, mean, and second_moment.

Read the full KIT documentation →