Click here to Skip to main content
15,894,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
here is the problem
write a program that accepts a relation in any form(rooster method or 0-1 matrix)
1. determine the domain. call it set d
2. determine the range. call it set r
3. determine if the relation is symmetric, reflexive, transitive or equivalence
4. if its a function determine if its 1-1, onto, 1-1 correspondence

What I have tried:

I haven't tried anything yet because I don't know how to make it
Posted

1 solution

Start by thinking how you would do this by hand.
Get some paper, and try a couple of examples of input, what happens to them as you process it manually, and what you end up with.
Then start thinking about how you would "computerise" that. What inputs do you need? What format does the user have to enter. What do you have to do to them in order to have them ready for processing? What do you have to do to them to determine the relation? What output do you need?

Then start thinking about code - and break the code into "modules" that match your logic so far (in C, that would be functions and data). Then start to code it, breaking each stage into smaller "bits" until you can do them individually.
And test it well as you go! Make sure what you have works, before you move on to the next bit.
Give it a try - it's not that complex a task, and with a bit of thought it should be pretty simple for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900