Question: Question 1: Orders and Relations (a) 9 points Let S = {1, 2, ...,20} be a set of 20 elements. Let R1 be a binary

Question 1: Orders and Relations (a) 9 points Let
Question 1: Orders and Relations (a) 9 points Let S = {1, 2, ...,20} be a set of 20 elements. Let R1 be a binary relation defined on the elements of S. Suppose that the data structure B, stores the elements of the binary relation as follows: Bili][j] = 1 if (i, j) E R1, and otherwise Bili][j] = 0. Let R2 be a binary relation defined on the elements of S. Suppose that the data structure B2] ] stores the elements of the binary relation as follows: B2[i][j] = 1 if (i, j) E R2, and otherwise B2[j] = 0. For each of the following, write the pseudo-code that prints out the pairs of elements in the described set 1. Rio RI 2. RinR2 3. RI U R2 (do not duplicate pairs of points in your print out) (b) 8 points Consider a set of points X in R x R. The points can be visualized in the plane (2D), where each point p has an x and a y coordinate. Define a relation R on X as follows: point (X1, y1) is related to point (X2, y2) if and only if max(|2-21|, ly2-y1))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!