Write a program that converts between representations of binary relations: from a setoforderedpairs representation to a matrix representation.
In this exercise, by convention, we deal with relations over the finite set of natural numbers from 0 to n1.
Input will contain several relations R represented
as a list of pairs.
Each representation begins with a line containing a number n
followed zero or more lines
each containing a pair of numbers x and y
followed by a line containing a dash 
.
The number n represents the size of the domain and codomain.
Each pair x and y indicates that x is related to y (xRy).
Input is given so that 0 ≤ x, y < n < 100.
For each relation given in the input, output should contain a 01 matrix representation of the given relation followed by a blank line.
3
0 1
1 2
0 2

4
1 1
2 2

0 1 1
0 0 1
0 0 0
0 0 0 0
0 1 0 0
0 0 1 0
0 0 0 0
try first: setmember
try also: relmtol
try next: relmember
Copyright © 20202023 Rudy Matela
All rights reserved