The expected value of a random variable, written E(X), is the weighted average of all possible outcomes where each outcome is weighted by its probability. It tells you the long-run average result you would expect if you repeated the same random experiment an infinite number of times. Expected value is a foundational concept in probability theory, decision-making, finance, and game theory. When you buy insurance, invest in shares, or decide whether to accept a bet, you are (whether you realise it or not) comparing expected values. The formula is simple: E(X) equals the sum of each possible outcome multiplied by its probability. For a fair six-sided die, the outcomes are 1, 2, 3, 4, 5, and 6, each with probability 1/6, giving E(X) = 3.50. You can also calculate the variance of the distribution, which measures how spread out the outcomes are around the expected value. Variance equals E(X squared) minus [E(X)] squared. Standard deviation is the square root of variance and is expressed in the same units as the outcomes. This calculator accepts comma-separated outcomes and their corresponding probabilities. Probabilities should be entered as decimal fractions that sum to 1 (for example, 1/6 is entered as 0.1667). If you have equal probabilities, you can enter the same value for each. The calculator checks whether the probabilities sum to 1 and warns you if they do not. You get E(X), variance, standard deviation, probability sum, and the number of outcomes. Useful for students, statisticians, gamblers analysing odds, and anyone weighing up options with uncertain payoffs.
The calculator parses the outcomes and probabilities as parallel comma-separated lists. It takes the shorter length as n. E(X) is the sum of xi times pi for all i. E(X squared) is the sum of xi squared times pi. Variance is E(X squared) minus [E(X)] squared. Standard deviation is the square root of variance. The probability sum is displayed so you can verify the distribution is valid. If the sum differs from 1 by more than 0.01, the result is flagged as potentially invalid.
For a fair six-sided die, outcomes are 1, 2, 3, 4, 5, 6 each with probability entered as 0.1667. E(X) = (1 x 0.1667) + (2 x 0.1667) + ... + (6 x 0.1667) = 21 x 0.1667 = 3.5007 ≈ 3.50. Using the stored probabilities, E(X squared) = (1 + 4 + 9 + 16 + 25 + 36) x 0.1667 = 15.1697. Variance = 15.1697 - (3.5007) squared = 15.1697 - 12.2549 = 2.9148. Standard deviation = sqrt(2.9148) = 1.7073. These match the default values pre-filled above.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.