Random Experiments
You're at a party and Ximena puts the playlist on shuffle. Do you know which song will play first? No. But you do know which songs could play. That "everything that could happen" is the starting point of probability, and on this page you'll learn how to describe it and how to combine events using the language of sets.
Sample space and events
To talk about events you need the language of sets. A set is a collection of elements and is written between braces: $A=\{2, 4, 6\}$. If $2$ is an element of $A$, we write $2\in A$; if $5$ is not, $5\notin A$.
-
Universal set: the set that contains everything under consideration. In probability, the universal set is the sample space $E$: every event is a subset of it.
-
Subset: $A\subseteq B$ means that every element of $A$ is also in $B$. That is why any event satisfies $A\subseteq E$.
-
Equality of sets: $A=B$ means they have exactly the same elements. Order doesn't matter, and neither does repeating an element: $\{1,2,3\}=\{3,2,1\}=\{1,1,2,3\}$. Two sets are equal if $A\subseteq B$ and $B\subseteq A$.
-
Empty set: $\emptyset$ has no elements and is a subset of every set.
An event is certain if it is all of $E$ (it always occurs), impossible if it is $\emptyset$ (it never occurs), and possible in any other case.
For multi-stage experiments, the sample space includes all the combinations. A tree diagram helps you not to forget any.
Infinite and continuous sample spaces
Not every sample space is a short list. There are three cases:
-
Finite: you can list all the outcomes, as with a die.
-
Countably infinite: the outcomes can be listed one after another, but the list never ends. Example: roll a die until a 6 comes up and record how many rolls it took: $E=\{1, 2, 3, \dots\}$.
-
Continuous: the outcomes fill an interval and cannot be listed. Example: measure how many minutes it takes Diego to get to high school on the Metro: $E=[0, \infty)$ or, if you know it never takes more than 90 minutes, $E=[0, 90]$.
In these cases, events are written with intervals or with a condition. For example, "taking less than 30 minutes" is $[0, 30)$, and "the number of rolls is even" is $\{2, 4, 6, \dots\}$.
Classify the following experiments as deterministic or random, briefly justifying your answer in each case: a) Dropping a smartphone from a height of one meter and…
Classify the following experiments as deterministic or random, briefly justifying your answer in each case:
- a) Dropping a smartphone from a height of one meter and observing whether it falls toward the ground.
- b) Opening a playlist in shuffle mode and noting down the first song that plays.
- c) Calculating the time it takes for a car to travel $200$ km if it travels at a constant speed of $100$ km/h.
- d) Asking the first person you see on the street in which month they were born.
- e) Drawing a card from a Spanish deck of $40$ cards and observing its suit.
We draw a ball from an urn containing $5$ balls numbered from $1$ to $5$. State whether the following events are possible, certain or impossible: a)…
We draw a ball from an urn containing $5$ balls numbered from $1$ to $5$. State whether the following events are possible, certain or impossible:
- a) $A = \text{"getting a number greater than 0"}$.
- b) $B = \text{"getting the number 7"}$.
- c) $C = \text{"getting an even number"}$.
- d) $D = \text{"getting a number less than or equal to 5"}$.
- e) $F = \text{"getting a negative number"}$.
A student has three pens of different colors in their pencil case: Blue (A), Black (N) and Red (R). They decide to draw two pens consecutively without returning the…
A student has three pens of different colors in their pencil case: Blue (A), Black (N) and Red (R). They decide to draw two pens consecutively without returning the first one to the pencil case.
- a) Write down the sample space $E$ of this experiment.
- b) State how many elementary events form this sample space.
- c) Define the compound event $S = \text{"drawing the blue pen in any position"}$.
We consider the random experiment of rolling a tetrahedral die (4 faces) with faces numbered from $1$ to $4$, and a $1$ peso coin. We record the number on the bottom…
We consider the random experiment of rolling a tetrahedral die (4 faces) with faces numbered from $1$ to $4$, and a $1$ peso coin. We record the number on the bottom face of the die and whether the coin shows heads $(C)$ or tails $(X)$.
- a) Use a tree diagram to represent all possible outcomes.
- b) Write down the sample space $E$.
- c) Determine the elements of event $A = \text{"getting an even number on the die and heads on the coin"}$.
A role-playing video game allows you to create a character by choosing between two factions: Warrior (G) or Mage (M). In addition, the character can be from three races:…
A role-playing video game allows you to create a character by choosing between two factions: Warrior (G) or Mage (M). In addition, the character can be from three races: Human (H), Elf (E) or Dwarf (D).
A character is chosen at random from the game server.
- a) Write down the sample space $E$ using the initial notation (for example, $GH$ for Human Warrior).
- b) Describe the event $S = \text{"the character is not a Wizard"}$.
- c) If we let $A$ be the event $\text{"the character is an Elf"}$, state which elements make up the complementary event $\bar{A}$.
Operations with events
An event is a set, so it can be combined using the set operations you already know.
| Operation | Notation | Meaning |
|---|---|---|
| Union | $A \cup B$ | $A$ occurs, or $B$, or both |
| Intersection | $A \cap B$ | $A$ and $B$ both occur at the same time |
| Complement | $\overline{A}$ | $A$ does not occur (it is $E-A$) |
| Difference | $A - B$ | $A$ occurs but not $B$ (it is $A \cap \overline{B}$) |
| Symmetric difference | $A \,\triangle\, B$ | exactly one of the two occurs: $(A \cup B) - (A \cap B)$ |
In a 2nd Baccalaureate group, subscriptions to streaming platforms are analysed. We let $A$ be the event "being subscribed to Netflix" and $B$ be the event "being…
In a 2nd Baccalaureate group, subscriptions to streaming platforms are analysed. We let $A$ be the event "being subscribed to Netflix" and $B$ be the event "being subscribed to Spotify". Express in words the meaning of the following events related to set operations:
- a) $A \cup B$
- b) $A \cap B$
- c) $\bar{A}$ (or the complementary event of $A$)
- d) $A - B$
- e) $\bar{A} \cap \bar{B}$
Observe the following Venn diagram representing the distribution of students playing Basketball ($B$) and Soccer ($F$) at a municipal sports center. From the graph,…
Observe the following Venn diagram representing the distribution of students playing Basketball ($B$) and Soccer ($F$) at a municipal sports center.
From the graph, define the following regions using event operations:
- a) Students who play both sports.
- b) Students who play basketball but not soccer.
- c) Students who play at least one of the two sports.
- d) Students who play neither of the two sports mentioned.
In a new strategic board game, a player must roll a tetrahedral die (faces numbered $1$ to $4$) and, simultaneously, draw a card from a reduced deck containing only the…
In a new strategic board game, a player must roll a tetrahedral die (faces numbered $1$ to $4$) and, simultaneously, draw a card from a reduced deck containing only the four Aces and the four Kings of a Spanish deck.
Considering the random experiment of recording the number on the die and the value of the card (Ace or King):
- a) Describe the sample space $E$ of the experiment.
- b) Let the events be:
$A$ = "Get an even number on the die".
$B$ = "Get an Ace of any suit".
$C$ = "Get a number less than $3$ on the die and a King card".
Determine the elements comprising the events $A \cup B$, $A \cap B$ and $B \cap C$.
Let $E = \{1, 2, 3, 4, 5, 6, 7, 8\}$ be the sample space of a random experiment. We consider the events $A = \{2, 4, 6, 8\}$, $B = \{3, 6\}$ and $C = \{1, 2, 3\}$. Find…
Let $E = \{1, 2, 3, 4, 5, 6, 7, 8\}$ be the sample space of a random experiment. We consider the events $A = \{2, 4, 6, 8\}$, $B = \{3, 6\}$ and $C = \{1, 2, 3\}$.
Find the sets resulting from the following operations and check if any inclusion relation holds between them:
- a) $(A \cup B) \cap C^c$
- b) $(A \cap C) \cup (B \cap C)$
- c) $A - (B \cup C)$
Note: $C^c$ represents the complementary event of $C$.
De Morgan's laws
Algebra of events and symmetric difference
To prove identities, drawing a picture is not enough: you use properties that hold for any event.
The symmetric difference $A \,\triangle\, B$ is the event "one and only one of the two occurs". It is defined as $(A \cup B) - (A \cap B)$, and in the Venn diagram it is everything shaded except the overlap.
Let $E = \{1, 2, 3, 4, 5, 6, 7, 8\}$ be the sample space of a random experiment. Given the events $A = \{1, 3, 5, 7\}$ and $B = \{2, 3, 5, 8\}$, obtain the following…
Let $E = \{1, 2, 3, 4, 5, 6, 7, 8\}$ be the sample space of a random experiment. Given the events $A = \{1, 3, 5, 7\}$ and $B = \{2, 3, 5, 8\}$, obtain the following sets:
- a) $A \cup B$
- b) $A \cap B$
- c) $A \cap \bar{B}$
- d) Check whether De Morgan's First Law holds: $\overline{A \cup B} = \bar{A} \cap \bar{B}$.
A communications satellite sends data bursts consisting of binary sequences of length $n=3$. Due to cosmic noise, each bit has a probability of being corrupted. We…
A communications satellite sends data bursts consisting of binary sequences of length $n=3$. Due to cosmic noise, each bit has a probability of being corrupted. We define the sample space $E$ as the set of all possible binary triples. Let the events be:
-
$A = \{(1,0,0), (0,1,0), (0,0,1)\}$
-
$B = \{(1,1,0), (1,0,1), (0,1,1), (1,1,1)\}$
Using De Morgan's laws, simplify the expression of event $S = \overline{(\overline{A} \cup B) \cap (A \cup \overline{B})}$ as far as possible. Once simplified, describe in words what common characteristic the sequences forming event $S$ have regarding the number of "ones" present in the burst.
Let $A, B$ and $C$ be any three events of a random experiment. Prove formally, using the properties of the algebra of events (distributive, complementation, etc.), the…
Let $A, B$ and $C$ be any three events of a random experiment. Prove formally, using the properties of the algebra of events (distributive, complementation, etc.), the following identity:
$$(A \cup B) - (A \cap B) = (A \cap \overline{B}) \cup (\overline{A} \cap B)$$Explain what name this operation is given in set theory and represent the resulting event using a shaded Venn diagram.
A study on the use of social networks is conducted in a sixth-form college. Two students are chosen at random and asked if they regularly use network $X$ and network…
A study on the use of social networks is conducted in a sixth-form college. Two students are chosen at random and asked if they regularly use network $X$ and network $Y$. Let $x_i$ be the event "student $i$ uses network $X$" and $y_i$ be the event "student $i$ uses network $Y$".
Express the following events symbolically, using the operations of union, intersection and complementation:
- a) Only the first student uses both social networks.
- b) At least one of the two students uses network $X$, but neither uses network $Y$.
- c) Both students have exactly the same usage habits regarding these two social networks.
Mutually exclusive events
Go back to the beginning: in the shuffled playlist you don't know which song plays first (random experiment), but $E$ is the set of all the songs in the playlist, and "a rock song plays" is an event, that is, a subset of $E$.
In a mobile app development environment, a programmer is testing the security of an access system. A random experiment is defined, consisting of generating a random…
In a mobile app development environment, a programmer is testing the security of an access system. A random experiment is defined, consisting of generating a random 4-digit code using only the numbers $\{1, 2, 3, 4, 5, 6\}$. The following events are considered:
-
$A$: "The code contains at least two consecutive equal digits".
-
$B$: "The sum of the digits of the code is a prime number greater than 15".
-
$C$: "The code is a palindrome (it reads the same from left to right as from right to left)".
Describe the sample space $E$ in detail, stating its cardinality, and use the algebra of events to symbolically express the following events:
- a) The code is not a palindrome or the sum of its digits is not a prime number greater than 15.
- b) The code is a palindrome and has at least two consecutive equal digits, but the sum of its digits is not a prime number greater than 15.
- c) Determine whether events $A$ and $C$ are compatible or incompatible, justifying your answer with an example of an element of the sample space.
We consider the random experiment of rolling an octahedral die (faces from $1$ to $8$) and a standard cubic die (faces from $1$ to $6$). We define the following events:…
We consider the random experiment of rolling an octahedral die (faces from $1$ to $8$) and a standard cubic die (faces from $1$ to $6$). We define the following events:
$A$ = "The sum of the scores is a prime number".
$B$ = "The product of the scores is a multiple of $10$".
- a) Are $A$ and $B$ compatible or mutually exclusive events? Justify your answer by stating at least one element of the intersection if it exists.
- b) Calculate the number of elements in the complement of $B$.
In a robotics laboratory, two independent sensors, $S_1$ and $S_2$, are being tested. The experiment consists of checking whether each sensor triggers ($1$) or not ($0$)…
In a robotics laboratory, two independent sensors, $S_1$ and $S_2$, are being tested. The experiment consists of checking whether each sensor triggers ($1$) or not ($0$) when exposed to a stimulus.
- a) Write down the sample space $E$.
- b) Describe the complementary event of $A$, where $A$ = "At least one of the sensors triggers".
- c) If we define event $B$ = "Both sensors act identically", determine $A \cap B$ and the difference event $B - A$.
More practice with counting, trees, and diagrams
When the sample space is large, don't write it out in full: use a tree diagram to see its structure and the multiplication principle (the number of options at each stage, multiplied together) to count. With three events, the Venn diagram has eight regions; use it to help you count elements. If the space is continuous, describe the events with intervals.
A lottery drum contains $10$ balls numbered from $0$ to $9$. Three balls are drawn successively without replacement to form a three-digit number (the first ball…
A lottery drum contains $10$ balls numbered from $0$ to $9$. Three balls are drawn successively without replacement to form a three-digit number (the first ball corresponds to the hundreds, the second to the tens and the third to the units; outcomes starting with $0$, such as $047$, are allowed).
- a) How many elements does the sample space $E$ have?
- b) Describe the event $S$ = "The number formed is a palindrome".
- c) Describe the event $M$ = "The number formed is a multiple of $5$ and greater than $700$".
A teenager decides to organize their playlist for studying. They have $3$ Lo-fi* songs, $2$ Jazz* songs and $2$ Indie* songs. The experiment consists of choosing two…
A teenager decides to organize their playlist for studying. They have $3$ Lo-fi songs, $2$ Jazz songs and $2$ Indie songs. The experiment consists of choosing two songs at random, one after the other, without repetition (without replacement).
- a) Represent the experiment using a tree diagram, indicating on each branch the possible resulting genres.
- b) Find the total number of possible outcomes in the sample space (considering the songs as distinguishable elements).
- c) Describe the compound event "The two chosen songs are of different genres".
In a genetics laboratory, the mutation of a DNA strand represented by four consecutive nitrogenous bases $\{A, C, G, T\}$ is studied. The experiment consists of…
In a genetics laboratory, the mutation of a DNA strand represented by four consecutive nitrogenous bases $\{A, C, G, T\}$ is studied. The experiment consists of observing a sequence of length 3. The following events are considered:
-
$M$: "The strand contains at least one $G$ base".
-
$N$: "The strand starts with $A$ or ends with $T$".
Determine the number of elements in the following events using counting techniques:
-
$M \cap N$
-
$\overline{M} \cup N$
-
$\overline{M \cup N}$
Explain with reasons whether the set of events $\{M \cap N, \overline{M} \cap N, M \cap \overline{N}, \overline{M \cup N}\}$ forms a partition of the sample space $E$.
Consider a random experiment whose sample space is the set of positive integers, $E = \{1, 2, 3, \dots\}$. We define the events:…
Consider a random experiment whose sample space is the set of positive integers, $E = \{1, 2, 3, \dots\}$. We define the events:
$A_k = \{x \in E \mid x \text{ is a multiple of } k\}$ for each $k \in \{2, 3, 5\}$.
Express the following events in terms of $A_2$, $A_3$ and $A_5$, and determine their five smallest elements:
- a) "The number is a multiple of 2 and of 3, but not of 5".
- b) "The number is a multiple of only one of the three values $\{2, 3, 5\}$".
- c) "The number is not a multiple of any of the three values".
A robotic parcel sorting system makes errors randomly. By analysing the history of 1 000 parcels, the following events are defined: $A$: "The parcel has an incorrect…
A robotic parcel sorting system makes errors randomly. By analysing the history of 1 000 parcels, the following events are defined:
-
$A$: "The parcel has an incorrect weight".
-
$B$: "The parcel has an illegible barcode".
-
$C$: "The parcel has been sent to a wrong route".
It is known that no parcel has all three errors simultaneously ($A \cap B \cap C = \emptyset$). If we denote by $n(X)$ the number of parcels in event $X$, the following hold:
$n(A) = 45$, $n(B) = 38$, $n(C) = 22$, $n(A \cap B) = 12$, $n(A \cap C) = 8$ and $n(B \cap C) = 5$.
Calculate the number of elements in the following events and express them using set operations:
-
$(\overline{A \cup B}) \cap C$
-
$(A \cap \overline{B}) \cup (B \cap \overline{A})$
-
$\overline{A} \cap \overline{B} \cap \overline{C}$
A random experiment is carried out consisting of throwing a dart at a circular target of radius $R$. The result of the experiment is the distance $d$ from the center of…
A random experiment is carried out consisting of throwing a dart at a circular target of radius $R$. The result of the experiment is the distance $d$ from the center of the target to the point of impact. We define the events:
-
$S_1$: "The dart hits at a distance $d < \frac{R}{3}$".
-
$S_2$: "The dart hits at a distance $\frac{R}{4} < d < \frac{2R}{3}$".
Using interval notation for the value of $d$:
-
Define the sample space $E$.
-
Determine the intervals corresponding to the events $S_1 \cup S_2$, $S_1 \cap S_2$ and $S_1 - S_2$.
-
Find the complementary event of $S_1 \cup S_2$ and explain its physical meaning in the context of the game.
In an e-sports tournament, three players ($P_1, P_2, P_3$) face each other in "1 vs 1" knockout matches. The experiment consists of recording the winner of each match…
In an e-sports tournament, three players ($P_1, P_2, P_3$) face each other in "1 vs 1" knockout matches. The experiment consists of recording the winner of each match until a player wins two consecutive matches or a maximum of 4 matches have been played.
-
Draw the tree diagram representing this random experiment, knowing that in the first game $P_1$ plays against $P_2$, and the loser is replaced by the waiting player ($P_3$).
-
Write down explicitly all the elements of the sample space $E$.
-
Define event $X$: "Player $P_3$ plays at least two games" and event $Y$: "The tournament ends in the third game". Are $X$ and $Y$ mutually exclusive events? Justify your answer by analysing their intersection.
You can do it on paper and send a photo with your answer.
A cybersecurity company analyses access attempts to a server. Consider the sample space $\Omega$ made up of all possible access attempts, which are classified by their…
A cybersecurity company analyses access attempts to a server. Consider the sample space $\Omega$ made up of all possible access attempts, which are classified by their state as: $L$ (Legitimate), $S$ (Suspicious) and $M$ (Malicious). It is known that an automatic filtering system classifies access attempts into two categories: $F$ (Filtered) and $P$ (Allowed).
Using Venn diagrams, represent the situation and define the following events symbolically:
- a) The access attempt is malicious or suspicious, but has been allowed.
- b) The access attempt is not malicious and has been filtered.
- c) De Morgan's second law holds for the events "Malicious Access" ($M$) and "Filtered Access" ($F$).