Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Discrete Expected Value Visualization



Expected Value of Discrete Distribution

0.00.20.40.60.810.1000.1020.1500.3030.2500.7540.3001.2050.1500.7560.0500.30E[X] = 3.400Value (x)Probability P(X = x)
Formula: E[X] = Σ x · P(X = x)
Expected Value: 3.400

Adjust Probabilities:

0.100
Contribution: 0.100
0.150
Contribution: 0.300
0.250
Contribution: 0.750
0.300
Contribution: 1.200
0.150
Contribution: 0.750
0.050
Contribution: 0.300

Understanding Expected Value:

The expected value is the weighted average of all possible values, where each value is weighted by its probability. The red dashed line shows where the expected value falls on the x-axis.

Each bar shows the probability of that outcome, and the number inside shows that value's contribution to the expected value (x · P(X = x)).





Calculating Expected Value for Discrete Distributions

This tool visualizes expected value for a discrete random variable with six possible outcomes. Adjust the probability sliders to change P(X = x) for each value. The bar chart shows the probability mass function, with each bar's contribution to E[X] displayed inside. The red dashed line marks the expected value.



Getting Started with Discrete Expected Value

This tool visualizes expected value for a discrete random variable with six possible outcomes (1 through 6). The bar chart displays the probability mass function (PMF), showing P(X = x) for each value.

The left side shows the visualization: vertical bars representing probabilities, with the expected value E[X] marked by a red dashed line. The right side provides interactive controls and calculation details.

Adjust the probability sliders to change the distribution shape. The tool automatically normalizes probabilities to sum to 1, so you can focus on relative weights without constraint management. Watch E[X] move as probabilities shift.

Reading the Bar Chart

Each bar represents one possible outcome:

• Bar height shows P(X = x), the probability of that value
• The probability value appears above each bar (e.g., 0.250)
• The number inside each bar shows x · P(X = x), that value's contribution to E[X]
• The x-axis shows outcome values (1 through 6)
• The y-axis shows probability from 0 to approximately 0.8

Grid lines help read probability values accurately. The left axis labels show 0.0, 0.2, 0.4, 0.6, 0.8 for reference.

Higher bars indicate more probable outcomes. The sum of all bar heights equals 1.0 (total probability). Values with larger bars contribute more to E[X] simply because they occur more often.

Understanding Contributions

The number inside each bar shows that outcome's contribution to expected value:

Contributioni=xiP(X=xi)\text{Contribution}_i = x_i \cdot P(X = x_i)


Expected value equals the sum of all contributions:

E[X]=i=16xiP(X=xi)E[X] = \sum_{i=1}^{6} x_i \cdot P(X = x_i)


For example, if P(X = 4) = 0.300, the contribution from value 4 is:
• 4 × 0.300 = 1.200

This contribution appears inside the bar at x = 4. The expected value sums all six contributions.

Notice that both the outcome value and its probability matter. A high value with low probability may contribute less than a moderate value with high probability.

Using the Probability Sliders

Six sliders in the right panel control individual probabilities:

• Each slider sets the relative probability for its value (P(X = 1) through P(X = 6))
• Drag any slider to increase or decrease that outcome's probability
• The tool automatically normalizes so all probabilities sum to 1
• The actual probability appears below each slider
• The contribution to E[X] also displays

Because of automatic normalization, increasing one probability decreases others proportionally. This maintains a valid probability distribution at all times.

Try these experiments:
• Set one slider to maximum—that value dominates E[X]
• Set sliders to create a uniform distribution—E[X] becomes 3.5
• Concentrate probability on low values—E[X] shifts left
• Concentrate probability on high values—E[X] shifts right

The Expected Value Indicator

The red dashed vertical line marks E[X] on the bar chart:

• Position shows E[X] on the x-axis scale
• The label displays the exact value (e.g., "E[X] = 3.267")
• Line moves in real-time as you adjust sliders

Notice that E[X] typically falls between the bars, not on them. For a fair die, E[X] = 3.5, which is not a possible outcome. This illustrates that expected value is a theoretical average, not an observable result.

The E[X] line helps visualize the distribution's "center of mass." It balances the probability-weighted outcomes, settling where the distribution would balance if bars were physical weights.

The Formula Display

The formula panel shows:

E[X]=xP(X=x)E[X] = \sum x \cdot P(X = x)


This is the defining formula for discrete expected value. Each outcome x is multiplied by its probability P(X = x), and all products are summed.

The panel displays:
• The symbolic formula as a reminder
• The current calculated E[X] value in red

For a discrete random variable, expected value always exists and equals this finite sum (assuming finite outcomes). The formula generalizes to infinite discrete distributions and continuous distributions with appropriate summation or integration.

Understanding this formula is essential for probability theory, statistics, and applications in decision-making under uncertainty.

Expected Value Properties

This visualization demonstrates several key properties of expected value:

Linearity: E[X] responds proportionally to probability changes. Doubling a value's probability doubles its contribution.

Bounds: E[X] always falls between the minimum and maximum possible values. For outcomes 1-6, E[X] is always between 1 and 6.

Center of mass: E[X] represents where the distribution balances. Concentrating probability shifts the balance point.

Not necessarily observable: E[X] = 3.5 for a fair die, but you cannot roll 3.5. Expected value is theoretical.

Sensitivity to tails: Extreme values (1 and 6) can strongly influence E[X] if given high probability, even though middle values are often more probable.

The variance measures how spread out values are around E[X]—a complementary measure to expected value.

Related Tools and Concepts

This discrete visualization connects to other probability concepts and tools:

Theory Pages:

Expected Value covers complete theory and formulas

Variance measures spread around E[X]

Random Variables explains discrete and continuous types

Probability Distributions covers common distributions

Other Visualizations:

Weighted Expected Value shows the "pulling weights" metaphor

Variance Visualizer shows spread around the mean

Distribution Visualizers display PMFs and CDFs

Calculators:

Expected Value Calculators compute E[X] for various inputs

Discrete Distribution Calculators include expected value for specific distributions