Expected Value of a Discrete Random Variable
Takes comma-separated values and probabilities, checks that both lists match in length and sum to 1, then returns E[X] as the probability-weighted mean.
E[X]
—
Expected value of a discrete random variable
The expected value E[X] of a discrete random variable is what you get when you weight every possible outcome by its probability and add them up: E[X] = Σ xᵢ · P(xᵢ). Think of it as the average you'd settle into if you ran the experiment over and over. One useful property is linearity, E[aX + b] = a·E[X] + b, and E[X + Y] = E[X] + E[Y] holds even when X and Y are dependent. A fair six-sided die, for instance, has E[X] = (1+2+3+4+5+6)/6 = 3.5. The St. Petersburg paradox is the famous edge case: E can run off to infinity, yet no sane person pays infinity to play. Marginal utility theory is what reconciles the two.
Applications
It turns up wherever uncertainty has to be priced: gambling EV analysis (the house edge), insurance premiums (the insurer comes out ahead on average), decisions made under risk, financial modeling of expected return, reinforcement learning that chases reward, actuarial work, portfolio theory, and A/B test design where you estimate the expected lift. Lotteries are the cautionary case, since E usually comes out negative and the average player loses money.
FAQ
Is the expected value always an attainable outcome? No. A die averages 3.5, yet no face actually reads 3.5. E[X] summarizes the distribution; it isn't necessarily a value you can roll.
Why do people play the lottery if E < 0? Risk preferences and utility theory explain it. A cheap ticket buys a tiny shot at a life-changing prize, and there's real value in spending a few days dreaming about it.
Must the probabilities sum to 1? For a valid distribution, yes. If yours don't, normalize them first by dividing each P(xᵢ) by ΣP(xᵢ).
Related Tools
Wheat Yield in Tons per Hectare by Temperature
Estimates wheat yield in tons per hectare considering average temperature.
Extrusion Specific Energy (SEC)
Calculate the extrusion specific energy consumption (SEC), SEC = power ÷ mass throughput, from the screw motor power (kW) and the mass throughput (kg/h). The result, in kWh/kg, is the energy to process each kilogram of polymer, and the main ENERGY-EFFICIENCY indicator of an extruder. Since extrusion melts and pumps plastic largely by VISCOUS heating (screw mechanical energy converted to heat by shear), specific consumption directly reflects how well the screw is doing its job. Typical values are 0.1-0.4 kWh/kg, varying with polymer (each has a melting enthalpy), screw geometry, speed and temperature. An abnormally HIGH SEC signals problems — wrong screw, excessive shear (which can degrade the material), poor temperature setting — and energy waste (the largest part of an extruder's operating cost). A very low SEC may indicate incomplete melting. Monitoring SEC is central to efficiency, quality and cutting cost and emissions in plastics processing. Enter the power consumed and the mass throughput.
Star Distance (Light-years) Calculator
Convert light-years to other units (parsec, AU, km) and compute when light was emitted (Sirius = 8.6 years ago).
Machining Spindle Speed
Calculate the spindle speed (RPM) needed in machining, n = (1000·Vc) ÷ (π·D), from the desired cutting speed Vc (m/min) and the diameter D (mm — workpiece in turning or tool in milling). It is the inverse of the cutting-speed calculation, and the most used on the shop floor: the operator knows the material, picks the recommended cutting speed from tables, and must convert it to the rpm to set on the machine. The relation reveals a key point: for the same cutting speed, SMALLER-diameter parts or tools require HIGHER rpm (and vice versa). So turning a part of varying diameter (facing, tapers) at constant cutting speed requires continuously varying the rpm — done automatically by CNC lathes (G96, constant surface speed), while on conventional lathes the operator adjusts by ranges. Getting rpm right is essential for tool life, finish and safety (excessive rpm on large parts creates dangerous centrifugal forces). Enter the cutting speed and the diameter.
pH/pOH Calculator
Convert between [H⁺], [OH⁻], pH and pOH using pH = -log[H⁺] and pH + pOH = 14.
Clopper-Pearson Binomial CI (Exact)
Computes the exact Clopper-Pearson confidence interval for a binomial proportion. Unlike the Wald formula and even Wilson's, which are approximations, Clopper-Pearson is built directly on the binomial distribution, guaranteeing coverage of at least the nominal level — which is why it's regarded as the reference conservative interval. It's the choice when you need a rigorous guarantee, even with small samples. Enter the successes, the total and the confidence level.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.