Basics of Number Theory We will say that an integer a divides an integer b evenly without a remainder, like this: a | b. Essentially, this implies that there exists an integer c such that b = ac. We will only define division by non-zero integers. Hence, it is not permissible to write 0 | a. Here are some rules that division of integers follow. (Note, a, b and c are always non-zero integers.) 1) 1 | a 2) a | 0 3) if a | b, and b | c, then a | c. 4) if a | b and b | a, then a = +b or a = -b 5) if x = y + z, and we have a | y and a | z, then a | x as well. 6) if a | b and a | c, then we have a | bx + cy for all ints x and y. An example of how we can use these rules is as follows. Are there any integer solutions to the equation 5x + 10y = 132? The answer is no. We know that 5 must divide 5x and it must also divide 10y, thus 5 | (5x+10y). This must mean that for integer solutions to exist 5 | 132. But this is not the case. Thus, there are no integer solutions to this equation. Here is another example of how to use these rules: Prove that if 13 divides 3x+4y, that 13 also divides 7x+5y. We can rewrite 7x+5y as 13x + 13y – 2(3x+4y). So we have: 7x + 5y = 13(x+y) – 2(3x + 4y) Let A = x+y, B=3x+4y We have 7x+5y = 13A – 2B Since 13 | 13 and 13 | B, it follows that 13 | (13A – 2B). Since 7x+5y is equal to this value, it follows that 13 | (7x + 5y). Now, I will show that there are an infinite number of primes. For now I will assume that all numbers can be prime factorized. We will prove this by contradiction. Assume that there are a finite number of primes. Thus, we can list each of these out p 1, p2, ... and , pn. Now, consider the number: (p1* p2* p3 * ... * pn) + 1. We know that none of p1, p2, ... and , pn can be factors of the number. (Why?) Thus, that means one of two things. Either the number we have is prime itself. Or, it has a prime factor that is not in our original list p1, p2, ... through , pn. Either way, we contradict our initial assumption that p 1, p2, ... through , pn are the only prime numbers. Thus, there are an infinite number of primes. The Division Algorithm This is simply a symbolic representation of what you’ve known since grade school. If you divide one number by another, the remainder is always in between 0 and that number-1. Here it is: If a, b Z, with b > 0, then there exists unique q, rZ such that a = qb + r, 0 r < b. So, this just says when you divide a by b, you get a quotient of q, with a remainder of r in between 0 and b1, such that both q and r are integers. We can prove this by contradiction. Let’s assume that no such q and r exist. We know that without the restriction 0 r < b, we can find q=0 and r=a that will work. Thus, for this we will assume that the smallest r0 for which a = qb + r is greater than or equal to than b. Let this r = b + r’, where r’>0. So, we have: a = qb + r = qb + b + r – b = (q+1)b + r’ Thus, we have found new integers q’= q+1 and r’=r-b such that a = q’b + r’, where 0 < r’ < r. But, that contradicts our assumption that r was the smallest integer greater than or equal to 0 that satisfied the requirement. Thus, we must have at least one solution of a = qb + r such that q, rZ 0 r < b. Now, we must show that there are no other pairs (q,r) that satisfy this equation. Let’s use proof by contradiction again. Assume there are two distinct pairs of integers (q,r) and (q’,r’) such that a = qb + r = q’b + r’, with 0 r,r’ < b. Then, we have: qb – q’b = r’ – r b(q – q’) = r’ – r Either q – q’ 0 or r’ – r 0. If q – q’ 0, then we have | b(q – q’)| b, but we know that |r’ – r| < b, since 0 r,r’ < b. Thus, this case is impossible. Otherwise, we must have r’ – r 0. But, this too is impossible since we have 0 < |r’ – r| < b, and we know that this can NOT be a multiple of b like b(q – q’) is. Thus, we have contradicted our assumption that either q – q’ 0 or r’ – r 0, proving that q and r are unique. This relates to the mod operator which you were introduced to in recitation last week in the following way: a b (mod c) iff c | (a-b), which can also be written as there exists an integer q such that cq = a – b, or a = cq + b, for some integer q. In particular with the division algorithm, we always have a r (mod b), using the same variables as before. Here are a list of rules using mod that you should have seen in recitation last week: if a b (mod n) (a+c) (b+c) (mod n) if a b (mod n) ac bc (mod n) if a b (mod n) an bn (mod n) if a b (mod n) f(a) f(b) (mod n) for any polynomial f(x) with integer coefficients. if a b (mod n) b c (mod n) a c (mod n) if a b (mod n) c d (mod n) a + c b + d (mod n) if a b (mod n) c d (mod n) ac bd (mod n) We can use these to answer questions such as, what is the remainder when you divide 425 by 10. We have 425 (42)12*4 (mod 10) 612*4 (mod 10) (62)6*4 (mod 10) 66*4 (mod 10) (62)3*4 (mod 10) 63*4 (mod 10) 62*6*4 (mod 10) 6*6*4 (mod 10) 6*4 (mod 10) 4 (mod 10) Thus, the desired remainder is 4. We can also use these rules to show that any odd number square leaves a remainder of 1 when divided by 8. From before, any odd number can be expressed as 2a+1, for some integer a. We have (2a+1)2 4a2 + 4a + 1 (mod 8) 4a(a+1) + 1 (mod 8) But, we know if a is even then a+1 is odd, or vice versa. The point is a(a+1) must be even, since one of two consecutive integers must be even. Thus, we can expression a(a+1) as 2b, for some integer b. Now we have: 4*2b + 1 (mod 8) 8b + 1 (mod 8) 1 (mod 8) proving the assertion. Euclid’s Algorithm The Greatest Common Divisor(GCD) of two integers is defined as follows: An integer c is called the GCD(a,b) (read as the greatest common divisor of integers a and b) if the following 2 conditions hold: 1) c | a c | b 2) For any common divisor d of a and b, d | c. Rule 2 ensures that the divisor c is the greatest of all the common divisors of a and b. One way we could find the GCD of two integers is by trial and error. Another way is that we could prime factorize each integer, and from the prime factorization, see which factors are common between the two integers. However, both of these become very time consuming as soon as the integers are relatively large. However, Euclid devised a fairly simple and efficient algorithm to determine the GCD of two integers. The algorithm basically makes use of the division algorithm repeatedly. Let’s say you are trying to find the GCD(a,b), where a and b are integers with a b > 0 Euclid’s algorithm says to write out the following: a = q1b + r1, where 0 < r < b b = q2r1 + r2, where 0 < r2 < r1 r1 = q3r2 + r3, where 0 < r3 < r2 . . ri = qi+2ri+1+ ri+2, where 0 < ri+2 < ri+1 . . rk-1 = qk+1rk Euclid’s algorithm says that the GCD(a,b) = rk This might make more sense if we look at an example: Consider computing GCD(125, 87) 125 87 38 11 5 = 1*87 + 38 = 2*38 + 11 = 3*11 + 5 = 2*5 + 1 = 5*1 Thus, we find that GCD(125,87) = 1. Let’s look at one more quickly, GCD(125, 20) 125 = 6*20 + 5 20 = 4*5, thus, the GCD(125,20) = 5 Now, we should prove that this algorithm really does always give us the GCD of the two numbers “passed to it”. First I will show that the number the algorithm produces is indeed a divisor of a and b. a = q1b + r1, where 0 < r < b b = q2r1 + r2, where 0 < r2 < r1 r1 = q3r2 + r3, where 0 < r3 < r2 . . ri = qi+2ri+1+ ri+2, where 0 < ri+2 < ri+1 . . rk-1 = qk+1rk From the last equation, we know that r k | rk-1. So, we know that we can express r k-1 = crk, where c is an integer. Now consider the previous equation: rk-2 = qkrk-1+ rk = qkcrk, + rk = rk(qkc + 1) Thus, we have that rk | rk-2. In our equation previous to that one, we have: rk-3 = qk-1rk-2+ rk-1 From here , since rk | rk-1 and rk | rk-2, using our rules of divisibility we have that r k | rk-3. As you can see, we can continue this process, considering each previous equation until we get to the last two, where we will find that rk | a and rk | b. Thus, we find that Euclid’s algorithm indeed gives us a common factor of a and b. Now, we have one more part to prove – and that is to show that the common divisor that Euclid’s algorithm produces is the largest possible. This proof is going to look similar to the previous one, but it is different in that we will start by assuming that a and b have a common factor d, and then show that d | r k. Consider an arbitrary common factor d of a and b. If d is a common factor, we can rewrite a and b as follows: a = da’ b = db’, where d, a’, b’ are all positive integers. Now, consider the first equation from Euclid’s algorithm: a = q1b + r1. r1 = da’ - q1db’ (Substitute for a and b, and solve for r 1.) = d(a’ - q1b’) Thus, we have that d | r1. Now, consider the second equation, and repeat the steps we did on the first, this time solving for r2. (Note: We will let r1=dr1’, where r1’ is an integer.) b = q2r1 + r2. r2 = db’ - q2dr1’ = d(b’ - q2d) As you can see, we can continue this process through each of the equations until we hit the second to last one, where we will have: rk-2 = qkrk-1+ rk rk = drk-2’ - qkdrk-1’ = d(rk-2’ - qkrk-1’), thus, d | rk. But this says that any arbitrary common factor of a and b that we originally picked divides into r k, the value that Euclid’s algorithm produced. Since we know that rk IS a common factor to both a and b, this shows that is must be the largest possible common factor, or the GCD(a,b). Mathematical Induction Often times, we would like to make a statement about the natural numbers (0,1,2,...) such as: for all natural numbers n, the sum of 1+2+3+...+n = n(n+1)/2. However, proving such a statement may be difficult if we are not very creative or proficient with algebra. In particular, it would be nice if we could prove a given statement without plugging in every possible value of n (which would clearly take forever...) or using terribly clever mathematics. Induction makes this possible. Induction is probably one of the most straightforward proof techniques we will go over in this class. Once you have the algorithm down, you should really be able to finish most inductive proofs. Here are some common mistakes that beginning students make with induction: 1) They do not state what variable they are inducting on. In particular, an open statement may contain more than one variable in it, like the following: (2a+1)n 1 (mod 2) for all a,nN. 2) They do not state the assumption being made. This step is easy. All you do is write, “Assume that ...” and replace the ... with the EXACT form of what you are trying to prove. 3) In trying to prove the statement for n+1, assuming the statement for n is true, students will often manipulate both sides of the equation, rather than trying to transform the left hand side to look like the right hand side. Now, consider using induction to show that 5 | 32n + 4n+1, for all non-negative integers n. We will prove the formula using induction on n. 1) Base Case n=0. This statement is true for n=0 since 32*0 + 40+1 = 1 + 4 = 5, and we know that 5 | 5. 2) Assume that the formula is true. Hence, assume that 5 | 32n + 4n+1, for an arbitrary non-negative integer n. 3) Now we must show that the formula is true for n+1. That is, we must show that 5 | 3 2(n+1) + 4(n+1)+1, using our assumption from step 2. Consider the quantity 32(n+1) + 4(n+1)+1. We must show that it is equal to 5 times some integer. 32(n+1) + 4(n+1)+1 = 9*32n + 4*4n+1 = 5*32n +4*32n + 4*4n+1 = 5*32n +4(32n + 4n+1) Now, since we have assumed that that 5 | 32n + 4n+1, then we can express 32n + 4n+1 = 5d, for some integer d. So now we have: = 5*32n +4(5*d) , = 5( 32n +d) using the inductive hyp. But, we know that 5 | 5( 32n +d). Thus, we have proven s(k+1) assuming s(k), completing the inductive proof. Hence we can conclude that 5 | 32n + 4n+1, for all non-negative integers n. Well – Ordering Principle Every non-empty subset of Z+ (the positive integers) contains a smallest element. Essentially the set Z + is well-ordered. Well, DUH!!! This sounds like a really useless principle. BUT, it can be used to prove anything that we can prove inductively. First, I’ll show you another proof of why mathematical induction works, using the well-ordering principle: Let an open statement satisfy the requirements I showed you the other day for proving an open statement by induction, so we have s(1) s(k) s(k+1), for all positive integers k. Now, let’s assume that these two conditions could hold while the statement s(n) is NOT true for all positive integers n. This means that we can create a set F = { t Z+ | s(t) is false } that is non-empty. Since this set is a subset of Z+, it must contain a smallest element. Let that smallest element be w. (Thus s(w) is NOT true is our assumption.) We know that w 1 since that is the first requirement for an inductive proof to hold. Thus, we know that w > 1, which means that w-1 Z+. But, we know that if w-1 Z+, AND that s(w-1) is TRUE because we assumed that w was the SMALLEST value for which s(n) was NOT true. Combining that with the fact that s(k) s(k+1), for all positive integers k, then we can plug in k = w-1 to get: s(w-1) s((w-1)+1) or s(w-1) s(w), implying that s(w) is true. But, this contradicts our assumption that s(w) is false. Strong Induction Principle This is very similar to standard induction. In fact, it is fairly easy to see that this is equivalent to standard induction. Here it is: Let A N. (N is the set of non-negative integers.) where the following two properties hold: 1) 0 A 2) 0, 1, 2, ... k A k+1 A Then we have that A = N. So, if we were to prove something by strong induction, the inductive hypothesis would be that the formula is true for ALL values of k n. In essence, we are assuming more with strong induction than with standard induction. Proof that the sum of the first n integers is n(n+1)/2 using the Well-Ordering Principle. Let X = { s | s N the sum of the first s integers is NOT s(s+1)/2 } I will show by contradiction that X=, thus, the statement above is true. Assume that X is a non-empty set. That means that X has a smallest element. Let w be this smallest element. Then we have the following: 1+2+3+...+w w(w+1)/2 But, we KNOW that w > 1 since 1 = 1(1+1)/2. Thus, w-1 Z+ and we have that 1+2+3+...+(w-1) = (w-1)w/2, since w is supposed to be the SMALLEST integer for which the formula doesn’t hold. So, now we have that (1 + 2 + ... + (w-1)) + w = (w-1)w/2 + w = w[ (w-1)/2 + 1] = w [ (w/2 – 1/2 + 2/2)] = w[ (w+1)/2] = w(w+1)/2 But, this contradicts the fact that 1+2+3+...+w w(w+1)/2. Thus, we must have made an incorrect assumption that the set X was non-empty. Thus, the statement is true for all positive integers. Proof of the Fundamental Thm. of Algebra using Strong Induction Theorem (Fundamental Theorem of Arithmetic, Part I). Let n 2 denote an integer. Then there exists prime numbers p1, p2, …, pk, not necessarily distinct, such that n = p1p2 … pk; that is, any integer n 2 can be factored as a product of prime numbers. Proof: We use strong induction on n 2. (Basis Step) Consider n = 2. In this case, since 2 is a prime, n = 2 is a prime factorization. (Induction Hypothesis) Assume the theorem is true for all values of n = 2, 3, …, k, i.e., assume each number n in the range 2 n k, for some k 2, has a prime factorization. (Induction Step) Consider n = k + 1. There are two cases, either n is itself a prime, in which case the theorem is immediately proven because n = n is a prime factorization; or, if n is not a prime. In the latter case, n = ab, where 1 < a, b < n, by the definition of non-prime. By the Induction Hypothesis, both a and b have their prime factorizations, a = p1p2 … pk and b = q1q2 … qh , where k, h 1, and all pi and qj are primes. Thus, n = ab = p1p2 … pk q1q2 … qh , which is a prime factorization for n. Thus, we proved the Induction Step. By strong induction, the theorem is true (i.e., n has a prime factorization) for all n 2. Well Ordering Principle Proof of the Fundamental Theorem of Algebra Before we prove that the prime factorization of all integers greater than 1 is unique, we need to state a theorem: Theorem. Let p denote a prime. If p | ab, where a, b are two integers, then p|a or p|b. (For example, 3 is a prime and 3 | 24 = 12 • 2. Note 3 | 12.) We use the method of proof by contradiction. Assume the theorem is false, that is, there exists some integer which has non-unique prime factorization. By the Well-Ordering Principle, there is a smallest such integer, which we call it m. That is, m 2 has two distinct prime factorizations, and m is the smallest such integer. Let m = p1p2 … pk = q1q2 … qh ------ (1), be the two factorizations. Since p1 is a prime, and p1 | m = q1q2 … qh , then p1| qi for some qi , by the theorem stated above. Without loss of generality, we assume p1| q1. Since both p1 and q1 are primes, we must have p1 = q1. Therefore, cancelling p1 and q1 from (1) yields m’ = m/p1 = p2 … pk = q2 … qh , which gives two distinct factorizations of a number m’ < m, a contradiction to the fact m is the smallest such integer. Thus, we proved the truth of the theorem. Induction Class Exercise Using induction prove the following formula for all integers n>0. n (1) k 1 k 1 n(n 1)( 1) n1 k 2 2 ______________________________________________________________________________________ Relations A relation is something that relates one set of values to another set of values. Sometimes the relationship that is specified between sets is meaningful, other times it is not. In general, a relations are defined in the following manner: A relation R defined over sets A and B is a subset of A x B. Thus, we have R A x B. This is known as a binary relation, because it relates elements between two sets. (Note: when we have sets A and B, the cartesian product of these sets, A x B is simply the set of all ordered pairs where the first element is from the set A and the second element is from the set B. There are exactly |A|x|B| elements in the cartesian product of the two sets.) Consider this example: Let A = {Hot Dog, Hamburger, Fries} and B = {Ketchup, Mayonnaise, Mustard} If you had some modicum of taste, we could define a relation Cocktails as follows: Lunch = { (Hot Dog, Ketchup), (Hamburger, Mayonnaise), (Fries, Ketchup), (Hot Dog, Mustard), (Hamburger, Ketchup), (Hamburger, Mustard) } Of course, if you are a starving college student and combine anything together, we could have up to 9 pairs listed in our relation for Lunch. Composition of Relations In math class, given two functions f(x) and g(x), you probably had to figure out the composition of the functions, which is denoted either by f(g(x)) OR fg(x). Basically, the way this worked is that you “plugged in” your original x into one function, THEN you used the “answer” that you got from that function to “plug in” to the second function. And the order in which you did it mattered. The same will be true of the composition of two relations. Here is the formal definition of the composition of two relations R and S, where R A x B, S B x C: R S = { (a,c) | a A c C (b | (a,b) R (b,c) S) } (Notice the difference in order here. When we compose a relation, we write the relations in the order we apply them, not the opposite order, as is done with functions.) Basically, when you compose the relations R and S, you get a third relation which relates elements from the set A to the set C, as long as the “answer” from relation R can be the input for relation S. We can use a directed graph again. Consider this example: A = { ABC, NBC, CBS, FOX, HBO} B = { NYPD Blue, Simpsons, Letterman, ER, X-Files, Dennis Miller Show, Monday Night Football} C = { Dennis Miller, Marge, Rick Schroeder, Gillian Anderson, Noah Wyle, David Letterman} R = {(ABC, NYPD Blue), (NBC, ER), (CBS,Letterman), (HBO, Dennis Miller Show), (FOX, X-Files) } S = { (MNF, Dennis Miller), (Simpsons, Marge), (ER, Noah Wyle), (X-Files, Gillian Anderson) (D. Miller Show,Dennis Miller),(NYPD, Rick Schroeder) } Equivalence Relations A majority of the binary relations we will be dealing with are a subset of the Cartesian product of a particular set with itself. If we have R A x A, then we have the following definitions: 1) 2) 3) 4) 5) R is reflexive if aA, (a,a) R. R is irreflexive if aA, (a,a) R. R is symmetric if aA, aRb bRa R is anti-symmetric if aRb bRa a=b. R is transitive if aRb bRc aRc. Consider the following relation R defined over {a , b, c}: R = { (a,b), (a,c), (b,a), (b,c), (c,c) } R is not reflexive since (b,b) R R is not irreflexive since (c,c) R R is not symmetric since we have (a,c) R, but (c,a) R. R is not anti-symmetric since (a,b) R and (b,a) R. R is not transitive since (b,a) R, (a,b) R, but (b,b) R. Now, I will show you some examples of more meaningful relations that actual have some of these properties. Consider a relation R over the set {jelly, bread, ham} that is defined as foods that go well together. The relation could be: R = { (jelly, jelly), (bread, bread), (ham, ham), (jelly, bread), (bread, jelly), (ham, bread), (bread, ham) } This relation is reflexive since for each element a, (a,a) R. Essentially, we can mix anything with itself and it’ll still be edible. This relation is also symmetric. The reason for this is that if we can mix one food first with a second food, then we can ALSO mix the second food with the first. Symbolically, for each pair for related items a,b A such that aRb, we also have bRa. This relation is NOT transitive. Essentially, the way we have it defined, we can have jelly with bread, and bread with ham, but we CAN NOT eat jelly with ham...and that violates transitivity. Now consider this example that is more mathematical. R Z+ x Z+ as follows: R = {(a,b) | a Z+ b Z+ (n | n Z+ a = bn) } In English, this reads, the relation defined over all positive integers such that the first integer is a multiple of the second integer. This is reflexive because for all positive integers a, we have aRa, since a=1*a. This is anti-symmetric. If we have aRb and bRa, that means that a = n1*b for some integer n1, and that b = n2*a for some integer n2. Substitute in for b in the first equation to get a = n1*n2*a Divide both sides by a to get 1 = n1*n2. We know if n1,n2 Z+, then both of them MUST BE 1, hence a=b. This relation is transitive. Consider the situation where aRb and bRc. Then we have the following: a = nb, for some positive integer n b = mc, for some positive integer m Thus, a = n(mc) = (nm)*c which implies that aRc. Any relation that is reflexive, anti-symmetric AND transitive is known as a partial ordering relation. A partial ordering relation is one that can “compare” elements together in a hierarchical way. (One element is at least as high as another one, on the hierarchy.) Equivalence Relations An equivalence relation is one that is similar to a partial ordering relation defined above, but different in one critical aspect: it must be symmetric instead of anti-symmetric. In particular, a equivalence relation gives a way to group like elements in a set together. Consider this standard example used in CS classes when introducing an if statement: Define a relation over the set A = {0,1,...,100} as follows: R = {(a,b) | a A b A (a DIV 10 = b DIV 10) } In essence, this relates elements together if they lie within the same grade range(0-9, 10-19, ..., 90-99, 100). We can see how this is reflexive – for all elements a in A we have a DIV 10 = a DIV 10. Clearly this is symmetric too. If we have a DIV 10 = b DIV 10, then we have b DIV 10 = a DIV 10. Hence if aRb, then bRa. Finally, this is also transitive. If a DIV 10 = b DIV 10 and b DIV 10 = c DIV 10, we always have that a DIV 10 = c DIV 10. Try to show that modular equivalence is a equivalence relation over the positive integers. Remember that a modular equivalence is the following: a b (mod m) iff m | (a-b). Thus the relation defined is the following: R = { (a,b) | a b (mod m), where m is an arbitrary pos. int.} The relation is clearly reflexive since for all positive integers a, we have m | a – a. The relation is also symmetric since if we have aRb, that means that we have m | a – b. But, if m | a – b, we have that m | b – a. (Formally, you’d say that mc = a – b, for some integer c, then we have m(-c) = b – a, hence m | (b – a).) Finally, if we have aRb and bRc, then we know the following: m|a–b m|b–c m must divide the sum of these, hence we have m | (a – b) + (b – c), so m | a – c, but this implies that a c (mod m), thus we have shown that aRc, as desired. Equivalence Classes Now, each element that is related to each other in an equivalence relation is said to be in the same equivalence class. More formally, we have the following: For an equivalence relation R over a set A, an equivalence class for an element x is defined as follows: [x] = { a | a A, and aRx} Next, we can define a partition of the set A based of the relation R as follows: 1) if x A y A, either [x] = [y] OR [x] [y] = . 2) if xA, x[x] We can show that all equivalence relations R over a set A adhere to the restrictions above. We can prove 1, as follows: If [x] [y] = , we are done. Now consider the other case that [x] [y] . That means that we have an element z of A such that z [x] AND z [y]. This means that zRx and zRy. But, by the symmetry or R we have xRz. Then, due to transitivity, we have xRy. Now, we can prove that [x] [y]. Consider an arbitrary a[x]. This means we have aRx, but we also have xRy. Hence, by transitivity, we have aRy, so a[y], proving that [x] [y]. Similarly, we can prove [y] [x]. Thus, we have [x] = [y]. We always have x[x], since R is reflexive. If R is an equivalence relation defined over a set A, we will let A / R denote the set of these equivalence classes. Formally, A / R = {[x] | x A}. Finally, we shall prove that any partition of a set such that each element is related to each other element in a partition is an equivalence relation. Let R be the relation for a particular partition. Clearly, R is reflexive, since each element in a single partition is related to itself, and each element belongs in a partition. R is also symmetric since if xRy, both x and y HAVE to be in the same partition, hence we must also have yRx. Finally, if we have xRy and yRz, that must mean that x, y, and z HAVE to be in the same partition. In particular, x and z are in the same partition, thus we also have xRz, proving that R is transitive as well. Hence, R is an equivalence relation.