Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Write a program to test this out. Create sets D and E. Create a function P1(x,y) that is likely to be true and another P2(x,y)

Write a program to test this out. Create sets D and E. Create a function P1(x,y) that is likely to be true and another P2(x,y) that is likely to be false. Run the same and any functions using both P functions. Count the number of times the P function is called. Perform analysis and determine where same and where any have better performances. Turn in your code, results, and analysis of the results. Thanks.

this is the example for same and any code:

Same needle code: for(int i=0; i bool same = true; for(int j=0; j< B.size; j++){ same = same & m(B[j], T[i]); } if(same) return true; } return false;

Any needle code: for(int i=0; i bool exists = false; for(int j=0; j if(m(B[i], T[j])){ exists = true; break; } } if(!exists) return false; } return true;

Please help me as soon as possible and write down what kind of code used also write down the analysis for the code. Thanks.You can use any kind of program to do this such as c++, matlab or python. You can create sets D and E .This is the course for discrete structure.

This is the sets exampke:

All of my piercings, 16 places in my body, all of them done with a needle Jody (Rosanna Arquette) in Pulp Fiction.

Set of 16 piercings (B)

Set of things that pierce (T)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students explore these related Databases questions

Question

Can you help me figure this out?

Answered: 3 weeks ago