Relations

Relations

A binary relation RR on sets AA and BB is a subset RA×BR \subseteq A \times B. This takes the form of a set of tuples (a,b)(a,b) with aAa \in A and bBb \in B. It is also sometimes written as aRbaRb.

Given sets A1,...,AnA_1 \\, ... \\, A_n, a subset RA1×...×AnR \subseteq A_1 \times ... \times A_n is a n-ary relation.

Relation composition

Let RB×CR \subseteq B \times C and SA×BS \subseteq A \times B. The composition relation (RS)A×C(R \circ S) \subseteq A \times C is (a,c)  b (a,b)S(b,c)R\\{(a,c) \space | \space \exists b \space (a,b) \in S \land (b,c) \in R\\}.

If there is a relation (a,b)S(a,b) \in S and a relation (b,c)R(b,c) \in R where the bb in SS is the same as the bb in RR, then we have a relation (a,c)RS(a,c) \in R \circ S.

Unlike function composition, there can be more than one element used to get from aa to cc. For example, (a,d)S(a,d) \in S and (d,c)R(d,c) \in R also leads to (a,c)RS(a,c) \in R \circ S.

Suppose RR is a relation on AA, (RA×A)(R \subseteq A \times A). This means:

  • R0R^0 is the identity relation
  • Rn+1=RnRR^{n+1} = R^n \circ R
  • R=n0RnR^* = \bigcup_{n \ge 0} R^n

Equivalence relations

Some properties of a binary relation on AA might include:

  • Reflexive
    iff xA(x,x)R\forall x \in A \quad (x,x) \in R

  • Symmetric
    iff x,yA((x,y)R(y,x)R)\forall x,y \in A \quad ((x,y) \in R \to (y,x) \in R)

  • Antisymmetric
    iff x,yA(((x,y)R(y,x)R)x=y)\forall x,y \in A \quad (((x,y) \in R \land (y,x) \in R) \to x = y)

  • Transitive
    iff x,y,zA(((x,y)R(y,z)R)(x,z)R)\forall x,y,z \in A \quad (((x,y) \in R \land (y,z) \in R) \to (x,z) \in R)

A relation RR on a set AA is an equivalence relation iff it is reflexive, symmetric and transitive.

Let RR be an equivalence relation on set AA and aAa \in A. Let [a]R=s(a,s)R[a]_R = \\{s | (a,s) \in R\\} be the equivalence class of aa with respect to RR. If b[a]Rb \in [a]_R then bb is called a representitive of the equivalence class.

Following from this, the following 3 statements are equivalent:

  • aRbaRb
  • [a]R=[b]R[a]_R = [b]_R
  • [a]R[b]R,/=[a]_R \cap [b]_R \mathrlap{\\,/}{=} \empty

Sequences

Sequences are ordered lists of elements. A sequence over a set SS is a function ff from a subset of the integers (typically N\Bbb{N} or Z+\Bbb{Z}^+) to the set SS. If the domain of ff is finite then the sequence is finite.

Progressions

An arithmetic progression is of the form:

a,a+d,a+2d,...,a+nd,...a, a+d, a+2d, ... , a+nd, ...

A geometric progression is of the form:

a,ar,ar2,...,arn,...a, ar, ar^2, ... , ar^n, ...

Where the initial element aa, common difference dd, and common ratio rr are all real numbers.

Recurrence relations

A recurrence relation for an\\{a_n\\} is an equation that expresses ana_n in terms of one or more of the elements a0,a1,...,an1a_0, a_1, ... , a_{n-1}. Typically it just expresses ana_n is terms of a fixed number of previous elements. The initial conditions specify the first elements of the sequence before the recurrence relation applies. A sequence is a solution of a recurrence relation iff its terms satisfy the relation.

Compound interest

In general, compound interest can be written as a recurrence relation.

Pn=(i)nP0P_n = (i)^n P_0

Where PnP_n is the value after nn years, P0P_0 is the initial value and ii is the interest rate as a decimal.