How to Calculate Marginal Probability (original) (raw)

Last Updated : 24 Jan, 2026

Marginal probability is the probability of one event happening without considering any other events. It’s called “marginal” because when probabilities are in a table, you get it from the margins (totals along the side).

To calculate the **marginal probability, we use the formula according to the type of variables.

Discrete Variables Marginal Probability Formula

The marginal probability of discrete variables X and Y is obtained using the joint probability table and finding the sum of probabilities of all possible values of the required variable. The formula for the marginal probability of discrete variables is given below.

**P (X = x) = \bold {\sum\limits_y} P (X = x, Y = y)

Continuous Variables Marginal Probability Formula

The marginal probability of continuous variables X and Y is obtained by finding the integration of the joint probability density function over the range of required variable. The formula for the marginal probability of continuous variables is given below.

**P (X = x) = \bold{\int\limits_{-\infty}^\infty}**f(x, y) dy

To learn more about how to calculate marginal probability, please read the examples added below:

Solved Examples on Marginal Probability

**Example 1: If two fair dice are rolled. Calculate the marginal probability of getting a 3 on the first die.

Sample space of rolling two dice = 36

Number of favourable outcomes = 6

Marginal Probability P (First die = 3) = 6 / 36

Marginal Probability P (First die = 3) = 1 / 6

**Example 2: Consider the following joint probability table for two random variables X and Y:

**X|Y **1 **2
**1 **0.2 **0.3
**2 **0.1 **0.4

Calculate the marginal probability P (X = 1).

**Solution: P (X = 1) = P (X = 1, Y = 1) + P (X = 1, Y = 2)

P (X = 1) = 0.2 + 0.3

P (X = 1) = 0.5

**Example 3: Consider the joint PDF of two continuous random variables X and Y:

fX,Y (x, y) = 3x for 0 < x < 1 and 0 < y < 1. Find the marginal PDF fY(y).

**Solution: To find marginal probability we integrate joint PDF over all possible values of x:

fY(y) = {\int\limits_0^1}f(x, y) dx

fY(y) = {\int\limits_0^1}3x dx

fY(y) = 3 {\int\limits_0^1}x dx

fY(y) = 3 \big[\frac{x^2}{2}\big]_0^1

fY(y) = 3 (1/2)

fY(y) = 1.5 for 0 < y < 1

**Example 4: Consider the following joint probability table for two random variables X and Y:

**A|B **B = 1 **B = 2 **B = 3
**A = 1 **0.1 **0.2 **0.1
**A = 2 **0.2 **0.1 **0.3

Calculate the marginal probability P (A = 2).

**Solution: P (A = 2) = P (A = 2, B = 1) + P (A = 2, B = 2) + P (A = 2, B = 3)

P (A = 2) = 0.2 + 0.1 + 0.3

P (A = 2) = 0.6

**Example 5: In a survey, 60% of people prefer tea, and 40% prefer coffee. Out of those who prefer tea, 70% are women. Out of those who prefer coffee, 60% are men. Calculate the marginal probability of being a woman.

**Solution: Let T be the event of preferring tea, C be the event of preferring coffee, W be the event of being a woman, M be the event of being a man.

Given:

To find P(W):

P(W) = P(W∣T) ⋅P(T) + P(W∣C) ⋅P(C)

P(W) = P(W∣T) ⋅P(T) + P(W∣C) ⋅P(C)

P(W) = 0.7 × 0.6 + (1 − 0.6) × 0.4

P(W) = 0.7 × 0.6 + 0.4 × 0.4

P(W) = 0.42 + 0.16

P(W) = 0.58

**Example 6: In a group of students, 60% like math and 70% like science. Calculate the marginal probability that a student likes math or science.

**Solution: Let M be the event of liking math and S be the event of liking science.

Given:

To find P (M or S)

P (M or S) = P(M) + P(S) − P (M and S)

Assume independent events.

P (M or S) = 0.6 + 0.7 − (0.6 × 0.7)

P (M or S) = 0.6 + 0.7 − 0.42

P(M or S) = 0.88

**Example 7: The joint probability distribution of two discrete random variables X and Y is given by the following table:

X|Y Y=1 Y = 2 Y=3
X=1 0.2 0.1 0.1
X=2 0.1 0.2 0.1
X=3 0.1 0.1 0.1

Calculate the marginal probability distribution P(X).

**Solution: Marginal Probability Distribution P(X):

P(X = 1) = 0.2 + 0.1 + 0.1 = 0.4

P(X = 2) = 0.1 + 0.2 + 0.1 = 0.4

P(X = 3) = 0.1 + 0.1 + 0.1 = 0.3

So, the marginal probability distribution P(X) is:

P(X = 1) = 0.4

P(X = 2) = 0.4

P(X = 3) = 0.3

**Example 8: The joint probability distribution of two discrete random variables XXX and YYY is given by the following table:

X|Y Y=1 Y=2
X = 1 0.2 0.1
X = 2 0.1 0.2

Calculate the conditional probability P(Y = 2 ∣ X = 2).

**Solution: Conditional Probability P(Y = 2 ∣ X = 2)

P(Y = 2 ∣ X = 2) = P(X = 2,Y = 2) / P(X = 2)

From the joint distribution:

P(X = 2, Y = 2) = 0.2

P(X = 2) = P(X = 2,Y = 1)+P(X = 2,Y = 2)

P(X = 2) = 0.1 + 0.2

P(X = 2) = 0.3

P(Y = 2 ∣ X = 2) = 0.2 / 0.3

P(Y = 2 ∣ X = 2) = 2/3

**Example 9: The joint probability density function (PDF) for two continuous random variables X and Y is given by:

\begin{cases}c(2x + y) & \text{for } 0 \leq x \leq 1, 0 \leq y \leq 2 \\0 & \text{otherwise}\end{cases}

  1. Find the value of c that makes f{X, Y} (x, y) a valid joint PDF.
  2. Calculate the marginal PDFs fX (x) and fY (y).

**Solution: The joint PDF **f {X, Y} ****(x, y)** must integrate to 1 over the entire range of x and y:

\int_{0}^{1} \int_{0}^{2} c(2x + y) \, dy \, dx = 1

Compute the double integral:

\int_{0}^{1} \left[ c \left( 2x \int_{0}^{2} y \, dy + \int_{0}^{2} y^2 \, dy \right) \right] dx = 1

\int_{0}^{1} \left[ c \left( 2x \cdot \left[ \frac{y^2}{2} \right]_{0}^{2} + \left[ \frac{y^3}{3} \right]_{0}^{2} \right) \right] dx = 1

\int_{0}^{1} \left[ c \left( 2x \cdot 2 + \frac{8}{3} \right) \right] dx = 1 \ \int_{0}^{1} \left[ c \left( 4x + \frac{8}{3} \right) \right] dx = 1

c \left[ 2x^2 + \frac{8}{3}x \right]_{0}^{1} = 1

c \left( 2 \cdot 1^2 + \frac{8}{3} \cdot 1 \right) - c \cdot 0 = 1

c \left( 2 + \frac{8}{3} \right) = 1

c \left( \frac{6 + 8}{3} \right) = 1

c \cdot \frac{14}{3} = 1

c = 3/14

Therefore, c = 3/14.

**Now, we will find marginal probabilities.

Marginal PDF f X ****(x)**:

f_X(x) = \int_{0}^{2} f_{X,Y}(x, y) \, dy \\

f_X(x) = \int_{0}^{2} \frac{3}{14} (2x + y) \, dy \\

f_X(x) = \frac{3}{14} \left[ 2xy + \frac{y^2}{2} \right]_{0}^{2} \\

f_X(x) = \frac{3}{14} \left[ 4x + 2 \right] \\

f_X(x) = \frac{3}{14} (4x + 2) \\

f_X(x) = \frac{12x + 6}{14} \\

f_X(x) = \frac{6x + 3}{7} \quad \text{for } 0 \leq x \leq 1

Marginal PDF f Y ****(y)**:

f_Y(y) = \int_{0}^{1} f_{X,Y}(x, y) \, dx

f_Y(y) = \int_{0}^{1} \frac{3}{14} (2x + y) \, dx

f_Y(y) = \frac{3}{14} \left[ x^2 + xy \right]_{0}^{1}

f_Y(y) = \frac{3}{14} \left[ 1 + y \right]

f_Y(y) = \frac{3 + 3y}{14} \quad \text{for } 0 \leq y \leq 2

**Example 10: A company sells two products, A and B. The joint probability distribution of the number of units sold per day (in thousands) is:

**Product **A **B
**X = 2 **0.1 **0.2
**X = 3 **0.3 **0.4

Calculate the expected value of the number of units sold for Product B.

**Solution: E[B] = 2 × P (X = 2, B = 2) + 3 × P (X = 3, B = 3)

From the joint distribution:

E[B] = 2 × 0.2 + 3 × 0.4

E[B] = 0.4 + 1.2

E[B] = 1.6

Therefore, the expected number of units sold for Product B is 1.6 thousand units.

**Also Check

Practice Questions on Marginal Probability

Q1. If two fair coins are flipped. Calculate the marginal probability of getting a head on first coin.

Q2. Consider the following joint probability table for two random variables X and Y:

X|Y 1 2
1 0.4 0.1
2 0.5 0.3

Calculate the marginal probability P (Y = 2).

Q3. Example 3: Consider the joint PDF of two continuous random variables X and Y:

fX, Y (x, y) = 4x + 5 for 0 < x < 1 and 0 < y < 1. Find the marginal PDF fX(x).

Q4. In a group of students, 30% are of group A and 70% are group B. Among A, 40% are female, and among B, 60% are female. Calculate the marginal probability of being female.

Q5. A bag contains 4 red balls and 6 blue balls. A ball is drawn randomly. Calculate the marginal probability of drawing a red or blue ball.

Q6. A group of students is categorized by their year in school A, B and their major (Math, English, Science). Calculate the marginal probability that a student is of Group A. The joint probability table is as follows:

Groups Math English Science
A 0.2 0.1 0.1
B 0.3 0.4 0.2

Q7. The joint probability distribution of two discrete random variables X and Y is given by the following table:

A|B B = 1 B = 2 B = 3
A = 1 0.1 0.2 0.1
A = 2 0.3 0.1 0.2
A = 3 0.2 0.4 0.3

Calculate the marginal probability distribution P(X).

Q8. The joint probability distribution of two discrete random variables A and B is given by the following table:

A|B B = 1 B = 2
A = 1 0.1 0.2
A = 2 0.2 0.3

Calculate the conditional probability P(A = 1 ∣ B = 2).

Q9. The joint probability density function (PDF) of two continuous random variables X and Y is given by:

\begin{cases}6x(1-y) & \text{for } 0 \leq x \leq 1, 0 \leq y \leq 1 \\ 0 & \text{otherwise} \end{cases}

  1. Find the value of the constant c that makes f{X, Y} (x, y) a valid joint PDF.
  2. Calculate the marginal PDFs fX(x) and fY (y).

Q10. A company sells two products, A and B. The joint probability distribution of the number of units sold per day is:

Product A B
X = 1 0.4 0.3
X = 4 0.2 0.1

**Calculate the expected value of the number of units sold for Product A.