-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Algebra of Sets is an application developed for an assignment of a Discrete Mathematics class, with the goal of deepening the knowledege on the general subject. First, the subject was aproached in the form of theory studies and then, in a practical manner. The main purpouse of the application is to implement the basic operations related to sets, in a very basic stack of tools.
These specifications was given from the teacher of the Discrete Mathematics class. It was originally written in portuguese. This is an open translation.
- One or more sets.
- One or more elements.
- Set: A single capital letter, the equal sign, key opening, n elements separated by commas (n ≥ 0), closing the key.
A = {1, 87, 4, −1, 43}
- Element: A single lowercase letter, the equal sign, a value.
b = 87
Elements are always integers.
Belongs
Does not belong
Subset
Not subset
Proper subset
Not proper subset
Union
Intersection
Cartesian product
Set of parts
Subtrataction
If operands are missing, report an error. If left over, use the first ones in the input file and ignore the rest.
-
Belongs
andDoes not Belong
: use the first occurrence of the set and the first of the element. Despise the others. -
Union
andIntersection
: use all occurrences of sets and ignore the elements. -
Cartesian product
: use the first two occurrences of sets. -
Set of parts
: use the first set occurrence.
9. The menu options are elementary operations. Whenever possible, use them in more complex computations.
In other words, create functions or methods to implement them and reuse them instead of repeating code snippets or reasoning elsewhere in the system.
For example, use Belongs
or Does not belong
to check Subset
.
10. Whenever the operation is reversible, at the end of the execution of the operation, ask if the user wants to revert (find the original operands).
If the user chooses yes, revert (find the initial operands).
Important: do not take the initial operands on some object or in the input data. Perform the reverse operation!
Home > Technologies > Setup > How to Use