Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relations - Exercises.

Similar presentations


Presentation on theme: "Relations - Exercises."— Presentation transcript:

1 Relations - Exercises

2 In the exercises below take X = { a, b, c, d } Y = { e, f, g }
Z = { h, i } In addition, suppose R  X  Y & R = { (a,e), (a,f), (b,f), (b,g), (c,e) } S  X  Z & S = { (a,h), (b,h), (c,h), (d,h), (d,i) } T  Y  Z & T = { (e,h), (e,I), (g,h) } U  Z  Z & U = { (h, I) } 1. Evaluate a. dom R b. ran R c. dom S d. ran S e. dom T f. ran T g. R~ h. S~ i. T~ j. U~ 2. Evaluate a. R ; T b. T ; R c. S ; T~ d. R ; R~ e. (R ; S) ; T~ f. R ; (S ; T~) 3. Evaluate a. R  S b. S  R

3 Exercises 4. In a simple banking system you will have a set of pairs
AccBalances = { (123,56.78), (145,123.00), … } CurrOver = { (222,200), (234,500) … } SavingAccs { (Bill,123), (Lisa,145), (Harry,156), (Sue,159), (Eve, 154) } S  X  Z & S = { (a,h), (b,h), (c,h), (d,h), (d,i) } T  Y  Z & T = { (e,h), (e,I), (g,h) } a. Write down the type of each of these sets, that is, the sets that each of these are subsets of. b. Would it make any sense to perform the following operations on these sets, or combinations of these sets? Inverse Override Composition c. Evaluate (i) SavingAccs~ (ii) SavingsAccs ; AccBalances

4 In the exercises below take R = { (0,0), (1,1), (1,2), (2,2), (0,2) }
5. Produce a digraph for each relation. 6. Decide whether each of the relations on { 0, 1, 2 } is reflexive, symmetric, transitive or a combination of these and which are equivalence relations.

5 Problems Let A = {1,2,3,4,5,6}. Construct the relation R on A for the following cases. a) R = {(j,k) | j divides k} b) R = {(j,k) | j is a multiple of k} c) R = {(j,k) | (j – k)2 Î A} d) R = {(j,k) | j/k is a prime} 2. Let R be the relation from A = {1,2,3,4,5} to B = {1,3,5} which is defined by “ x is less than y.” Write R as a set of ordered pairs. 3. Let R be the relation in the natural numbers N = {1,2,3,…..} defined by “x + 2y =10”, that is ,let R = {(x,y) | x Î N, y Î N, x + 2y = 10}. Find a) the domain and range of R b) R-1

6 4. Prove R is an equivalence relation
4. Prove R is an equivalence relation. Let N be the set of natural numbers, that is, N = {1,2,3……..}. Define a relation R in N as follows: R = {(x,y)| x,y Î N and x + y is even}.


Download ppt "Relations - Exercises."

Similar presentations


Ads by Google