✖

Session

Kapitoly: Session, Operations with relations, Binary Sessions, Binary relations on a set, Equivalence relations, Session ordering, Associations

A relation is such a mathematical counterpart to the normal concept of "relationship". In normal life, for example, Monika is in a relationship with Jitka, specifically a mother-daughter relationship. Another such relation can be "state - capital of this state". As an example we can take Egypt - Cairo.

Other examples of relationships

Let us take other examples to help us. In the introduction we mentioned the sessions (relations) "being a mother to her daughter" and "being the capital of a state". Let's look at others: "being an even number". In this session there are the numbers 2, 4, 8, 18, 58, 66 and many others. The numbers 1, 3, −7, 19 are not in the "being an even number" session. A session from the ordinary world might be "being a man". Adam, Miroslav, Luke, or Martin are in the "being a man" session.

Another example might be a "less than" session. For example, the number three is "less than" the number five. Mathematically, we can write this as 3<5. Or an equality relation: the number three "is equal to" the number three, mathematically: 3 = 3.

We can have more complicated examples: "the father and mother are the parents of the child". In this session, there will be a trio of people: the father Daniel, the mother Mary, and the child Krasomila. In mathematics, we could invent a three-element relation like this: the sum of the first two numbers equals the third number. For example, these numbers, in this order, are in this relation: 3, 4, 7, because 3 + 4 = 7. These numbers are not in the relation: 3, 5, 12, because 3 + 5≠12.

Arity session

Arity is a strange-sounding term, but it only describes how many elements we have in a session. In the previous examples, we worked with different numbers of elements. In the "being a man" session we have made do with one element, so we can say "Honza is a man". We just need one name, one element. We call such a session unary.

In the next example, we had a "less than" session. It worked with two numbers, two elements. We said the number three is less than five. We used two elements, so the session is binary.

In the last example, we used a total of three elements: the sum of two numbers should equal the third. So we had the numbers a, b, c and it had to be true that a + b = c. This session would be ternary.

For higher arity we can use the notation n-ary session. But we can also use it for lower arity, we can write the binary session as a 2-ary session. We then write the elements of the session as ordered n-tic. If we have a binary session, we write them as pairs, usually using either square brackets or pointed brackets. So if we want to write that the numbers three and five are "less than" in a session, we have to write the numbers as pairs: [3, 5], or <3, 5>. Note that we have to pay attention to the order, the reverse would not be true: [3, 5] ≠ [5, 3] -five is not less than three.

Family example

Before we get into mathematical definitions, let's try one more typical example with a family. Let's have the following members of one family:

  • Max: paternal grandfather;
  • Joseph: father;
  • Drahoslava: mother;
  • Sandra: daughter;
  • Honza: son.

First we look for all family members who match the relation "to be a man". This is the 1-ary, or unary, relation. Therefore, there will always be only one element, one member of the family. At this point, we need to list all family members who are male. Now the order does not matter. Thus, the session "being male" contains the following elements: {[Max], [Josef], [Honza]}. Note that even though this is a unary session, we have used square brackets. This is not strictly necessary, even without them the notation would be readable, but for the sake of consistency I have left the brackets in. The set of all elements of the session is then a regular set, hence the square brackets.

Now let's look up all the "father-son" sessions. This is already a binary session from the look of it, there will be ordered pairs of elements in the result. The resulting set looks like this: {[Josef, Honza], [Max, Josef]}. Father Joseph is the father of son Honza and grandfather Max is the father of father Joseph. Note that it really depends on the order, Joseph is there twice, but once in the first position in the position of the father and the second time in the second position in the position of the son.

Let's try one more session: parent-child. Here there is more, because in the first position there can be any parent, both father and mother, and in the second position there can be any child, both son and daughter. We must also take into account that Grandfather Maximilian is the parent of Joseph, but is no longer the parent of Drahoslava. Joseph and Drahoslava are, however, both parents of Sandra and Honza. Sandra and Honza are not the parents of anyone because they are only nineteen and thirteen years old. As a result, the following will be the arranged pairs: {[Max, Josef], [Josef, Sandra], [Josef, Honza], [Drahoslava, Sandra], [Drahoslava, Honza]}. Note that both Josef and Drahoslava are there twice - once as parents of Sandra's daughter and the second time as parents of Honza.

One last peak at the binary sessions. Let's have this "sibling-sibling" session. Here we have to note that the order matters for the sessions, so if we only wrote "Sandra - Honza" in the result of this session, it would be wrong, because it is a completely different ordered pair than "Honza - Sandra". Therefore, the correct result is: {[Sandra, Honza], [Honza, Sandra]}.

And a short example on a ternary session: write all the ordered triples of this session: 'grandfather - father - child'. In the assignment we have only one grandfather and one father, but two offspring. It is not enough to write only the variation with Sandra or with Honza, we have to list them both. It would be different if we put "son" at the end instead of "child". The correct result is: {[Max, Josef, Sandra], [Max, Josef, Honza]}.

Definition of unary session

Let's try to examine the simplest session, the unary one. By unary relation we mean some set of elements. The set {2, 3} can represent some session. For example, the relation "to be a prime number less than five" or "to be a non-trivial divisor of six", depending on our interpretation.

Astute readers will have noticed that the second session is defined a bit oddly. It says that the session should contain non-trivial divisors of six, and in the resulting set we have the numbers 2 and 3. Aren't we missing any? The numbers 1 and 6 are trivial divisors, we don't care about those. But there should be negative numbers, so −2 and −3. The set of all non-trivial divisors of 6 looks like this: {−3, −2, 2, 3}.

Just as we specify a defining domain for functions, we specify a support set for a session - the set from which we select the elements of the session. In the previous examples, for example, we specified the family where Grandpa Max was, etc. We did not select fathers and children from all families in the world. If we specify the set of natural numbers as the support set, then our session will be fine.

At this point, we can get down to defining the session. If we have a support set of natural numbers, what elements can our unary session contain? Again, just the natural numbers. Either all of them or just a subset. So we can say that a given session will be a subset of the set of natural numbers. More generally, if we have a unary session R and a support set M, then R ⊆ M, the session R is a subset of the set M.

Definition of a binary session

What does it look like for a binary session? For a binary session, the elements of the session R are ordered pairs. Each element of the pair can be from a different set. We can have a "parent - number of children" session. The parent will be chosen from the set of people, say in Europe, and the number of children will be chosen from the set of natural numbers plus zero.

How do we get the set of all possible pairs from the two sets? By using the Cartesian product. If we have the sets A = {a, b, c}, B = {1, 2}, then by the Cartesian product we get:

$$A\times B=\left\{[a, 1], [a, 2], [b, 1], [b, 2], [c, 1], [c, 2]\right\}$$

This is the set of all possible pairs that we can get by putting an element from the set A in the first place and an element from the set B in the second place. Thus, if we have a binary relation R between the sets A and B, then we can define this relation as R ⊆ A × B.

If we keep the previous sets A and B and define the session R between these sets as "letter - order of the letter in the alphabet", then this session will look like: R = {[a, 1], [b, 2]}. The letter c will no longer be there because the Cartesian product A × B does not contain the pair [c, 3].

Definition of n-ary session

Finally, we define the general n-ary relation R between the sets M1, M2, …, Mn:

$$R\subseteq M_1\times M_2\times\ldots\times M_n$$

A session is thus a subset of ordered n-tic. An example of a binary relation can be a "less than" relation, or <. We can define this between some numerical domains, such as the natural numbers. Then the session will look like this:

$$< \subseteq \mathbb{N}\times\mathbb{N}$$

(Don't be alarmed that the < tag is so strangely on the left-hand side. It's just the name of the session. It could again be R, where R would represent a session less than.)

Specifically, the session would look like this:

$$\begin{eqnarray} <\quad=&&[1, 2], [1, 3], [1, 4], [1, 5], \ldots\\ &&[2, 3], [2, 4], [2, 5], [2, 6], \ldots\\ &&[3, 4], [3, 5], [3, 6], [3, 7], \ldots\\ &&[4, 5], [4, 6], [4, 7], [4, 8], \ldots\\ &&\ldots\\ && \end{eqnarray}$$

It is the set of ordered pairs such that the natural number in the first place is less than the natural number in the second place.

Session notation

We usually name a session with capital letters R, S, etc. or with familiar symbols: <, ⊆, = , etc. From the previous definitions, we can see that a session is actually a set. After all, almost everything in mathematics is actually a set :-). Therefore, if we want to say that the element r belongs to the session R, we can write it as r ∈ R.

For example, we can write [1, 3] ∈ < and it means that the pair of numbers one and three belongs to the less-than session. For binary sessions, we often encounter the more pleasant notation that you know from elementary school. Instead of using the operator to be an element of ∈, we simply write 1 < 3. Similarly, we don't usually write [5, 5] ∈ = , but write 5 = 5.