Matrix Implementation of Properties of Relations Implement a C program to determ

WRITE MY ESSAY

Matrix Implementation of Properties of Relations
Implement a C program to determine the properties of a relation.
Requirements:
1) Determine if a relation is Reflexive
2) Determine if a relation is Symmetric
3) Determine if a relation is Transitive
4) For each relation, print out all the members of the equivalence classes (if any)
5) Analyze all the relations in the posted input files
Run your program with ALL of the posted input data files to demonstrate that it works properly. These input files
are binary files with the following format: the first byte is the size of the relation, followed by a byte for each
element of the matrix, filling rows from left to right. For example, the following byte sequence:
4, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1
represents the following matrix:
1, 1, 0, 1,
1, 1, 0, 1,
0, 0, 1, 0,
1, 1, 0, 1
Extra Credit Worth 2π Homework Points: Write a program to generate random equivalence relations of arbitrary
size and write them to a file. DUE SAME TIME AS THIS ASSIGNMENT
Resources:
See the posted files “relations.cpp” and “R1.bin” thru “R7.bin”.
Turn In:
1) Source Code.
2) Output for ALL of the input relations.
Sample Output
1101
1101
0010
1101
Reflexive
Symmetric
The Product

WRITE MY ESSAY

Leave a Comment

Scroll to Top