Definition

Let (S) be a non-empty set. Then any subset (R) of (S imes S) is said to be a relation over (S). In other words, a relation is a rule that is defined between two elements in (S). Intuitively, if (R) is a relation over (S), then the statement (a R b) is either ** true** or **false **for all (a,bin S).

Example (PageIndex{1}):

Let (S={1,2,3}). Define (R) by (a R b) if and only if (a < b), for (a, b in S).

Then (1 R 2, 1 R 3, 2 R 3 ) and ( 2 ot R 1).

We can visualize the above binary relation as a graph, where the vertices are the elements of *S, and *there is an edge from (a) to (b) if and only if (a R b) *, for *(a,bin S).

The following are some examples of relation defined on (mathbb{Z}).

Example (PageIndex{2}):

- Define (R) by (a R b) if and only if (a < b), for (a, b in mathbb{Z}).
- Define (R) by (a R b) if and only if (a >b), for (a, b in mathbb{Z}).
- Define (R) by (a R b) if and only if (a leq b), for (a, b in mathbb{Z}).
- Define (R) by (a R b) if and only if (a geq b), for (a, b in mathbb{Z}).
- Define (R) by (a R b) if and only if (a = b), for (a, b in mathbb{Z}).

Next, we will introduce the notion of "divides".

Definition

Let ( a) and (b) be integers. We say that (a) divides (b) is denoted (amid b), provided we have an integer (m) such that (b=am). In this case we can also say the following:

- (b) is divisible by (a)
- (a) is a factor of (b)
- (a) is a divisor of (b)
- (b) is a multiple of (a)

Example (PageIndex{3}):

(4 mid 12) and (12 otmid 4)

Theorem (PageIndex{1}): Divisibility inequality theorem

If (amid b), for (a, b in mathbb{Z_+}) then (a leq b),

**Proof**Let (a, b in mathbb{Z_+}) such that (amid b), Since (amid b), there is a positive integer (m) such that (b=am). Since (m geq 1) and (a) is a positive integer, (b=am geq (a)(1)=a. )

Note that if (amid b), for (a, b in mathbb{Z_+}) then (a leq b), but the converse is not true. For example: (2 <3), but (2 otmid 3).

Example (PageIndex{4}):

According to our definition (0 mid 0).

Definition

An integer is even provided that it is divisible by (2).

## Properties of binary relation:

Definition

Let (S) be a set and (R) be a binary relation on (S). Then (R) is said to be reflexive if ( a R a, forall a in S.)

Example (PageIndex{5}): Visually

(forall a in S, a R a) holds.

We will follow the template below to answer the question about reflexive.

Example (PageIndex{6}):

Define (R) by (a R b) if and only if (a < b), for (a, b in mathbb{Z}). Is (R) reflexive?

__Counter Example:__

Choose (a=2.)

Since ( 2 ot< 2), (R) is not reflexive.

Example (PageIndex{7}):

Define (R) by (a R b) if and only if (a mid b), for (a, b in mathbb{Z}). Is (R) reflexive?

**Proof:**

Let ( a in mathbb{Z}). Since (a=(1) (a)), (a mid a).

Thus (R) is reflexive. ( Box)

Definition

Let (S) be a set and (R) be a binary relation on (S). Then (R) is said to be symmetric if the following statement is true:

( forall a,b in S), if ( a R b ) then (b R a), in other words, ( forall a,b in S, a R b implies b R a.)

Example (PageIndex{8}): Visually

(forall a,b in S, a R b implies b R a.) holds!

We will follow the template below to answer the question about symmetric.

Example (PageIndex{7}):

Define (R) by (a R b) if and only if (a < b), for (a, b in mathbb{Z}). Is (R) symmetric?

**Counter Example:**

(1<2) but (2 ot < 1).

Example (PageIndex{8}):

Define (R) by (a R b) if and only if (a mid b), for (a, b in mathbb{Z}). Is (R) symmetric?

**Counter Example:**

(2 mid 4) but (4 ot mid 2).

Definition

Let (S) be a set and (R) be a binary relation on (S). Then (R) is said to be antisymmetric if the following statement is true:

( forall a,b in S), if ( a R b ) and (b R a), then (a=b).

In other words, ( forall a,b in S), ( a R b wedge b R a implies a=b.)

Example (PageIndex{9}): VISUALLY

( forall a,b in S), ( a R b wedge b R a implies a=b ) holds!

We will follow the template below to answer the question about anti-symmetric.

Example (PageIndex{10}):

Define (R) by (a R b) if and only if (a < b), for (a, b in mathbb{Z}). Is (R) antisymmetric?

Example (PageIndex{11}):

Define (R) by (a R b) if and only if (a mid b), for (a, b in mathbb{Z_+}). Is (R) antisymmetric?

Definition

Let (S) be a set and (R) be a binary relation on (S). Then (R) is said to be transitive if the following statement is true

( forall a,b,c in S,) if ( a R b ) and (b R c), then (a R c).

In other words, ( forall a,b,c in S), ( a R b wedge b R c implies a R c).

Example (PageIndex{12}): VISUALLY

( forall a,b,c in S), ( a R b wedge b R c implies a R c) holds!

We will follow the template below to answer the question about transitive.

Example (PageIndex{13}):

Define (R) by (a R b) if and only if (a < b), for (a, b in mathbb{Z}). Is (R) transitive?

Example (PageIndex{14}):

Define (R) by (a R b) if and only if (a mid b), for (a, b in mathbb{Z_+}). Is (R) transitive?

Summary:

In this section we learned about binary relation and the following properties:

Reflexive

Symmetric

Antisymmetric

Transitive

## Binary Relations (Types and Properties)

In this article, I discuss binary relations. I first define the composition of two relations and then prove several basic results. After that, I define the inverse of two relations. Then the complement, image, and preimage of binary relations are also covered.

Let $X$ be a set and let $X imes X=<(a,b): a,b in X>.$ A (binary) relation $R$ is a subset of $X imes X$. If $(a,b)in R$, then we say $a$ is ** related** to $b$ by $R$. It is possible to have both $(a,b)in R$ and $(a,b’)in R$ where $b’
eq b$ that is any element in $X$ could be related to any number of other elements of $X$. It is also possible to have some element that is not related to any element in $X$ at all.

** Definition**. Let $R$ and $S$ be relations on $X$. The

**of $R$ and $S$ is the relation $Scirc R =<(a,c)in X imes X : exists , bin X, (a,b)in R land (b,c)in S>.$**

*composition*Compositions of binary relations can be visualized here.

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $Rcirc (Scirc T)=(Rcirc S)circ T$.

** Proof**. The proof follows from the following statements. egin

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $Rcirc (Scup T)=(Rcirc S)cup (Rcirc T)$.

** Proof**. The proof follows from the following statements. egin

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $(Scup T)circ R=(Scirc R)cup (Tcirc R)$.

** Proof**. The proof follows from the following statements. egin

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $Rcirc (Scap T) subseteq (Rcirc S)cap (Rcirc T)$.

** Proof**. The proof follows from the following statements. egin

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $Rsubseteq S implies Rcirc T subseteq Scirc T$.

** Proof**. The proof follows from the following statements. egin

** Theorem**. If $R$, $S$ and $T$ are relations on $X$, then $Rsubseteq S implies Tcirc R subseteq Tcirc S$.

** Proof**. The proof follows from the following statements. egin

** Definition**. Let $R$ and $S$ be relations on $X$. The

**of $R$ is the relation $R^<-1>=<(b,a)in X imes X : (a,b)in R>.$**

*inverse*** Theorem**. If $R$ and $S$ are relations on $X$, then $(R^<-1>)^<-1>=R$.

** Proof**. $ (x,y)in (R^<-1>)^ <-1>Longleftrightarrow (y,x)in R^ <-1>Longleftrightarrow (x,y)in R $

** Theorem**.If $R$ and $S$ are relations on $X$, then $(Rcup S)^<-1>=R^<-1>cup S^<-1>$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$, then $(Rcap S)^<-1>=R^<-1>cap S^<-1>$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$, then $(Rcirc S)^<-1>=S^<-1>circ R^<-1>$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$, then $Rsubseteq S implies R^<-1>subseteq S^<-1>$.

** Proof**. If $Rsubseteq S$, then $R^<-1>subseteq S^<-1>$. egin

** Theorem**. If $R$ and $S$ are relations on $X$, then $(R^c)^<-1>=(R^<-1>)^c$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$, then $(Rsetminus S)^<-1>=R^<-1>setminus S^<-1>$.

** Proof**. egin

** Definition**. Let $R$ and $S$ be relations on $X$. The

**of $Asubseteq X$ under $R$ is the set $R(A)=**

*image*

** Theorem**. If $R$ and $S$ are relations on $X$ and $A, Bsubseteq X$, then $Asubseteq B implies R(A)subseteq R(B)$.

** Proof**. If $Asubseteq B$, then $R(A)subseteq R(B)$. egin

** Theorem**. If $R$ and $S$ are relations on $X$ and $A, Bsubseteq X$, then $R(Acup B)=R(A)cup R(B)$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$ and $A, Bsubseteq X$, then $R(Acap B)subseteq R(A)cap R(B)$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$ and $A, Bsubseteq X$, then $R(A)setminus R(B)subseteq R(Asetminus B)$.

** Proof**. egin

** Theorem**. If $R$ and $S$ are relations on $X$ and $R(x)=S(x)$ for all $xin X$, then $R=S$.

** Proof**. Assume $R(x)=S(x)$ for all $xin X$, then $ (x,y)in R Longleftrightarrow yin R(x) Longleftrightarrow yin S(x) Longleftrightarrow (x,y)in S $ completes the proof.

** Definition**. Let $R$ and $S$ be relations on $X$. The

**of $Bsubseteq X$ under $R$ is the set $R^<-1>(B)=**

*preimage*

** Theorem**. Let $R$ be a relation on $X$ with $A, Bsubseteq X$. Then $Asubseteq B implies R^<-1>(A)subseteq R^<1->(B)$.

** Proof**. egin

** Theorem**. Let $R$ be a relation on $X$ with $A, Bsubseteq X$. Then $R^<-1>(Acup B)=R^<-1>(A)cup R^<-1>(B)$.

** Proof**. egin

** Theorem**. Let $R$ be a relation on $X$ with $A, Bsubseteq X$. Then $R^<-1>(Acap B)subseteq R^<-1>(A)cap R^<-1>(B)$.

** Proof**. egin

** Theorem**. Let $R$ be a relation on $X$ with $A, Bsubseteq X$. Then $R^<-1>(A)setminus R^<-1>(B)subseteq R^<-1>(Asetminus B)$.

** Proof**. egin

** Theorem**. Let $R$ and $R_i$ be relations on $X$ for $iin I$ where $I$ is an indexed set. Then $Rcirc left(igcup_

** Proof**. egin

** Theorem**. Let $R$ and $R_i$ be relations on $X$ for $iin I$ where $I$ is an indexed set. Then $left(igcup_

** Proof**. egin

** Theorem**. Let $R$ be a relation on $X$. Then $(R^n)^<-1>=(R^<-1>)^n$ for all $ngeq 1$.

** Proof**. By induction. The basis step is obvious: $(R^<1>)^<-1>=(R^<-1>)^1$. In fact, $(R^2)^<-1>=(Rcirc R)^<-1>=R^<-1>circ R^<-1>=(R^<-1>)^2$. The induction step is $(R^n)^<-1>=(R^<-1>)^nimplies (R^

** Theorem**. Let $R$ be a relation on $X$. Then $left( igcup_

** Proof**. egin

** Theorem**. Let $R$ be a relation on $X$. Then $R^n cup S^nsubseteq (Rcup S)^n$ for all $ngeq 1$.

** Proof**. The basis step is obvious. The induction step is: $R^n cup S^nsubseteq (Rcup S)^n implies R^

** Theorem**. Let $R$ be a relation on $X$. Then $(x,y)in R^n$ if and only if there exists $x_1, x_2, x_3, ldots, x_

** Proof**. Bases case, $i=1$ is obvious. We assume the claim is true for $j$. Then egin

(try using the X 2 tag just above the Reply box )

You've made it really long.

Hint: how many pairs are there in A? And how many are there in T t ?

(try using the X 2 tag just above the Reply box )

You've made it really long.

Hint: how many pairs are there in A? And how many are there in T t ?

i dont totally understand the question, but looking at your equivalence realtion, along with Tiny Tim's comments:

first, there's more than 4 pairs that can be made from A, & more than 8 in T^t

Let T = <(0,2), (1,0), (2,3), (3,1)>

then the way i read it, following through T gives: 0

1, so everything is equivalant in the transitive closure (ie contains all binary pairs).

uhh? you found *12* in T t .

And A has 4 elements, so how many different pairs of elements are there (counting, for example, <0,3>and <3,0>as the *same* pair).

(if you can't *calculate* it, then just *list* them )

uhh? you found *12* in T t .

And A has 4 elements, so how many different pairs of elements are there (counting, for example, <0,3>and <3,0>as the *same* pair).

(if you can't *calculate* it, then just *list* them )

Sorry, meant 12 elements in T t

I still don't follow. Why would <0,3>and <3,0>be the same?

OK By defintion:

The transitive closure of T is the binary relation T t on A that satisfies the following three properties:

1. T t is transitive.

2. T is a subset of T t .

3. If S is any other transitive relation that contains T, then T t is a subset of S.

## Contents

A *binary relation* *R* over sets *X* and *Y* is a subset of X × Y . *X* is called the *domain* [1] or *set of departure* of *R*, and the set *Y* the *codomain* or *set of destination* of *R*. In order to specify the choices of the sets *X* and *Y*, some authors define a *binary relation* or *correspondence* as an ordered triple (*X*, *Y*, *G*) , where *G* is a subset of X × Y *graph* of the binary relation. The statement ( x , y ) ∈ R *x* is *R*-related to *y*" and is denoted by *xRy*. [4] [5] [6] [note 1] The *domain of definition* or *active domain* [1] of *R* is the set of all *x* such that *xRy* for at least one *y*. The *codomain of definition*, *active codomain*, [1] *image* or *range* of *R* is the set of all *y* such that *xRy* for at least one *x*. The *field* of *R* is the union of its domain of definition and its codomain of definition. [10] [11] [12]

## Binary Relations

(2,3))

There is one that does not belong which is it. Are there others left out?

##### Elite Member

##### Elite Member

#### Devil2euz

##### New member

(2,3))

There is one that does not belong which is it. Are there others left out?

#### HallsofIvy

##### Elite Member

The ordered pairs from A= <1, 2, 3, 4>are <(1, 1), (1, 2). (1, 3), (1, 4). (2, 1). (2, 2). (2, 3), (2, 4). (3, 1), (3, 2), (3, 3), (3, 4). (4. 1), (4, 2), (4, 3), (4, 4)>. As pka said there are 16 of those- 4 that start with 1, 4 that start with 2, 4 that start with 3. and 4 that star with 4.

The "relation" "3a+ 5b is a prime number" consists of all those pairs, (a. b), that satisfy. The only way to do this is to actually calculate 3a+ 5b for each pair.

(1,1): 3(1)+ 5(1)= 8. That is not a prime number so (1, 1) is not in the relation.

(1,2) 3(1)+ 5(2)= 13. That **is** a prime number so (1, 2) is in the relation.

(1,3): 3(1)+5(3)= 18. That is not a prime number so (1, 3) is not in the relation.

## 1.7 Binary Relations

This is one of over 2,400 courses on OCW. Explore materials for this course in the pages linked along the left.

**MIT OpenCourseWare** is a free & open publication of material from thousands of MIT courses, covering the entire MIT curriculum.

**No enrollment or registration.** Freely browse and use OCW materials at your own pace. There's no signup, and no start or end dates.

**Knowledge is your reward.** Use OCW to guide your own life-long learning, or to teach others. We don't offer credit or certification for using OCW.

**Made for sharing**. Download files for later. Send to friends and colleagues. Modify, remix, and reuse (just remember to cite OCW as the source.)

#### About MIT OpenCourseWare

MIT OpenCourseWare is an online publication of materials from over 2,500 MIT courses, freely sharing knowledge with learners and educators around the world. Learn more »

© 2001&ndash2018

Massachusetts Institute of Technology

Your use of the MIT OpenCourseWare site and materials is subject to our Creative Commons License and other terms of use.

## Welcome!

This is one of over 2,400 courses on OCW. Explore materials for this course in the pages linked along the left.

**MIT OpenCourseWare** is a free & open publication of material from thousands of MIT courses, covering the entire MIT curriculum.

**No enrollment or registration.** Freely browse and use OCW materials at your own pace. There's no signup, and no start or end dates.

**Knowledge is your reward.** Use OCW to guide your own life-long learning, or to teach others. We don't offer credit or certification for using OCW.

**Made for sharing**. Download files for later. Send to friends and colleagues. Modify, remix, and reuse (just remember to cite OCW as the source.)

## Arbitrary Relations

From the definition of a binary relation, we can easily generalize it to that of an arbitrary relation. Since a binary relation involves two sets, an arbitrary relation involves an arbitrary collection of sets. More specifically, a *relation* R is a subset of some Cartesian product ( http://planetmath.org/GeneralizedCartesianProduct ) of a collection of sets. In symbol, this is

where each A i is a set, indexed by some set I .

From this more general definition, we see that a binary relation is just a relation where I has two elements. In addition, an *n -ary relation* is a relation where the cardinality of I is n ( n finite). In symbol, we have

It is not hard to see that any n -ary relation where n > 1 can be viewed as a binary relation in n - 1 different ways, for

R ⊆ A 1 × A 2 × ⋯ × A n = ∏ i = 1 j A i × ∏ i = j + 1 n A i , |

where j ranges from 1 through n - 1 .

A common name for a 3 -ary relation is a *ternary relation*. It is also possible to have a *1 -ary relation*, or commonly known as a *unary relation*, which is nothing but a subset of some set.

Following from the first remark from the previous section , relations of higher arity can be inductively defined: for n > 1 , an ( n + 1 ) -ary relation is a binary relation whose domain is an n -ary relation. In this setting, a “unary relation” and relations whose arity is of “arbitrary” cardinality are not defined.

A relation can also be viewed as a function (which itself is a relation). Let R ⊆ A := ∏ i ∈ I A i . As a subset of A , R can be identified with the characteristic function

where χ R ( x ) = 1 iff x ∈ R and χ R ( x ) = 0 otherwise. Therefore, an n -ary relation is equivalent to an ( n + 1 ) -ary characteristic function. From this, one may say that a 0 -ary, or a *nullary relation* is a unary characteristic function. In other words, a nullary relation is just a an element in < 0 , 1 >(or truth/falsity).

Q: compare and contrast serial processing operating system and simple batch processing operating system.

A: Answer: One of the main functionality of the Os is resource management. The resource may be hardwire.

Q: Three part question: 1) How does indexing work in terms of database management systems? 2) How does .

A: I have provided solution in step 2.

Q: Provide a reason to explain that requirements engineering and design are interlaced activities (rele.

A: Requirements engineering (RE) is the process of defining, documenting, and maintaining requirements .

Q: Write a program named CreateCustomerFile.java that allows you to create a file of customers (Custome.

A: Note: As you have asked multiple questions, as per our policy, we will solve the first question for .

Q: Write a program to find out the grade of a student based on the marks obtained in three subjects. Th.

A: As the programming language is not mentioned so, I am using C language to write a code. If you want .

Q: In MC68000, name addressing mode that are not allowed for destination, along with the reasons

A: When people say that they have built their own computer, what they really mean is they really mean i.

Q: Write in c programming language. Make class triangle having three sides as class members. Use parame.

A: C language is not an object oriented language so there is no concept of classes in C but C++ does ha.

Q: write a program c++ If money is left in a particular bank for more than 5 years, the bank pays inter.

A: Given: write a program c++ If money is left in a particular bank for more than 5 years, the bank pay.

Q: Write a function get_total_price(class_list) that takes in a list of class callnumbers and outputs t.

A: import catalog as catl#get total price methoddef get_total_price(class_list): #iterate through th.

## 2.1: Binary Relations - Mathematics

Definition (Union): The union of sets A and B , denoted by A B , is the set defined as

Example 1: If A = < 1, 2, 3 >and B = < 4, 5 >, then A B = < 1, 2, 3, 4, 5 >.

Example 2: If A = < 1, 2, 3 >and B = < 1, 2, 4, 5 >, then A B = < 1, 2, 3, 4, 5 >.

Note that elements are not repeated in a set.

Definition (Intersection): The intersection of sets A and B , denoted by A B , is the set defined as

Example 3: If A = < 1, 2, 3 >and B = < 1, 2, 4, 5 >, then A B = < 1, 2 >.

Example 4: If A = < 1, 2, 3 >and B = < 4, 5 >, then A B = .

Definition (Difference): The difference of sets A from B , denoted by A - B (or A B ), is the set defined as

Example 5: If A = < 1, 2, 3 >and B = < 1, 2, 4, 5 >, then A - B = < 3 >.

Example 6: If A = < 1, 2, 3 >and B = < 4, 5 >, then A - B = < 1, 2, 3 >.

Note that in general A - B B - A

Definition (Complement): For a set A , the difference U - A , where U is the universe, is called the complement of A and it is denoted by .

Thus is the set of everything that is not in A .

--> Definition (ordered pair): An ordered pair is a pair of objects with an order associated with them.

If objects are represented by x and y , then we write the ordered pair as ( x, y ) .

Two ordered pairs ( a, b ) and ( c, d ) are equal if and only if a = c and b = d . For example the ordered pair ( 1, 2 ) is not equal to the ordered pair ( 2, 1 ) .

Definition (Cartesian product): The set of all ordered pairs ( a, b ) , where a is an element of A and b is an element of B , is called the Cartesian product of A and B and is denoted by A B .

Example 1: Let A = <1, 2, 3>and B = . Then

A B = < ( 1, a ) , ( 1, b ) , ( 2, a ) , ( 2, b ) , ( 3, a ) , ( 3, b ) >.

Example 2: For the same A and B as in Example 1,

B A = < ( a, 1 ) , ( a, 2 ) , ( a, 3 ) , ( b, 1 ) , ( b, 2 ) , ( b, 3 ) >.

As you can see in these examples, in general, A B B A unless A = , B = or A = B .

Note that A = A = because there is no element in to form ordered pairs with elements of A .

The concept of Cartesian product can be extended to that of more than two sets. First we are going to define the concept of ordered n-tuple .

Definition (ordered n-tuple): An ordered n -tuple is a set of n objects with an order associated with them . If n objects are represented by x 1 , x 2 , . x n , then we write the ordered n -tuple as ( x 1 , x 2 , . x n ) .

Definition (Cartesian product): Let A 1 , . A n be n sets. Then the set of all ordered n -tuples ( x 1 , . x n ) , where x i A i for all i , 1 i n , is called the Cartesian product of A 1 , . A n , and is denoted by A 1 . A n .

Definition (equality of n -tuples): Two ordered n -tuples ( x 1 , . x n ) and ( y 1 , . y n ) are equal if and only if x i = y i for all i , 1 i n .

For example the ordered 3 -tuple ( 1, 2, 3 ) is not equal to the ordered n -tuple ( 2, 3, 1 ) .

Definition (binary relation):

A binary relation from a set A to a set B is a set of ordered pairs ( a, b ) where a is an element of A and b is an element of B .

When an ordered pair ( a, b ) is in a relation R , we write a R b , or ( a, b ) R . It means that element a is related to element b in relation R .

When A = B , we call a relation from A to B a (binary) relation on A .

Examples:

If A = < 1, 2, 3 >and B = < 4, 5 >, then < (1, 4), (2, 5), (3, 5) >, for example, is a binary relation from A to B .

However, < (1, 1), (1, 4), (3, 5) >is not a binary relation from A to B because 1 is not in B .

The parent-child relation is a binary relation on the set of people. (John, John Jr.) , for example, is an element of the parent-child relation if John is the father of John Jr.