Sets represented with Venn Diagrams

This topic covers the following:

  • Notion of the Universal Set
  • The complement of a Set
  • Set representation using Venn Diagrams

The Universal Set is a set that contains EVERYTHING and is referred to by the letter U.

A Venn Diagram is used to visualize the possible relations among a collection of sets. The image below showcases the relation between the universal set U and then the subset of U, A so A ⊆ U:

Pasted image 20261013114753.png

Complement of a Set, this is basically the rest of the stuff in the upper image that is not highlighted. It is denoted by the letter A with a little dash over the top of it, and it contains all of the elements that can be found in U - A, so basically all elements in U that are not in A

Below is an example:

U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
A = {2, 4, 6, 8, 10}

A_ = {2n-1 | 0 < n <=10} = {1, 3, 5, 7, 9}

Given this, we would also know that the union of a set and its complementary set would then be equal to the universal set. A ∪ A_ = U, always

Below is how different Venn Diagrams can be used to present the union and intersection and all of the other representations of a given diagram:

Pasted image 20261013115226.pngPasted image 20261013115244.pngPasted image 20261013115250.pngPasted image 20261013115216.png

A good way to show that two sets are the same is to use a Venn diagram to show that:
A ⊕ B = A∪B - (A ∩ B), this means that you can basically take the union of the two sets, and then take away any intersecting values of the two. This means that all that you are left with is the unique values of each set, which is exactly what the ⊕ operator does


De Morgan’s Laws

From memory on logic:

Law 1:
p ^ q = ¬p ∨ ¬q

Law 2:
p ∨ q = ¬p ∧ q

Technically not Law Three, there is only 2 laws, but this is good to know too
p→q = ¬p v q

A lot of the following content was covered in Week 2, but its okay, here they are anyways:

De Morgan’s Laws describe how mathematical statements and concepts are related through their opposites. In set theory, De Morgan’s laws relate to the intersection and union of sets through their complements

The structure of De Morgan’s, whether applied to sets, propositions or logic gates, is always the same, so basically how this would look for sets then I assume:

Law 1: The union of 2 sets is equal to the intersection of their complements
(A ∪ B)` = A' ∩ B'

Law 2: The intersection of 2 sets is equal to the union of their complements
(A ∩ B)` = A` ∪ B`

image.png

Member Ship tables for (A ∪ B)’ = A’ ∩ B’

image.png

ABA’B’A ∪ B(A U B)‘A’ ∩ B’
0011011
0110100
1001100
1100100

As you can see the last 2 columns in the table are actually identical, which showcases the proof for the first law of De Morgan. This makes sense if you think about it because It basically is just the same as it is with the logic. You inverse whatever the outcome of the Union is going to be (so the or operator) which basically makes it become the and operator

Membership table for (A ∩ B)’ = A’ ∪ B’

image.png

ABA’B’(A ∩ B)(A ∩ B)‘A’ ∪ B’
1100100
1001011
0110011
0011011

As you can see given that the ∪ and ∩ operators both basically just act the same as the ^ and v operators, De Morgan’s laws apply to them just the same, logically speaking that is. The only difference really is how things end up being negated, and you can see that you need to actually negate the whole operator (by taking the complement) and then negate each one individually


Example of De Morgan’s laws in practice

Given U = {1, 2, 3, 4, 5, 6, 7, 8, 9} and A, B two subsets of U: A = {1, 2, 3, 4} & B = {4, 5, 6, 7} apply De Morgan’s Laws:

Given:
A` = {5, 6, 7, 8, 9}
B` = {1, 2, 3, 8, 9}


Derived:
A U B = {1, 2, 3, 4, 5, 6, 7}
(A u B)` = {8, 9}
(A ∩ B)` = {1, 2, 3, 5, 6, 7, 8, 9}

So:

A` ∩ B` = {8, 9}
A` ∪ B` = {1, 2, 3, 5, 6, 7, 8, 9}

This is basically just the use of the math, I mean it kind of makes sense if you really think about it, you can just do this by applying the logic to each one of the like outer operations without the knowledge of De Morgan’s, even though it is fair that De Morgan’s is a good shortcut


Laws of Sets: Commutative, associative, and distributive

Commutativity: basically the idea that says that no matter which order you place given products or objects of an equation or operation, the answer to that equation or operation will stay the same, think of it like this: A ∪ B = B ∪ A, and this basically would then mean that the ∪ operator is commutative. Same with something like ∩:

  • U, ∩, ⊕ are all commutative
  • - is NOT commutative

Associativity concerns the grouping of elements in an operator, it basically has to actually do with the fact that no matter the order in which you perform the operation, the result is the same, so for example: (A ∪ B) ∪ C = A ∪ (B ∪ C), it does not matter the order in which the union happens because the result is the same. Therefore the ∪ operator is associative.

  • ∪, ∩, ⊕, are all associative
  • - is NOT associative

Distributive is sometimes called the distributive law of multiplication and division, and basically states that a given value is the same as when distributed as for when it is foiled outright so: 3*(2+5) = 3*2 + 3*5 = 21 or a(b+c) = ab + ab.

  • A set union is distributive over the set intersection: A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
  • A set intersection is distributive over the set union: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

image.pngimage.png

Useful Set Indentitites:

Pasted image 20261013124903.png

This stuff can be used to simplify out expressions that might look pretty hard to start out with, but become easier once you do all of the steps, take for example:

Show that: ((A ∩ B) ∪ B`)` = B ∩ A`

First apply De Morgan's Law:
(A ∩ B)` ∩ B = (A ∩ B) ∪ B`)`

Second, apply De Morgan's Law Again:
(A` ∪ B`) ∩ B = (A ∩ B)` ∩ B

Third, commutative:
(A` ∪ B`) ∩ B = B ∩ (A` ∪ B`)

Fourth, distrbutive:
B ∩ (A` ∪ B`) = (B ∩ A`) ∪ (B ∩ B`)

Fifth, simplify right hand side
(B ∩ A`) ∪ (B ∩ B`) = (B ∩ A`) ∪ ∅ = (B ∩ A`)

Partition of a Set

A partition of an object is the subdivision of an object into parts, so that these parts are completely separate from each other, but when together they become the whole object. This is very useful in computer science of course, like partitioning memory or a storage for example. Even big data analysis.

Disjoint sets: two sets are said to be disjoint if they share no common elements, so A ∩ B = ∅

A partition of A is a set of subsets Ax of A such that:

  • All of the subsets of Ax are dis-joints
  • The union of all subsets Ax is equal to A

So basically a partition means that a given value of a subset must be different from all other subsets of the main set, and that all of the subsets union together must be equal to the original set

Pasted image 20261013134848.png

Problem Sheet:

“tutorial-topic1-set-theory.pdf” could not be found.

Watch Webinar:

Not doing that shit right now

Book Reading

Read the following pages to consolidate your knowledge of the following topics: set operations; the complement of a set; symmetric difference; membership tables; De Morgan’s laws; and set properties.

Please also complete the following exercises on:
pp.93: questions  5, 6, 7 , 8, 11, 12, 14, 17, 27, 34, 35, 39 and 42.


Pasted image 20261013203750.png

It just goes over the different operations you can perform on a set, things like Unions and Intersections and all of that other good stuff, it also just showcases the logic for them as well as the venn diagrams.

Logic for A ∩ B operator: {x | x ∈ B ∧ x ∈ A}
Logic for A ∪ B operator: {x | x ∈ B ∨ x ∈ A}

Pasted image 20261013203411.png

It says that two sets are disjoint if the A ∪ B = ∅

Pasted image 20261013203654.png

Notice that basically almost all of the given set laws can actually be applied as logic laws, and that you can outright just replace a lot of the different laws exactly how they would work inside of the set laws. Basically ∪, ∩, ' are all the same thing as ∧, ∨, ¬, and they behave in about the same way as well. In fact even the whole p → q ≡ p ∧ ¬q is also pretty similar to A - B = A ∩ B, at least kind of, maybe I am geeking


Drawing for Work