JESUS CHRIST IS THE ONLY TRUE GOD
Math calculator

Random Variable Calculator

Calculate expectation, variance, and standard deviation of a discrete random variable.

Your calculationPrivate in your browser

How to use the random variable calculator

  1. Prepare the values for this calculation

    Calculate expectation, variance, and standard deviation of a discrete random variable. Use the formula below to check that it answers your question. Read the input units before transferring figures from a statement, measurement or dataset.

  2. Enter and check each input

    • Possible values: use the same separators and value order as the example in the input table. Replace the example data with your own complete dataset.
    • Probabilities: use the same separators and value order as the example in the input table. Replace the example data with your own complete dataset.

    The input table gives a complete example. Keep units and time periods consistent across related fields.

  3. Calculate and resolve any input error

    Choose Calculate after entering the values. Changes also update the answer after a short pause. If an error appears, follow its message, correct the field and calculate again. Reset restores the example values.

  4. Interpret the answer

    Read Expected value and the output limits. This is a sample generated during calculation; a new calculation may produce a different result. The worked example illustrates the output format rather than a value you must reproduce.

  5. Compare and keep a useful result

    The result diagram shows the inputs, method and output. A numeric chart is shown only when the calculation supports a meaningful numeric relationship.

    Use Copy result or Download CSV to keep the answer. Share tool shares the page address without placing your input values in the URL. Recheck inputs and assumptions before using the result for a decision.

Random Variable Calculator formula

E[X]=Σxᵢpᵢ; Var(X)=Σ(xᵢ−E[X])²pᵢ.

Inputs and units

Inputs and example values for Random Variable Calculator
InputFormat / rangeExample
Possible valuesText / numeric list0,1,2
ProbabilitiesText / numeric list0.25,0.5,0.25

Worked example

Illustrative generated sample. Your output may differ; this value is not a recommended password or a prediction.

Using the example inputs above, the expected value is 1.

Expected value
1
Variance
0.5
Standard deviation
0.707106781187

Results and assumptions

The output uses the expected value convention and formula shown above. Match the entered units and source assumptions when comparing results.

Fix an input or unexpected result

A different generated sample is expected. Password and UUID generation require secure browser randomness; if it is unavailable, use a current browser on HTTPS. Never use a deterministic pseudo-random sequence as a password.

If a discrepancy remains, report the calculator issue with the page address, non-sensitive example inputs, actual result, expected result and a reference for your calculation.