Question: In the first part of the assignment, write a program ( in java ) that will determine whether a given ( do , n '

In the first part of the assignment, write a program (in java) that will determine whether a given (do,n't u,se c,hat,g,pt)
relation is reflexive, symmetric, anti symmetric, transitive, equivalence, and partial order.
The input to the program is a file containing the relation. The input file contains the
binary matrix representing the relation. The 0's and 1's of the matrix are separated by
white spaces. The file also contains the size of the matrix at the top. The output of the
program is a file containing the six decisions about the relation. The program asks the
user for file names.
Run your program with the given relations. Submit the results.
1.ask input and output file names
2.open input and output files
3. n = read size of matrix
4. x = create array of size nxn
5. read nxn values into x
6. decide whether x is reflexive [check (i,i) is 1]
7. decide whether x is symmetric [check (i,j) equals (j,i)]
8. decide whether x is antisymmtric [check (i,j) and (j,i) are not 1]
9. decide whether x is transitive [find x^2, check x^2 is subset of x]
10. decide whether x is equivalence [check x is reflexive, symmetric, transitive]
11. decide whether x is partial order [check x is reflexive, antisymmetric, transitive]
12. print yes/no for six questions
In the first part of the assignment, write a

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 Programming Questions!