Mathematics/Discrete Math/Sets: Difference between revisions
< Mathematics | Discrete Math
Jump to navigation
Jump to search
Brodriguez (talk | contribs) (Add basic set operations) |
Brodriguez (talk | contribs) m (Improve formatting) |
||
Line 2: | Line 2: | ||
== Terminology == | == Terminology == | ||
* Set - A grouping of various elements. | * '''Set''' - A grouping of various elements. | ||
* Subset - A grouping of such that all elements of the set are also contained within an equal-sized or larger set. May include two equivalent sets. | * '''Subset''' - A grouping of such that all elements of the set are also contained within an equal-sized or larger set. May include two equivalent sets. | ||
* Proper Subset - A subset in which the two sets are not equivalent. | * '''Proper Subset''' - A subset in which the two sets are not equivalent. | ||
* Empty Set/Zero Set ('''∅''') - A set containing exactly 0 elements. Aka a null set. | * '''Empty Set/Zero Set''' ('''∅''') - A set containing exactly 0 elements. Aka a null set. | ||
* Closed Set - A set in which it's own boundary is contained within the set. | * '''Closed Set''' - A set in which it's own boundary is contained within the set. | ||
* Open Set - A set where the boundary is excluded from the set, but all values between the boundary are included. | * '''Open Set''' - A set where the boundary is excluded from the set, but all values between the boundary are included. | ||
* Cardinality - The number of distinct elements within a set. Ex: The set | * '''Cardinality''' - The number of distinct elements within a set. | ||
** Ex: The set <code>{-1, 0, 1}</code> has a Cardinality of 3. | |||
<br> | <br> | ||
Common Set Types: | Common Set Types: | ||
* Universal Set ('''U''') - An arbitrary set, which changes based on context. However, it is assumed to always contain every possible element currently being considered for the given context. | * '''Universal Set''' ('''U''') - An arbitrary set, which changes based on context. However, it is assumed to always contain every possible element currently being considered for the given context. | ||
* Integers ('''Z''') - The set of all integers. Ex: | * '''Integers''' ('''Z''') - The set of all integers. | ||
** Ex: <code>{..., -3, -2, -1, 0, 1, 2, 3, ...}</code>. | |||
* '''Positive Integers''' ('''Z<sup>+</sup>''') - The set of all positive integers. | |||
** Ex: <code>{1, 2, 3, ...}</code>. | |||
* Real Numbers ('''R''') - The set of '''R+''', but including zero and negative numbers. | * '''Natural Numbers''' ('''N''') - The set of '''Z<sup>+</sup>''', but including zero. | ||
* Complex Numbers ('''C''') - The set of all numbers, including imaginary ones. | ** Ex: <code>{0, 1, 2, 3, ...}</code>. | ||
* '''Positive Real Numbers''' ('''R+''') - The set of non-imaginary numbers, greater than zero. Includes fractions, decimals, etc. | |||
* '''Real Numbers''' ('''R''') - The set of '''R+''', but including zero and negative numbers. | |||
* '''Complex Numbers''' ('''C''') - The set of all numbers, including imaginary ones. | |||
== Basic Set Operations == | == Basic Set Operations == | ||
The following are basic operations are explained with sets | The following are basic operations are explained with sets <code>A={2, 3, 4, 5}</code> and <code>B={0, 2, 4, 6}</code> onto set <code>S</code>. But the operations could be applied to any arbitrary two sets. | ||
* Union of A and B ('''A ∪ B''') - The set of all distinct elements contained in either A or B. | * '''Union''' of A and B ('''A ∪ B''') - The set of all distinct elements contained in either A or B. | ||
** Ex: | ** Ex: <code>S={0, 2, 3, 4 ,5, 6}</code>. | ||
* '''Intersection''' of A and B ('''A ∩ B''') - The set of all distinct elements that are contained in both A and B. | |||
** Ex: | ** Ex: <code>S={2, 4}</code> | ||
* '''Difference''' ('''A/B''') - The given set, minus all elements in the second set. | |||
** Ex: | ** Ex: <code>A/B={3, 5}</code> | ||
** Ex: | ** Ex: <code>B/A={0, 6}</code> | ||
* '''Symmetric Difference''' of A and B ('''A △ B''' or '''A ⊖ B''') - The set of all elements that are a member of exactly one set A or B. | |||
** Ex: | ** Ex: <code>S={0, 3, 5, 6}</code>. | ||
* '''Cartesian Product''' of A and B (''' A x B''') - The set containing all ordered pairs <code>(a, b)</code> for each <code>a</code> in set <code>A</code> and each <code>b</code> in set <code>B</code>. | |||
** Ex: | ** Ex: <code>S={(2, 0), (2, 2), (2, 4), (2, 6), (3, 0), (3, 2), (3, 4), (3, 6), (4, 0), (4, 2), (4, 4), (4, 6), (5, 0), (5, 2), (5, 4), (5, 6)}</code> | ||
* '''Power Set''' of A ('''A''') - The set containing all possible subsets using elements from the original set A. Includes the empty set. | |||
** Note that the number of elements is always equal to 2<sup>x</sup>, where x is equal to the cardinality of the given set. This is why it's called the power set; The number of elements corresponds to powers of 2. Thus, counting the elements is a good way to check that it's correct. | ** Note that the number of elements is always equal to 2<sup>x</sup>, where x is equal to the cardinality of the given set. This is why it's called the power set; The number of elements corresponds to powers of 2. Thus, counting the elements is a good way to check that it's correct. | ||
*** For example, a set of Cardinality 3 will have 2<sup>3</sup> elements. | *** For example, a set of Cardinality 3 will have 2<sup>3</sup> elements. | ||
** Ex: | ** Ex: <code>S={∅, {2}, {3}, {4}, {5}, {2, 3}, {2, 4}, {2, 5}, {3, 4}, {3, 5}, {4, 5}, {2, 3, 4}, {2, 3, 5}, {2, 4, 5}, {3, 4, 5}, {2, 3, 4, 5}}</code> |
Revision as of 22:48, 7 September 2019
Sets, aka groups of elements and logic regarding such.
Terminology
- Set - A grouping of various elements.
- Subset - A grouping of such that all elements of the set are also contained within an equal-sized or larger set. May include two equivalent sets.
- Proper Subset - A subset in which the two sets are not equivalent.
- Empty Set/Zero Set (∅) - A set containing exactly 0 elements. Aka a null set.
- Closed Set - A set in which it's own boundary is contained within the set.
- Open Set - A set where the boundary is excluded from the set, but all values between the boundary are included.
- Cardinality - The number of distinct elements within a set.
- Ex: The set
{-1, 0, 1}
has a Cardinality of 3.
- Ex: The set
Common Set Types:
- Universal Set (U) - An arbitrary set, which changes based on context. However, it is assumed to always contain every possible element currently being considered for the given context.
- Integers (Z) - The set of all integers.
- Ex:
{..., -3, -2, -1, 0, 1, 2, 3, ...}
.
- Ex:
- Positive Integers (Z+) - The set of all positive integers.
- Ex:
{1, 2, 3, ...}
.
- Ex:
- Natural Numbers (N) - The set of Z+, but including zero.
- Ex:
{0, 1, 2, 3, ...}
.
- Ex:
- Positive Real Numbers (R+) - The set of non-imaginary numbers, greater than zero. Includes fractions, decimals, etc.
- Real Numbers (R) - The set of R+, but including zero and negative numbers.
- Complex Numbers (C) - The set of all numbers, including imaginary ones.
Basic Set Operations
The following are basic operations are explained with sets A={2, 3, 4, 5}
and B={0, 2, 4, 6}
onto set S
. But the operations could be applied to any arbitrary two sets.
- Union of A and B (A ∪ B) - The set of all distinct elements contained in either A or B.
- Ex:
S={0, 2, 3, 4 ,5, 6}
.
- Ex:
- Intersection of A and B (A ∩ B) - The set of all distinct elements that are contained in both A and B.
- Ex:
S={2, 4}
- Ex:
- Difference (A/B) - The given set, minus all elements in the second set.
- Ex:
A/B={3, 5}
- Ex:
B/A={0, 6}
- Ex:
- Symmetric Difference of A and B (A △ B or A ⊖ B) - The set of all elements that are a member of exactly one set A or B.
- Ex:
S={0, 3, 5, 6}
.
- Ex:
- Cartesian Product of A and B ( A x B) - The set containing all ordered pairs
(a, b)
for eacha
in setA
and eachb
in setB
.- Ex:
S={(2, 0), (2, 2), (2, 4), (2, 6), (3, 0), (3, 2), (3, 4), (3, 6), (4, 0), (4, 2), (4, 4), (4, 6), (5, 0), (5, 2), (5, 4), (5, 6)}
- Ex:
- Power Set of A (A) - The set containing all possible subsets using elements from the original set A. Includes the empty set.
- Note that the number of elements is always equal to 2x, where x is equal to the cardinality of the given set. This is why it's called the power set; The number of elements corresponds to powers of 2. Thus, counting the elements is a good way to check that it's correct.
- For example, a set of Cardinality 3 will have 23 elements.
- Ex:
S={∅, {2}, {3}, {4}, {5}, {2, 3}, {2, 4}, {2, 5}, {3, 4}, {3, 5}, {4, 5}, {2, 3, 4}, {2, 3, 5}, {2, 4, 5}, {3, 4, 5}, {2, 3, 4, 5}}
- Note that the number of elements is always equal to 2x, where x is equal to the cardinality of the given set. This is why it's called the power set; The number of elements corresponds to powers of 2. Thus, counting the elements is a good way to check that it's correct.