Let's start with the experiment of throwing a sixsided dice and looking at what number turns out. We can represent its sample space by $$\Omega=\lbrace 1,2,3,4,5,6 \rbrace$$.
Let's consider two events: $$A =$$ "to extract an even number", $$B =$$ "to extract the number $$4$$ or higher". As we already know , the set of results that fulfill $$A$$ and $$B$$ is, respectively, $$A= \lbrace 2, 4, 6 \rbrace$$, $$B=\lbrace 4 , 5 , 6 \rbrace$$.
We can consider the following operations between two events: union, intersection, difference and complementary.
Let's see what they mean in our example.
The union of $$A$$ and $$B$$, which is written as "$$A$$ or $$B$$", or $$$A\cup B$$$ is the event formed by all the results that satisfy $$A$$ or $$B$$. In our case, it would be the event $$C =$$ "to extract an even number or a number higher than $$4$$". If we represent it as the set of possible results, $$C= \lbrace 2, 4, 5, 6 \rbrace$$, which are all the results that satisfy one of the two events.
It can be useful to express it with the sets notation since the union of $$A$$ and $$B$$ is, in fact, $$$A \cup B= \lbrace 2, 4, 6 \rbrace \cup \lbrace 4, 5, 6 \rbrace = \lbrace 2, 4, 5, 6 \rbrace$$$.
The intersection of $$A$$ and $$B$$, which we write as "$$A$$ and $$B$$", or $$$A\cap B$$$ is the event formed by all the results that satisfy $$A$$ and $$B$$. In our case, it would be the event $$C =$$ "to extract an even and higher than or equal to $$4$$ number". If we represent it as the set of possible results, $$C=\lbrace 4, 6 \rbrace$$, which are all the results that satisfy both events simultaneously.
As before, if we express it as operations between sets, the intersection of $$A$$ and $$B$$ is in fact $$$A \cap B= \lbrace 2, 4, 6 \rbrace \cap \lbrace 4, 5, 6 \rbrace = \lbrace 4, 6 \rbrace$$$.
The difference of $$A$$ and $$B$$, which we write as $$$AB$$$ is the event formed by all the results that satisfy $$A$$, but do not satisfy $$B$$. In our case, it would be the event $$C =$$"to extract an even number, but not higher than or equal to $$4$$", or what amounts to the same, $$C =$$ "to extract an even number smaller than $$3$$".
We can see that $$C=\lbrace 2 \rbrace$$, since it is the only result that satisfies both conditions. The fact that there are two different ways of writing $$C$$ is not a coincidence; in fact, it is always satisfied that $$AB=A\cap \overline{B}$$.
With sets, the difference between $$A$$ and $$B$$ is $$$AB= \lbrace 2, 4, 6 \rbrace  \lbrace 4, 5, 6 \rbrace = \lbrace 2 \rbrace$$$
Sometimes we can also find it written as $$A$$ \ $$B$$. To calculate this, it is as if we remove from $$A$$ all the results that there are in $$B$$. We must be careful because $$A  B$$ is not the same that $$B  A$$.
In our case, $$B  A = \lbrace 5 \rbrace$$, which is the only result that is in $$B$$, but is not in $$A$$.
Finally, there is the complementary or the opposite of $$A$$ . If our event is $$A$$, we write the opposite event as $$$\overline{A}$$$ which is formed by all the elementary events that do not satisfy $$A$$.
In our case $$\overline{A}=$$"be an odd number"$$=\lbrace 1,3,5 \rbrace$$. With the notation on theory of sets, we calculate the complementary by means of $$$\overline{A}=\OmegaA$$$
That is to say, the complementary of an event $$A$$ is, as a matter of fact, the difference between $$\Omega$$ and $$A$$: all the elementary events except those that satisfy $$A$$.
As a result of our definition, we see clearly that the opposite event of an impossible event is a sure event since if $$C=\emptyset$$, that is to say, the event $$C$$ is impossible, then $$\overline{C}=\Omega$$, and vice versa, the opposite of a sure event is an impossible event, since if $$D$$ is a sure event, that is to say $$D=\Omega$$, then $$\overline{D}=\emptyset$$.
Properties of operations between events
Next, we highlight a series of properties of the sets that can turn out to be useful to us concerning probability.
 Commutative:
$$A \cup B = B \cup A$$
$$A \cap B = B \cap A$$
 Associative:
$$(A \cup B)\cup C = A \cup (B \cup C)$$
$$(A \cap B)\cap C = A \cap (B \cap C)$$
For this reason, when we only have unions or intersections, we are not used to using brackets since there is no risk of confusion.
 Idempotence:
$$A \cup A=A$$
$$A \cap A=A$$
 Simplificative:
$$A \cup (A \cap B) = A$$
$$A \cap (A \cup B)=A$$
 Distributive:
$$A \cup (B \cap C) = (A \cup B)\cap(A \cup C)$$
$$A \cap (B \cup C) = (A \cap B)\cup(A \cap C)$$
 Neutral element:
$$A \cup \emptyset=A$$
$$A \cap \Omega=A$$
 Complementary:
$$A \cup \overline{A}=\Omega$$
$$A\cap\overline{A}=\emptyset$$
 Regression:
$$\overline{\overline{A}}=A$$, that is to say, the complementary one of the complementary of $$A$$ is $$A$$.
 De Morgan's Laws:
$$ \overline{A\cup B}=\overline{A}\cap\overline{B}$$
$$\overline{A\cap B}=\overline{A}\cup\overline{B}$$
Written like that, these properties seem difficult, but in fact, if you think about them a little bit, most of them will seem like a question of common sense to you.
The commutative property of the union is telling us that it is the same "to extract a number one or a number four" as it is "to extract a number four or a number one".
The complementary, with the intersection, tells us that "to extract three and not to extract three" is the impossible event, that is to say, that this can never happen. Logical, right?
The idempotency with the intersection only says that "to extract two and to extract two" is just "to extract two".
Do you dare to translate others? If you try it, you will see that in fact this table is not complicated.
In a meeting we have $$20$$ people, some of them are wearing glasses. Determine which results form the event "be a woman and not wear glasses, or to wear glasses".
We need to define, first of all, which ones are our possible results .
For example, we can suppose that they are, on one hand, $$H=$$"to be a man" and $$M=$$"to be a woman" and on the other hand, $$G=$$"to wear glasses" and $$NG=$$"not to wear glasses".
In this case, our sample space is formed by $$$\Omega=\lbrace (H,G), (H,NG), (M,G), (M,NG) \rbrace$$$
With this notation, the event "to be a woman and not wear glasses" $$=\lbrace (M, NG) \rbrace$$.
The event "to wear glasses"$$= \lbrace (H, G), (M, G) \rbrace$$, is formed by the men that wear glasses and the women wearing glasses. Then, the event union of "being a woman and not wearing glasses" or "wearing glasses" is formed by $$\lbrace (H,G), (M,G), (M,NG) \rbrace$$, that is to say, the only ones that do not satisfy the event are the men that do not wear glasses.
Let's have a look at that: in fact $$\overline{H}=M$$, and $$\overline{G}=NG$$, means that if someone is not a man, then it is a woman, and the opposite of wearing glasses is not wearing glasses.
For this reason, we could also have described our sample space like $$$\Omega=\lbrace (H,G), (H,\overline{G}), (\overline{H},G), (\overline{H},\overline{G}) \rbrace$$$
An urn contains three red balls and two blue balls. We extract two balls; we take one at a time, look at its color, then put it back before taking out the second ball.

Define what possible results satisfy the event "to extract one red ball and one blue ball, no matter in what order". Verify that this event coincides with the intersection of "to extract a red ball" and "to extract a blue ball"
 Define which results satisfy the event "to extract a red ball the first time, or a blue ball the second time". Verify that this event coincides with the union of "to extract a red ball the first time" or "to extract a blue ball the second time".
That is a frequent kind of experiment, which is related to combinatorial analysis.
1
First, let's analyze what happens when the order does not matter to us. Every time that we extract a ball, it can be a red ball $$(R)$$, or a blue ball $$(B)$$. Then, we can consider that our sample space is $$\Omega=\lbrace \{R,R\}, \{R,B\}, \{B,B\} \rbrace$$. In that case, the possible result that satisfies the statement is $$\{R,B\}$$.
Let’s now see that the event "to extract a red ball and a blue one" matches up with the intersection of the events "to extract a red ball" (in either one of the two extractions) and "to extract a blue ball" (also in any of the extractions). The results that satisfy the event "to extract a red ball" are $$\{\{R,R\} , \{R,B\}\}$$. The results that satisfy the event "to extract a blue ball" are $$\{\{R,B\} , \{B,B\}\}$$. The event intersection is formed by those that satisfy both events simultaneously, that is to say, only $$\{R,B\}$$.
This is not the only way to solve this section . We can also think that the results are arranged, and then see which ones satisfy the statement. If we consider the results in order, then our sample space is
$$\Omega=\{ (R,R), (R,B), (B,R), (B,B)\}$$, in short, we usually write it as $$\Omega=\{RR,RB,BR,BB\}$$. Then, the possible results that satisfy the statement are $$RB$$ and $$BR$$.
In this case, the event "extract a red ball" $$=\{RR, RB, BR \}$$. The event "extract a blue ball"$$=\{ RB, BR, BB \}$$. The event intersection is formed by the events that satisfy both. In this case, the common events are $$\{RB, BR\}$$, as we have seen before.
2
Now let's think about what happens when the order IS important. In this case, we need to know in what order we have extracted the balls, therefore we have to write the space muestral as $$\Omega=\{RR, RB,BR,BB\}$$. The results that satisfy "to extract a red ball the first time, or a blue one the second one" are: $$RR, RB, BB$$.
Let’s now see what the event "to extract a red ball at the first time" $$=\{ RR, RB \}$$. And the event "to extract a blue ball the second time"$$=\{ RB, BB\}$$. Therefore, the event union of both is the set formed by those that satisfy one or the other, that is to say, "extracts a red ball the first time, or the blue one the second one"$$=\{ RR, RB, BB \}$$, as we have seen before.