[Solved] Part 1 Clo1 Sets Set Operations 1 Write Python Script Create Universal Set Least 15 Integ Q37163032

Part 1 (CLO1): Sets and Set Operations1. Write a python script that will:A. Create a Universal set of at least 15 integers of valuesgreater than 4 and less than 100.B. Create two sets A and B from the Universal setC. Print members of created sets.D. Find the Union between A and B.E. Find the Intersection between A and B.
2. Implement the following sets operations on the created setsin question 1, using python programming.A. Union(A,B,C)B. Intersection(A,B,C)C. Difference(A,B,C)D. isEqual(A,B)E. Complement(U,A,C)F. Cardinality(A)
Each set operation is a function. Sets A and B are input tothe functions and set C is the output. isEqual should return trueif sets A and B are equal and false otherwise. Cardinality shouldreturn number of elements in set A.The operations should be able to work with any set of integersof any size.NotesSet is a collection of objects or items. One simple way ofrepresenting sets in a programming language, such as Python is byusing lists or sets. For example_A={a, b, c, d, e} can be represented in Python as_A={‘a’, ‘b’, ‘c’,’d’, ‘e’}B={1,2,3,4,5,1,2,3,4,5,6} can be represented as:B = {1,2,3,4,5,1,2,3,4,5,6}
However, dealing with set operations even with this simplerepresentation can be a little tricky. Therefore, we will take anapproach that will simplify set operations.First we define a Universal set, then create sets byrepresenting them as Boolean arrays. As we will see set operationswill then become easy. Let’s go through an example of this.Consider the following universal set, U, and two sets A andB_U= {-10, 0, -3, 5, 7}, A= {0,-3, 5}, B= {-10, 5, 7}Python representation would be_U=[-10,0,-3,5,7];A={False, True, True, True, False};B={True, False, False, True, True};C={False, False, False, False, False};
First a set has the same number of Boolean elements as thenumber of elements in the universal set. Then, if the set has anelement from the universal set we set the corresponding Booleanelement in the set as true otherwise it is set to false.We can now do operations such as Union, intersection,difference, just by doing bit wise operations on the elements ofthe sets A and B.Students are free to choose any form sets or list structurefor processing.
Wrine a pythos script that wi Ceeate we c Print members of crcatod st Find the Find the Intersction betwoen A and 1,wwing python Each set apacn isfencon Sets A and B a ingts true if sets A and B are oal and ase orwie Netc Set in acellection of ojctsor m Oe simple way asing lists However, dealing with set operations even with this simple an approach that will simplity set oerations Fint we define a Univonal set, then create scts by esampla o this Consider the following universal st U, and two acts A and U-10.0-17 -False, False, False False, Fabse): number of an clemene from the univonal sct we sct the comoponding ach as Union Show transcribed image text Wrine a pythos script that wi Ceeate we c Print members of crcatod st Find the Find the Intersction betwoen A and 1,wwing python Each set apacn isfencon Sets A and B a ingts true if sets A and B are oal and ase orwie Netc Set in acellection of ojctsor m Oe simple way asing lists However, dealing with set operations even with this simple an approach that will simplity set oerations Fint we define a Univonal set, then create scts by esampla o this Consider the following universal st U, and two acts A and U-10.0-17 -False, False, False False, Fabse): number of an clemene from the univonal sct we sct the comoponding ach as Union
Expert Answer
Answer to Part 1 (CLO1): Sets and Set Operations1. Write a python script that will:A. Create a Universal set of at least 15 intege… . . .
OR

