+34 616 71 29 85 carsten@dataz4s.com

Sample space, events and probabilities

The sample space is all the possible outcomes of an event. When throwing a six-sided die, the sample space is 1,2,3,4,5,6 and the event that we roll a 2 has a 1/6 probability.

Sample space

The sample space of an experiment is the set of all possible outcomes of this experiment. So, when tossing a coin, the sample space consists of two elements: Head and tail. It can be denoted S = {h,t}. The sample space for rolling a six-sided die are the six possible outcomes of one to six and can be denoted: S = {1,2,3,4,5,6}.

 

Events

An event is a happening. It can be that you flip a head with a coin. The event that you flip a head could be expressed as event A and denoted: A = {head}. Another event, event B, could be to throw an odd number with the die, so B ={1,3,5}.

 

Probability

Referring to the event A and the event B defined above, we can denote the following probabilities:

  • “The probability of event A occurring is 0.5” is denoted P(A)=0.5
  • “The probability of event B occurring is 0.5” is denoted P(B)=0.5

 

Venn diagrams

Venn diagrams converts the probabilities into a visualization. Let’s take the example that you roll a die again:

  • Let A be the event that you roll a 4, 5 or 6 and that you
  • Let B be the event that you roll 2, 3 or 4:

 

S = {1, 2, 3, 4, 5, 6}

A = {4, 5, 6}

B = {2, 3, 4}

P(A and B) = P(A ∩ B) = {4}

P(A or B) = P(A ∪ B) = {2, 3, 4, 5, 6}

Sample space, events, probability illustrated with a Venn diagram

 

P(A ∩ B): Joint probability or intersection

Say you throw a standard six-sided die and define the following events:

  • Event A = Probability of throwing less than 5
  • Event B = Probability of throwing an odd number
  • Sample Space = S = {1,2,3,4,5,6}
  • A = {1,2,3,4}
  • B = {1,3,5}
  • P(A and B) = P(A ∩ B) = {1,3}
  • P(A or B) = P(A ∪ B) = {1, 2, 3, 4, 5}

Venn diagram illustrating sample space, events and probabilities

 

What’s the probability of event A and event B to occur as you throw the die? We can see that 1 and 3 are contained both in event A and event B. This is also called the joint probabilities or the intersection, which is the same as A and B and is typically denoted P(A ∩ B).

So, the symbol ∩ stands for “and”. The union-symbol () means “or”.

 

Joint probability example (A and B)

Say you are watching a horse race with 8 horses where the bookmakers set the following odds:

  • Horse 1 is favorite with 0.28 chance of winning the race
  • Horse 8 is the underdog with a 0.01 chance of winning and 0.25 of losing the race

Which one would you think is most likely to win? The answer is obvious. But, now say we are asked to calculate the probability that Horse 1 wins AND that Horse 8 loses.

We express:

  • Let A be the event that Horse 1 wins: P(A) = 0.28
  • Let B be the event that Horse 8 loses: P(B) = 0.25

The probability of event A and B: The probability of Horse 1 winning (event A) AND of Horse 8 losing (event B), is denoted: P(AB) and calculated: P(A∩B) = P(A) x P(B) = 0.28 x 0.25 = 0.0675. So, there is roughly 7% chance that Horse 1 wins and Horse 8 loses the race.

 

Union example (A or B)

What’s the probability of either Horse 1 winning OR Horse 8 losing? The calculation and the result are different from when we say “AND”. In the “OR-cases” it is either A or B. These “OR-cases” add up the two events. But adding up the two events means that we count the joint event twice.

Let’s take a short break from our horse race example and throw a six-sided die: Let’s state that event A is that we throw either 3 or 4  and event B that we roll 4 or 5. That is a total of 4 events: 2 in event A and 2 in event B. So, if we just add them up, we double-count the event of throwing 4, and we would incorrectly say that the two events have 4 outcomes, when there, in fact, only are 3 different outcomes: 3,4 and 5.

In other words: when referring to P(A), we refer to the whole of event A, including the joint area with event B. And the same when we referring to P(B), we refer to the whole of event B, including the joint area (again!). So, the joint area is taking place twice, and we therefore need to subtract this joint area once:

P(A∪B) = P(A) + P(B) – P(A∩B)

Back to our horse race example, our “OR-question” would be: What’s the probability that either horse 1 wins OR horse 8 loses? The calculation would be:

P(A) + P(B) – P(A∩B) ó 0.28 + 0.25 – 0.0675 = 0.4625

So, there is approximately a 46.25% probability that either horse 1 wins OR that horse 8 loses.

 

All objects, not only numbers

Sample space, events and probability refers just as well to any kind of object and not only to numbers as we’ve seen it so far with rolling of a die. As such the Venn diagram could take out as this:

Venn diagram for all objects

 

Say that in a HR department a survey is designed in order to explore whether the proportion of staffs in the administration department is greater than the one for staffs working in the rest of the company. The sample space and the events could take out as follows: 

Venn diagram, staffs study

Carsten Grube

Carsten Grube

Freelance Data Analyst

0 Comments

Submit a Comment

+34 616 71 29 85

Call me

Spain: Ctra. 404, km 2, 29100 Coín, Malaga

...........

Denmark: c/o Musvitvej 4, 3660 Stenløse

Drop me a line

What are you working on just now? Can I help you, and can you help me?