Midterm Preparation

This part is basically a summary as well as what to revise for the first 5 topics of the discrete mathematics course.

  • The midterm assessment grade is worth about 30% of the entire grade and covers the following 5 topics:
    • Set Theory
    • Functions
    • Propositional Logic
    • Predicate Logic
    • Boolean Algebra

Set theory

  • Set representation can be done by either listing a set outright, so something like S = {1, 2, 3} or can be described with set builder notation: S = {x∈ℝ, where 1 ≤ x ≤ 3}, and the venn diagram of a set as well

  • You also need to know how to build a membership table of a given set, so something that can basically describe things like the union between sets and shit

  • You need to be familiar with things like set notations and terminologies such element of a set, cardinality of a set, subsets, and powersets

  • You need to understand the different set operations like union, intersection, different, symmetric difference, and combinations

  • You need to be able to prove properties like the equivalence of sets which can be done in three ways:

    • You can do things like use the laws of set operations (commutativity, distributivity, or associativity)
    • You can use a membership table of course
    • You can also use a venn diagram as well
  • One of the mistakes is often something like proving the correctness of an example using a single statement, instead you should:

    • Use the laws of set operations, membership tables, or venn diagrams
  • The only time it is good to use an example for a proof is if it is a counter example as a proof basically

Example:

Pasted image 20261109152247.png

Basically the first one P(A ∩ B) ⊆ P(A) ∩ P(B), so the powerset of intersection A and B is the same as the intersection of a powerset A and the powerset of a set B

  • Solution:
    • This is true
  • Proof:
    • Let X be in P(A ∩ B) and show that element x is an element in P(A) ∩ P(B)
    • So we know that X ⊆ P(A ∩ B), by the definition of a powerset, we know that X is therefore a subset of both A and B so X ⊆ A and X ⊆ B so it is an element inside of P(A) and P(B)
    • Pasted image 20261109152808.png

The second one is there the powerset of a Union A and B is equal to the union of a powerset of A and a powerset of B

  • Solution:
    • This is false
  • Proof:
    • You can disprove this with a counterexample, so use something like A = {1} and B={2}, we then know that A ∪ B = {1, 2}, so P(A ∪ B)= {{1},{2},{1,2},∅} right, but the powerset of P(A) = {{1},∅} and P(B)={{2},∅, so then we take the union of the two we end up with P(A) ∪ P(B) = {{1},{2},∅} and therefore the element {1,2} is not there

Pasted image 20261109153542.png


For Functions:

  • You need to know function terminology: domain, co-domain, range of a function
  • You need to understand the properties of functions, so one-to-one (injective), onto (surjective), and bijective/inversable functions, you need to understand these properties, and be able to show if a function satisfies them

Propositional Logic:

  • You need to understand the definition of proposition
  • Compound propositions using:
    • or
    • and
    • not
    • symmetric difference
    • Implication and equivalence of propositions
  • You also need to know how to build the truth table and the truth sets for a given proposition
  • You need to know the different laws of propositional logic as well, here they are:
  • Pasted image 20261109153915.png
  • You need to be able to apply all of these and use them in order to be able to simplify down a given proposition to make it more simple or see if it is equivalent to another proposition
  • You also have De Morgan’s Laws
    • ¬(p ∧ q) ≡ ¬p ∨ ¬q
    • ¬(p ∨ q) ≡ ¬p ∧ ¬q
    • I would also remember the contrapositive: p → q = ¬q → ¬p
    • And the negation of an implication: ¬(p→q) = p ∧ ¬q
  • He says you also need to know things like q → p is the converse of p→q and that ¬p→¬q is the inverse of p→q

Predicate Logic

  • You need to understand the definition of a predicate, so the difference between a predicate and proposition
  • You need to be able to understand predicate logic operations and be able to apply them, so things like the not, and, or, implicate, equivalence all of that
  • You need to also be able to know the quantifiers:
    • universal
    • existential
    • uniqueness
  • You need to also understand the concept of nested quantifiers, so what happens if one is in the scope of another
  • You need to be able to apply negations of quantifiers and nested quantifiers
  • You must understand ALL of the rules of inference like modus ponens, modus tollens, conjunction, and disjunctive syllogism
  • You then need to understand how to combine these rules of inference for propositions and quantified statements to prove a valid argument

For Boolean Algebra

  • You need to understand the laws of boolean algebra, and be able to apply them in order to simplify a boolean expression
  • So the building blocks of boolean algebra like logic gates and logic networks
  • You also need to be able to convert and simplify circuits using Karnaugh maps

Introduction to Boolean Algebra

Outlines:

  • History of Boolean Algebra
  • Application of Boolean Algebra
  • Definition
  • Operations of Boolean Algebra

He also says he will mention something called two valued boolean algebra and the basic operations of it

The history of boolean algebra can be seen in the bullet points in this image, while it is very cool, I will not be writing out a whole section of notes for it:

Pasted image 20261109155411.png

Applications of Boolean Algebra

Boolean Algebra is basically the foundation of modern day computer circuit analysis. It is the basic block for designing transistors, which are the basic elements in building things like processors.

So imagine the following IoT system, where you have something like, if the system is activated, it should spray water around if high heat is detected.

  • You can then represent this system using a Boolean Algebra Equation where w=h AND a where:
  • h represents a “high heat detected”
  • a represents “the system is activated”
  • w represents “spraying water”

Two-Valued Boolean Algebra:

The most well known form of boolean Algebra is the two value system where you can only have values of 0 or 1, and this is because computers think in binary, you either have power, or you do not

In this system the operators (+) and (.) correspond to OR and AND respectively, and this kind of usage of the operators is really good for doing things like describing and designing digital circuits

Operations of Boolean Algebra Include:

  1. AND: this is the logical product, intersection, or conjunction, represented usually as x.y, x ∩ y, orx ∧ y
  2. OR: this is the logical sum, union, or disjunction, and is often represented as x+y, x ∪ y, or x ∨ y
  3. NOT this is known as the logical complement or the negation, and is represented as the following: Pasted image 20261109160223.png

When parenthesis are not in use, the order of precedence for these given operators is as follows

NOT >> AND >> OR

Which is basically going left to right, so you do negation before conjunction and conjunction before disjunction.

Below also are the truth tables for the different operatives of boolean algebra, I mean they are what you basically expect them to be, it words the same as you would have it for the propositions and what not

Pasted image 20261109160600.png


Postulates of Boolean Algebra

Outline:

  • Huntington’s postulates
  • Basic Theorems
  • De Morgan’s Theorems
  • Proof of Distributivity of + over
  • Principle of Duality
  • Ways of Proving Theorems

Hunting’s Postulates

Huntington’s postulates define 6 axioms that must be satisfied by any Boolean Algebra with respect to the operators I presume:

  1. Closure: any result of logical operation belongs to the set {0, 1}
  2. Identity: x + 0 = x and x.1 = x
  3. Commutativity: x+y = y+x and y.x = x.y
  4. Distributivity: x(y + z) = (x.y + x.z) and x + (y.z) = (x+y).(x+z)
  5. Compliments: x + x' = 1 and x.x' = 0
  6. Distinct Elements: 1 ≠ 0

With this different six axioms of boolean algebra, we can establish other useful theorems for analyzing and designing circuits

Theorem 1: Idempotent Laws

  • x + x = x and x.x = x

Theorem 2: Tautology and Contradiction

  • x + 1 = 1 and x.0=0

Theorem 3: Involution:

  • (x')' = x

Theorem 4: Associative Laws

  • (x+y)+z = x+(y+z) and (x.y).z = x.(y.z)

Theorem 5: Absorption Laws

  • x + (x.y) = x and x.(x + y) = x

Theorem 6: Uniqueness of complement

  • if x + y = 1 and x.y=0 then x = y'

Theorem 7: Inversion law

  • 0' = 1 and 1' = 0

De Morgan’s Theorems:

Theorem 1: the complement of a product of variables is equal to the sum of the complements of the variables so: (x.y)' = x' + y

Theorem 2: The complement of a sum of variables is equal to the product of the variables, so (x+y)' = x'.y'

Pasted image 20261109165302.png

Pasted image 20261109165316.png


Principle of Duality:

Starting with a Boolean Relation, we can build another equivalent Boolean relation by:

  • Changing every OR (+) sign to a AND (.) sign
  • Changing every AND (.) sign to a OR (+) sign
  • Changing every 0 to 1 and each 1 to 0

Example:

Take the following boolean expression: A + BC = (A+B)(A+C) as by the distributive law, we can then build another relation using the duality principle: A(B + C) = AB + AC, you invert each of the operations one at a time across everything

Pasted image 20261109170311.png

Ways of Proving theorems:

  1. Perfect Induction by showing the two expressions have identical truth tables. This method is however tedious if there are more than 3 or 4 variables
  2. Axiomatic Proof: by applying Huntington’s postulates or theorems (that have already been proved) to the expressions, until identical expressions are found
  3. Duality Principle: every theorem in Boolean Algebra remains valid if we interchange all AND’s and Or’s and interchange all 0 and 1
  4. Contradiction: By assuming that the hypothesis is false and then proving that the conclusion is therefore also false

Pasted image 20261109170721.png

Boolean Functions:

Outlines:

  • Definition
  • Algebraic forms
  • Standardized forms of a function
  • Building a sum-of-products form
  • Useful functions

A boolean function defines a mapping from one or multiple Boolean input values to a Boolean output value

So therefore, for n Boolean input values, there are 2^n possible combinations, this makes sense, you’re basically adding an extra bit each time to the given input string whenever you have a new value:

Pasted image 20261109171903.png

There is only one way to present a boolean function inside of a truth table, however in algebraic form, you can actually express a function in a variety of different ways:

Pasted image 20261109172110.png

So take something like f(x) = x + x'.y and f(x)=x+y are both algebraic representations of the same truth table:

Standardized forms of a function

The two most common standardized forms are the sum-of-products form and the product-of-sums form.

The former is defined as:

  • f(x,y,z) = xy + xz + yz
    The ladder is therefore defined as:
  • f(x,y,z) = (x+y)(x+z)(y+z)

The sum of products form is generally known as being easier to use and to simplify, so the course will generally be used throughout the rest of the course, these two are obviously equal to each other given the duality clause

To build the truth table of the products form we do as follows:

  1. We focus on the values of the variables that make the function equal to 1
  2. If an input equals 1, it appears un-complimented in the expression
  3. If an input then equals 0, it appears complemented in the expression
  4. The function f is then expressed as the sum of products all the terms for which f=1

Example:
Pasted image 20261109172546.png

Second Example:

f(x, y, z) = (x' + y).z'
What is SOP form?:
SOP = f(x, y, z) = x'y'z' + x'yz' + xyz'

xyzf(x,y,z)
1010
1000
1110
1101
0010
0001
0110
0101

Useful Functions:

The exclusive-or (XOR) / (⊕) usually expressed as x ⊕ y, it is defined as true if either y or x is true, but not both or neither.

  • You can also express it as x⊕y = xy' + x'y

The implies function is also useful and is denoted by x → y. It is true if x is ever zero, and if both x and y are 1, it is only false whenever x=1 and y=0.

  • You can also express it as x'+y

Book Reading:

Read the following pages to consolidate your knowledge of these topics: the definition of Boolean algebra; Huntington’s postulates; De Morgan’s theorems; the principle of duality; and algebraic forms.

Please also complete the following exercises: 

  • p.812 exercises 36, 38, 39, 47 and 50.
  • p.822 exercises 13, 17, 18 and 22.

Book Work:

Boolean Algebra is a mathematical system, that consists of nonempty set S with one or more operations defined on S, and a set of axioms that the elements of S satisfy.

Pasted image 20261111170649.png
Pasted image 20261111170746.png

This speaking just for a basic arbitrary set with whatever elements, these things are sort of like the skeletal structure of a mathematical system, they help to define out things that apply likewise in other mathematical systems, including boolean algebra.

Pasted image 20261111170853.png
Pasted image 20261111170909.png

So this here basically defines out the operators of things like what an inverse is, or what the XOR operator does right, basically the least common multiple, the greatest common factor, and the inverse just being the pairing multiple in this case right.

These rules, all in all also therefore apply to these new operations that have been defined. Notice that whenever you have add these two different mathematical operations defined for these two different sets, one arbitrary and the one defined, what did they have in common?

Well in each case, a nonempty set B contained two special elements, ∅ and U, being basically the empty set and the universal set of the given set B. They also had two binary operators and unary operator in the form of the complement. Allowing both of them to satisfy the same 10 properties. It is these exact commonalities that suggest a mathematical system called boolean algebra which is defined below:

Pasted image 20261111171924.png

Bang, this is the mathematical skeleton for all of the different elements that we have inside of boolean algebra, you have a single nonempty set containing two elements, 0, 1, and a binary operator + which kind of works like the OR operator, can is called the sum, and then another one . which works like the AND operator, which is called the product. You then also have negation of course, which is denoted by ' and is called the complementation.

Those are the operators, there are also some laws and what not that exist as well, you basically have the standard compliment laws, things like distribution and associativity, but eventually, even though they are not yet defined here outright, you also have things like the absorption laws and I’m sure de Morgan’s, and duality and all of the good stuff.

A few things of course, all possible outcomes of different operations are parts of the set B, meaning that all of the given operations and their outcomes are going to equal either 0 or 1, those are the only values that you can really have here. 0 is the zero element and then 1 is called the unit element, they also do not need to outright be the numerical values of integers zero and one, and can be anything like a, b or even 2, 3, as long as the understanding is that these items are binary, precedence is as follows:

Pasted image 20261111172520.png

The principal of duality basically describes that if you inverse whatever operation you are working with, it ends up being true. This is because of the axioms being slip into those two dual left and right columns: so xx' = 0 when you inverse every operation going left to right, even the resolution, you get x' + x = 1, which is true. This whole principle follows for each given expression in the world of boolean algebra.

Pasted image 20261111172907.png

Basically you use the given axioms as a means of proving a bunch of other shit that is basically common sense in fairly long and drawn out processes. But basically through the use of these sorts of proofs we can end up getting into the fun parts that are derived from them and useful:

Pasted image 20261111173050.png

These things are sort of common sense of course, but they do still need a formal backing, but it means that the complement to a given value 1 is 0 and vice versa, and that the compliment of a compliment is the original element. You also have the boundless laws, which basically just denote the definition of a contradiction and a tautology.

You have De Morgan’s Laws which are pretty much everywhere, just inverse the shit, and then the laws of absorption which are pretty interesting conceptually in my opinion, because of things like the binding, the thing that still gets the final say is the x value pretty much, it’s good for saving steps when evaluating.

Boolean Functions:

A boolean variable assumes the value 0 or 1. A boolean function on the other hand is a function f: B^n -> B where B^n = B*B*B*B*...*B, or basically B to a given exponent right. Now let: (x1,x2,x3,...,xn) ∈ B^n This means we can then denote the function as f((x1,x2,x3,...,xn)), which this is basically the domain of our function and all of the possible input. We know that our co-domain is B, meaning that the output for any input value as defined by (x1,x2,x3,...,xn) is in that case either a 0 or a 1.

You can define a boolean function using a logic table, where in which you defined a boolean function, and then based on this function, these two inputs are then plugged into the function, and you get a value:

Pasted image 20261111174005.png
Pasted image 20261111174014.png

Now this functions are obviously complements to each other, and they define the + and . operator, you can also totally write these as a product of sums or a sum of products, just look further up in this weeks notes. Below are some of the basic properties of these functions though.b

You can also define a boolean function using a boolean expression so if you have boolean variables x, y, z you can express a function using them: f(x,y,z) = x+yz and that would be a boolean expression used to make a function right.

Pasted image 20261111174306.png

The proof in the photo basically just describes what a boolean expression is, and in laymen’s terms it says that hey, if these variables are boolean variables, then that means by the laws and established axioms and properties of boolean algebra, these operations done on them also result in a boolean value, thus the expression itself is a boolean value and belongs to the set B of {1, 0}

Two boolean expressions E1(x1,x2,x3,...,xn) is equal to another expression E2(x1,x2,x3,...,xn), if the yield of the two expressions is identical for all possible inputs as defined by x1,x2,x3,...,xn

Now this is very easy to prove using logic gates when the two of these boolean expressions are fairly simple, we can actually do this to showcase De Morgan’s Laws as well:

Pasted image 20261111175325.png