# Answered Essay: Hard code several, at least 4, binary matrices all of size 4×4. Determine if they are symmetric, asymmetric, or antisymmetric

Prefer C++

Hard code several, at least 4, binary matrices all of size 4×4. Determine if they are symmetric, asymmetric, or antisymmetric. Also determine if it is reflexive or irreflexive (or neither of course).

Print the matrices and something like:

A – symmetric, reflexive

B – reflexive

C – none

D – irreflexive, asymmetric

You can hard code the matrices but DO NOT hard code the properties. The program must determine the properties. (I should be able to change the values of your matrix and get a different answer)

bool reflexive(int a[], int sizeOfA, int b[], int sizeOfB)
{
bool hold = true;
for(int i=0; i+1<sizeOfB; i+=2)
{
int e = b[i];
int e1 = b[i];
if(pair_is_in_relation(e1, e, b, sizeOfB) == false)
{
if (hold)
{
return false;
break;
}
}
}
if (hold)
cout << “Reflexive – Yes” << endl;
else
cout << “Reflexive – No” << endl;
return hold;
}

bool symmetric(int a[], int sizeOfA, int b[], int sizeOfB)
{
bool hold = true;
for(int i=0; i+1<sizeOfB; i+=2)
{
int e = b[i];
int f = b[i+1];
if(is_in_relation(f, e, b, sizeOfB))
if(hold)
{
return false;
break;
}
}
}
if(hold)
cout << “Symmetric – Yes” << endl;
else
cout << “Symmetric – No” << endl;
}

void antiSymmetric(int b[], int sizeOfB)
{
bool hold = true;
for(int i = 0; i < sizeOfB;)
{
if(hold == false)
{
cout << “AntiSymmetric – No” << endl;
break;
}
for(int j = 0; j < sizeOfB;)
{
if(b[i] == b[j+1] && b[i+1] == b[j])
{
if(b[i+1] != b[i])
{
hold = true;
break;
}
else
{
hold = false;
j = j + 2;
}
}
else
{
hold = false;
j = j + 2;
}

}
i = i + 2;

}
if(hold == true)
cout << “AntiSymmetric – Yes” << endl;

}

void transitive(int a[], int sizeOfA, int b[], int sizeOfB)
{

}

int main()
{
char keepGoing = ‘y’;
while (keepGoing==’y’) {

int set1[4] = {0, 1, 2, 3};
int rel1[8] = {0, 0, 1, 1, 2, 2, 3, 3};
cout << “Set 1: ” << endl;
reflexive(set1, 3, rel1, 4);
symmetric(set1, 3, rel1, 4);
antiSymmetric(set1, 3, rel1, 4);

cout << endl;
char set2[4] = {‘x’, ‘y’, ‘z’};
char rel2[8] = {‘x’, ‘y’, ‘y’, ‘z’, ‘y’, ‘y’, ‘z’, ‘z’};
cout << “Set 2: ” << endl;
charReflexive(set2, 4, rel2, 8);
charSymmetric(set2, 4, rel2, 8);
charAntiSymmetric(set2, 4, rel2, 8);

cout << endl;
char set3[3] = {‘x’, ‘y’, ‘z’};
char rel3[18] = {‘x’, ‘x’, ‘y’, ‘z’, ‘x’, ‘y’, ‘z’, ‘y’, ‘x’,
‘z’, ‘y’, ‘y’, ‘z’, ‘x’, ‘y’, ‘x’, ‘z’, ‘z’};
cout << “Set 3: ” << endl;
charReflexive(set3, 3, rel3, 18);
charSymmetric(set3, 3, rel3, 18);
charAntiSymmetric(set3, 3, rel3, 18);

cout << endl;
int set4[8] = {1, 2, 3, 4, 5, 6, 7, 8};
int rel4[20] = {1, 7, 2, 5, 2, 8, 3, 6, 4, 7, 5, 8, 6, 6, 1, 1,
2, 2};
cout << “Set 4: ” << endl;
reflexive(set4, 8, rel4, 20);
symmetric(set4, 8, rel4, 20);
antiSymmetric(set4, 8, rel4, 20);

cout << endl << “Would you like to test it again? (y/n): “;
cin >> keepGoing;
}

return 0;
}

Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

Try it now!

## Calculate the price of your order

Total price:
\$0.00

How it works?

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.