How To Calculate Product Distribution Of Random Variables

How to Calculate Product Distribution of Random Variables

Use this interactive calculator to find the exact distribution of the product Z = X × Y for two independent discrete random variables. Choose preset distributions such as Bernoulli, fair die, or discrete uniform integers, or enter your own custom probability mass functions.

Exact discrete product PMF Expected value and variance Chart.js visualization Supports custom inputs

Random Variable X

This creates X uniformly distributed on {1, 2, …, n}.
Format: value:probability, separated by commas. Probabilities must sum to 1.

Random Variable Y

This creates Y uniformly distributed on {1, 2, …, n}.
Format: value:probability, separated by commas. Probabilities must sum to 1.

Calculate the product distribution

Select distributions for X and Y, then click calculate to compute the exact probability mass function of Z = X × Y.

Expert Guide: How to Calculate Product Distribution of Random Variables

Calculating the distribution of the product of random variables is a classic probability problem with practical applications in finance, engineering, reliability analysis, epidemiology, communications, machine learning, and risk modeling. If you define a new variable as Z = XY, the main question becomes: what is the probability distribution of Z once you already know the distributions of X and Y? The answer depends on whether the variables are discrete or continuous, whether they are independent or dependent, and whether their supports include positive values, negative values, or zero.

For many students, the easiest way to understand this topic is to start with independent discrete random variables. That is exactly what the calculator above does. It builds the product distribution by examining every possible pair of outcomes, multiplying the values, and then summing the probabilities of all pairs that create the same product. Once that logic is clear, you can extend the same idea to continuous variables using integrals and change-of-variable methods.

Core idea behind a product distribution

Suppose X and Y are independent random variables and you define Z = XY. The distribution of Z answers questions such as:

  • What is the probability that the product equals a specific value?
  • What is the density of the product near a specific value?
  • What are the mean and variance of the product?
  • How does multiplying two noisy quantities change uncertainty?

If X and Y are independent and discrete, then the exact probability mass function is:

P(Z = z) = Σ P(X = x)P(Y = y) over all pairs (x, y) such that xy = z.

This formula is simple but powerful. You do not directly convolve the values the way you would for a sum. Instead, you identify all value pairs whose product equals the target outcome. That is the key conceptual difference between a sum distribution and a product distribution.

Step-by-step discrete method

  1. List the support of X and the probability for each possible value.
  2. List the support of Y and the probability for each possible value.
  3. Form every pair (x, y).
  4. Compute the product z = xy for each pair.
  5. Because the variables are independent, assign the pair probability P(X=x, Y=y) = P(X=x)P(Y=y).
  6. Group all pairs with the same product and add their probabilities.
  7. Check that the final probabilities sum to 1.

Worked example: Bernoulli times fair die

Let X ~ Bernoulli(0.6), so P(X=1)=0.6 and P(X=0)=0.4. Let Y be a fair die on {1,2,3,4,5,6}. Define Z=XY.

If X=0, then Z=0 regardless of the die outcome, so P(Z=0)=0.4. If X=1, then Z=Y, so each of 1 through 6 occurs with probability 0.6 × 1/6 = 0.1. Therefore:

  • P(Z=0)=0.4
  • P(Z=1)=P(Z=2)=…=P(Z=6)=0.1

This example shows a useful pattern: when one factor is Bernoulli, the product often becomes a zero-inflated version of the other variable.

Exact comparison table: product of two fair dice

A common classroom example is the product of two independent fair six-sided dice. There are 36 equally likely ordered pairs, but many pairs lead to the same product. Unlike the sum of two dice, the product distribution is not triangular. It is more irregular because factorization matters.

Product z Number of ordered pairs Exact probability Decimal
111/360.0278
222/360.0556
322/360.0556
433/360.0833
522/360.0556
644/360.1111
822/360.0556
911/360.0278
1022/360.0556
1244/360.1111
1522/360.0556
1611/360.0278
1822/360.0556
2022/360.0556
2422/360.0556
2511/360.0278
3022/360.0556
3611/360.0278

The highest-probability products here are 6 and 12, each appearing in four ordered pairs. This table helps explain why product distributions often look uneven. Values with many factor pairs receive more mass.

Continuous random variables: the general approach

If X and Y are continuous, you usually work with densities rather than point probabilities. In the independent case, the density of Z = XY can often be written as:

fZ(z) = ∫ fX(x) fY(z/x) (1/|x|) dx

where the integral is taken over all x values for which the expression is valid. The factor 1/|x| comes from the Jacobian in the change-of-variable transformation. This is the continuous analog of summing over all factor pairs in the discrete case.

Example: product of two Uniform(0,1) variables

Let X and Y be independent Uniform(0,1). For Z = XY, the support is also between 0 and 1, but the distribution is not uniform. In fact:

  • fZ(z) = -ln(z) for 0 < z < 1
  • FZ(z) = z – z ln(z) for 0 < z < 1

This result surprises many learners because products of small numbers tend to get even smaller, so the density is concentrated near zero.

z CDF F(z) = z – z ln(z) Density f(z) = -ln(z) Interpretation
0.100.33032.3026About 33.03% of products are at most 0.10
0.250.59661.3863Nearly 59.66% of products are at most 0.25
0.500.84660.6931Most products fall below 0.50
0.750.96580.2877Only a small fraction exceed 0.75
0.900.99480.1054Products near 1 are rare

Mean and variance of a product

If X and Y are independent, then a very useful identity is:

E[XY] = E[X]E[Y]

This lets you compute the mean of the product without building the full distribution. However, if you need exact probabilities, quantiles, or the full shape, you still need the PMF or PDF of Z.

For the variance, one common route is:

Var(XY) = E[X²]E[Y²] – (E[X]E[Y])² for independent variables.

The calculator above computes the PMF of Z directly and then derives its mean and variance from that PMF, which is often the safest computational approach for finite discrete distributions.

What changes when variables are not independent?

Independence is a major simplifying assumption. If X and Y are dependent, then you cannot replace joint probabilities with products of marginals. For discrete variables, you must use:

P(Z=z) = Σ P(X=x, Y=y) over all pairs with xy=z.

For continuous variables, you must work from the joint density fX,Y(x,y). This matters in real systems because correlated inputs can dramatically alter the product distribution. In finance, asset returns and volatility proxies may be dependent. In engineering, signal amplitude and channel gain can be linked. In biostatistics, dosage and adherence may not vary independently.

Special cases worth remembering

1. Multiplying by a constant

If Z = cX, then this is a scaling transformation rather than a full product-distribution problem. For discrete variables, each support value is multiplied by c. For continuous variables, the density rescales according to the standard change-of-variable rule.

2. Products with zero in the support

If either variable can be zero, the product often gets a noticeable point mass at zero. In applications, this creates a spike in the PMF or a mixed distribution if one variable is continuous and another has mass at zero.

3. Sign changes matter

When supports include both positive and negative values, the product can be positive or negative. That means you must track factor pairs carefully. In continuous problems, the absolute value in the Jacobian term becomes especially important.

4. Normal variables do not stay normal under multiplication

Students often know that sums of independent normal variables are normal. Products are different. The product of two independent normal variables does not generally follow a normal distribution. That is why product problems often require custom derivations or simulation.

Practical workflow for solving product-distribution problems

  1. Identify whether the variables are discrete, continuous, or mixed.
  2. Check whether independence is given or must be justified.
  3. Write the support clearly, including whether zero or negative values are possible.
  4. Choose a method:
    • Enumeration for small discrete supports
    • Generating all pairs with probability accumulation for computational discrete problems
    • Transformation and integration for continuous cases
    • Simulation when exact algebra is too difficult
  5. Verify that the final PMF or PDF is valid and normalized.
  6. Compute summary statistics such as mean, variance, and selected probabilities.

Common mistakes to avoid

  • Confusing a product distribution with a sum distribution.
  • Forgetting to combine probabilities from multiple factor pairs that produce the same product.
  • Assuming normality of the product without proof.
  • Ignoring the effect of zero or negative values.
  • Using marginal probabilities when dependence is present.
  • For continuous transformations, forgetting the Jacobian factor 1/|x|.

Authoritative references for deeper study

If you want a stronger theoretical foundation, these resources are excellent starting points:

Bottom line

To calculate the product distribution of random variables, start by classifying the problem correctly. For independent discrete variables, enumerate all possible pairs, multiply probabilities, and combine equal products. For continuous variables, use a transformation approach and include the proper Jacobian term. Once you understand that a product distribution is built by tracking all ways to obtain the same product, the topic becomes much more intuitive.

The calculator on this page is designed to make that logic visible. You can test standard examples, enter custom distributions, and see the product PMF in both table and chart form. That makes it useful for students studying probability theory, instructors building examples, and analysts who need a quick exact calculation for finite discrete models.

Educational note: the calculator assumes X and Y are independent discrete random variables with finite support. For continuous or dependent cases, the conceptual steps above still apply, but the mathematics requires integration or a joint distribution model.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top