StatSolver Logo StatSolver

Discrete Probability Calculator

1. Define Dimensions

2. Input Probabilities

Enter values for P(X,Y).

Total Probability: 0.00

3. Calculate

Σ How I Analyze Joint Probability

In my probability course I encountered a difficult problem that required looking at two variables at the same time. I was analyzing a software program that had two different modules. I needed to track the number of errors in Module 1 (variable X) versus the number of errors in Module 2 (variable Y). That assignment taught me that looking at one variable in isolation often hides the real story. I built this calculator to handle those complex "X and Y" scenarios where you need to check if two events are truly independent or if they influence each other. For example I had to calculate if a bug in the first module made it more likely to find a bug in the second module.

Step-by-Step Instructions:

  1. Set your grid size - Enter the number of rows (X values) and columns (Y values), then click "Generate"
  2. Define your variables - Fill in the X and Y value headers in the grid
  3. Enter probabilities - Fill in each cell with P(X,Y). Use decimals (0.25) or fractions (1/4)
  4. Verify your sum - Make sure all probabilities add up to exactly 1.0
  5. Calculate - Click "CALCULATE RESULTS" to see marginal distributions, covariance, and correlation

Joint distribution guide

How to read and validate a joint probability table

A joint probability distribution describes two discrete random variables at the same time. Each cell is the probability of one specific pair of outcomes, written as P(X = x, Y = y). The calculator turns that table into marginal distributions, expected values, covariance, correlation, conditional probabilities, and an independence check.

Requirements and assumptions

  • Every cell must be between 0 and 1.
  • All cells together must sum to 1.
  • Row and column labels must represent the numerical values taken by X and Y.
  • The table must include every outcome that has a nonzero probability.

If the total is below 1, an outcome is missing. If it is above 1, the entries cannot describe a valid probability model. StatSolver checks this before calculating any summary.

Marginals, conditionals, and independence

A marginal distribution collapses one dimension. Add across a row to obtain P(X = x), or down a column to obtain P(Y = y). A conditional probability narrows the model after an outcome is known: P(Y = y | X = x) = P(X = x, Y = y) / P(X = x).

X and Y are independent only when P(X = x, Y = y) = P(X = x)P(Y = y) for every pair—not merely for one convenient cell. A single mismatch is enough to establish dependence.

Worked 2 × 2 example

Suppose the four probabilities for (X,Y) = (0,0), (0,1), (1,0), and (1,1) are 0.4, 0.1, 0.2, and 0.3. They sum to 1. The marginals are P(X = 1) = 0.5 and P(Y = 1) = 0.4.

Independence would require P(X = 1, Y = 1) = 0.5 × 0.4 = 0.2, but the table gives 0.3. The variables are therefore dependent. Here E[XY] = 0.3, E[X]E[Y] = 0.2, so the covariance is 0.1 and the correlation is approximately 0.4082.

How to interpret the output

Covariance indicates the direction of linear co-movement, while correlation rescales that relationship to the interval from -1 to 1. Neither statistic proves causation. A covariance of zero also does not generally prove independence, which is why StatSolver checks the full probability table separately.

The distribution of Z = X + Y combines cells that produce the same sum. Use it when the total outcome matters, such as total defects across two modules or total demand across two locations.

Common mistakes

Do not enter percentages as whole numbers: use 0.25 for 25%. Do not use a correlation result by itself as an independence test. When a conditional denominator is zero, that conditional probability is undefined. For a single yes/no event, use the Bernoulli calculator; for a fixed number of repeated trials, use the Binomial calculator.