---
title: "Joint, Marginal and Conditional Probability"
description: "A discrete joint probability table describes combinations of values. Add cells to find marginals, divide by a positive conditioning probability to find conditionals, and compare joint entries with mar"
canonical: https://lightmysky.com/learn/computing/joint-marginal-and-conditional-probability-mt__Rj-hOSMEw
source: https://lightmysky.com/learn/computing/joint-marginal-and-conditional-probability-mt__Rj-hOSMEw.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Joint, Marginal and Conditional Probability

A discrete joint probability table describes combinations of values. Add cells to find marginals, divide by a positive conditioning probability to find conditionals, and compare joint entries with marginal products to check independence.

Subject: Computing · Area: Machine Learning · Ages 18 to 19
Page: https://lightmysky.com/learn/computing/joint-marginal-and-conditional-probability-mt__Rj-hOSMEw

## Ready when they can

- Read a joint table and compute both marginals and a conditional from it
- Say what independence means as a statement about the joint distribution
- Compare a conditional probability with its reverse and explain when they can match

## Lesson: Reading joint probability tables

A joint table records combinations of two variables. Let X be 1 for bike delivery and 0 for van delivery. Let Y be 1 for on time and 0 for late. A fictional set has 20 parcels: bike/on time 6, bike/late 4, van/on time 8, van/late 2. Choose one parcel uniformly. Each joint probability is its cell count divided by 20. The four probabilities total 1.

*(drawing: Each bar represents one joint combination. The counts cover all 20 parcels.)*

A marginal combines every cell for one requested value. Add both bike counts: P(X=1)=(6+4)/20=0.50. Add both on-time counts: P(Y=1)=(6+8)/20=0.70. The other marginals are P(X=0)=0.50 and P(Y=0)=0.30. Each variable's marginal distribution totals 1. With probability entries, add them directly. With counts, divide the selected total by the whole group's count.

P(A given B) means the probability of A within B. Calculate P(A given B)=P(A and B)/P(B), provided P(B)>0. With counts, divide the overlap count by the B count. If B includes several rows or columns, include every cell in B before dividing. All conditional probabilities within that group total 1. When P(B)=0, this ratio does not define a conditional probability.

**Example.** Among bike parcels, 6 of 10 are on time: P(Y=1 given X=1)=6/10=0.60. Among on-time parcels, 6 of 14 came by bike: P(X=1 given Y=1)=6/14, about 0.43. Reversing the condition keeps the overlap but changes the denominator. With both denominators positive, the reverse probabilities agree exactly when the overlap is zero or the denominators are equal.

*(drawing: The whole bar represents bike parcels only. Six of its ten equal parts represent on-time bike parcels.)*

Independence means every joint entry equals the product of its two marginals. Here 6/20=0.30 differs from 0.50*0.70=0.35, proving dependence. One mismatch is enough. One match is not generally enough, but in a complete 2-by-2 table, one match and all marginals force the other three matches by subtraction. For independent variables, conditioning on a value with positive probability leaves the other variable's distribution unchanged.

Recover missing entries by subtraction. All joint entries total 1, and entries in a row or column total its marginal. If a two-entry row totals 0.50 and one entry is 0.30, the other is 0.20. You can also recover an overlap: P(A and B)=P(A given B)*P(B), when P(B)>0. For bike parcels, multiply the on-time conditional 0.60 by the bike marginal 0.50 to get the joint probability 0.30.

*(drawing: The two bike entries must add to the bike marginal, 0.50.)*

An event can include several joint cells. Select all cells satisfying the event, then add their probabilities. The cells describe separate combinations, so they do not overlap. For X=Y, select pairs with equal values, such as (0,0) and (1,1). For X at least 2, select all rows whose X value is 2 or more. To condition on an event, divide its overlap with the requested event by its positive total probability.

Marginals alone do not determine a joint table. Suppose X has probabilities 0.20 and 0.80, and Y has probabilities 0.50 and 0.50. In row order, joint entries 0.10,0.10; 0.40,0.40 give independence. Entries 0.20,0; 0.30,0.50 have the same row and column totals but are dependent. A joint table describes only its recorded variables, not every detail of the original outcomes.

**Recap.** Add joint cells for marginals and events. Divide by a positive conditioning probability for conditionals. Independence requires the marginal product rule in every cell.

*Lesson, questions and flashcards written for this dataset. Numerical scenarios use fictional data.*

## Practice

18 questions on this page, each with its working shown.

## Needs first

- [Discrete Random Variables and Probability Distributions](https://lightmysky.com/learn/mathematics/discrete-random-variables-and-probability-distributions-mt_yKztNkvvq3)

## Optional connections

- [Probability Spaces: Sample Spaces, Events and Axioms](https://lightmysky.com/learn/mathematics/probability-spaces-sample-spaces-events-and-axioms-mt_4gsBeqJtIQ)
- [Machine Learning Basics](https://lightmysky.com/learn/computing/machine-learning-basics-mt_K6qtan847r)

## Opens up

- [Bayes' Rule and Updating a Belief](https://lightmysky.com/learn/computing/bayes-rule-and-updating-a-belief-mt_A4p5--f7Io)
- [Hidden Markov models for sequence: profiles, states and decoding](https://lightmysky.com/learn/science/hidden-markov-models-for-sequence-profiles-states-and-decoding-mt_nk14IaZTcw)
