Prashnikaप्रश्निका
Code
About

Venn diagram generator and visualiser

Draw the Venn diagram of two or three events and see any region of it built up one step at a time. Give the probabilities, the counts or the outcomes, then write the region you want, such as A ∪ B, A′ ∩ B, (A ∪ B)′ or B | A (B given A): the diagram shades it, the sample space shrinks for a “given”, and the probability is worked out as a fraction. Tap other regions to try them, or click the diagram to shade your own. If some of the probabilities are missing, the probability events solver finds them step by step first.

How to use it

  1. 1Choose what you know: probabilities, counts or outcomes, and fill in the boxes (or tap an example).
  2. 2Write the region you want, such as A ∪ B, A′ ∩ B, (A ∪ B)′ or B | A, and press Draw it.
  3. 3Press Play to watch the region built up one step at a time, tap other regions, or click the diagram to shade your own.
What do you know?

Fill in one of the next three boxes: any one is enough. Here you can also write independent, mutually exclusive or B | A = 0.4.

Write a probability as 1/4, 0.25 or 25%.

Not A is A′ (or A'). Union is ∪ (or u, + or the word or); intersection is ∩ (or n, or the word and); “but not” is −; B | A means B given A. Leave it empty for A ∪ B.

Worked example

a die: B given A (even, more than 3)

This is the kind of answer you get. Put these values in the boxes or type your own.

Answer

P(B | A)
2/3 ≈ 0.6667

The Venn diagram, step by step

P(B | A) = 2/3 ≈ 0.6667

Venn diagram of the events A and B inside the sample space SABS (6 in all)1 3254 6A′ ∩ B′A ∩ B′A′ ∩ BA ∩ B

P(B | A) = P(A ∩ B) ÷ P(A) = 1/3 ÷ 1/2 = 2/3 ≈ 0.6667. It is the shaded part as a share of A.

  1. P(B | A) = P(A ∩ B) ÷ P(A)
  2. P(A ∩ B) = 1/3 ≈ 0.3333, the shaded regions added up
  3. P(A) = 1/2 = 0.5
  4. P(B | A) = (1/3) ÷ (1/2)
  5. = (1/3) × 2
  6. = (1 × 2)/(3 × 1)
  7. = 2/3 ≈ 0.6667

Shade another region

Tap one to see it built up step by step. Or .

The regions

RegionAs a setOutcomesHow manyProbability
A onlyA ∩ B′211/6 ≈ 0.1667
B onlyA′ ∩ B511/6 ≈ 0.1667
Both A and BA ∩ B4, 621/3 ≈ 0.3333
Neither of themA′ ∩ B′1, 321/3 ≈ 0.3333

The regions never overlap and together make up S, so their probabilities add up to 1.

What the numbers say about A and B

Independent?
P(A) × P(B) = 1/2 × 1/2 = 1/4 = 0.25 and P(A ∩ B) = 1/3 ≈ 0.3333, which are not equal, so A and B are not independent.
Mutually exclusive?
P(A ∩ B) = 1/3 ≈ 0.3333 is not 0 (the circles overlap), so A and B are not mutually exclusive.
Together they cover S?
P(neither) = 1/3 ≈ 0.3333, so there are outcomes outside both circles.
Given that...
P(A | B) = P(A ∩ B) ÷ P(B) = 1/3 ÷ 1/2 = 2/3 ≈ 0.6667; P(B | A) = P(A ∩ B) ÷ P(A) = 1/3 ÷ 1/2 = 2/3 ≈ 0.6667.
Every step in words (5 steps)
  1. A is the circle A: every outcome where A happens.
  2. Given A: we are told A has happened, so the only outcomes left are the ones inside it. Everything else is greyed out. A is the new sample space.
  3. B is the circle B: every outcome where B happens.
  4. Inside A, only the part that is also in B counts: A ∩ B.
  5. P(B | A) = P(A ∩ B) ÷ P(A) = 1/3 ÷ 1/2 = 2/3 ≈ 0.6667. It is the shaded part as a share of A.

About the Venn diagram generator and visualiser

What it does

Draws the Venn diagram of two events A and B (or three, A, B and C) inside the sample space S, puts the probability, the count or the outcomes in every region, and shades any region you write as a set expression. It works the probability of the shaded part out in exact fractions, shows which formula it is, and says whether A and B are independent, mutually exclusive or together cover S.

Reading a region

  • A ∪ B: A or B or both. P(A ∪ B) = P(A) + P(B) − P(A ∩ B).
  • A ∩ B: both A and B.
  • A′ (not A): everything outside circle A. P(A′) = 1 − P(A).
  • A ∩ B′ (or A − B): A but not B. P(A ∩ B′) = P(A) − P(A ∩ B).
  • (A ∪ B)′: neither A nor B. It is the same region as A′ ∩ B′, and (A ∩ B)′ is the same as A′ ∪ B′: De Morgan’s laws.
  • B | A: B given that A has happened. The sample space shrinks to A, and P(B | A) = P(A ∩ B) ÷ P(A).

Independent and mutually exclusive

  • A and B are independent when P(A ∩ B) = P(A) × P(B). You can type independent in the P(A ∩ B) box and the tool uses that product.
  • A and B are mutually exclusive when they cannot happen together: P(A ∩ B) = 0 and the circles do not overlap. Type mutually exclusive in that box.

How to write the input

Not A is A′ (or A'). Union is ∪ (or u, + or the word or); intersection is ∩ (or n, or the word and); “but not” is −; B | A means B given A. Brackets work, and A′B means A′ ∩ B. For outcomes, list them (2, 4, 6), give a range (1-12) or describe them: even, odd, prime, multiple of 3, > 3. The buttons under the box type the symbols for you.

Common questions

How do I find P(B | A) with a Venn diagram?

Write B | A in the box. The diagram greys out everything outside A, because A is now the whole sample space, and shades the part of B that is inside A. P(B | A) is the probability of that overlap divided by P(A).

What does A′ ∩ B mean in a Venn diagram?

It is the part of B that is outside A: the outcomes that are in B but not in A. Its probability is P(B) − P(A ∩ B).

Is (A ∪ B)′ the same as A′ ∩ B′?

Yes. Both are the outside of both circles: neither A nor B happens. This is one of De Morgan’s laws, and the other is that (A ∩ B)′ is the same as A′ ∪ B′. Write either form and the tool shades the same region.

How do I show that two events are independent?

Check that P(A ∩ B) = P(A) × P(B). The tool does this for you under “What the numbers say about A and B”, and tells you if the two sides differ.

Can I use it for three events?

Yes, in the Outcomes mode: fill in Event C as well and a third circle is drawn. Then regions such as (A ∪ B) ∩ C′ or A ∩ B | C work too.

Practise on real ISC questions

More Mathematics tools

All study tools →