From the previous article, you know that a prepositional statement can have truth value and the values are boolean – true or false. A statement having true value can be negated using ‘not‘ operator and then its value becomes false or vice-versa.
Consider the following example where variable
is the statement “I am eating“.
\begin{aligned}
&p: "I \hspace{5px}am \hspace{5px} eating" \\\\
&negation \hspace{5px} of \hspace{5px} p \hspace{5px} or \hspace{5px} \neg p: " It \hspace{5px} is \hspace{5px}not \hspace{5px} the\hspace{5px} case \hspace{5px}that \hspace{5px}I \hspace{5px}am \hspace{5px}eating." \\
&or \\
&"I \hspace{5px}am \hspace{5px}not \hspace{5px} eating"
\end{aligned}You can write a negative statement but a true statement and negate it too. Let
be the statement “I am not eating”.
\begin{aligned}
&q: "I \hspace{5px} am \hspace{5px} not \hspace{5px}eating"\\\\
&\neg q: "I \hspace{5px} am \hspace{5px}eating".
\end{aligned}Given a compound preposition, a negation must be simplified first before any other logical operator. Its precedence is highest unless you have part of an expression enclosed in parenthesis.
\begin{aligned}
&1. \hspace{3px}\neg(p \lor q) \hspace{3px} and \hspace{3px} (q \lor \neg q)\\\\
&2. \hspace{3px}(p \lor p)\land \neg q
\end{aligned}In the compound statement (1) there are two groups of parenthesis where first group
has a negation. Therefore, we must evaluate the first group and then second group of parenthesis.
The expression (2) has only one parenthesis that must be evaluated first because cannot simplify the not operator with one variable.
The negation operator is unary operator which give opposite results to a boolean value. The truth table gives all possible output for a given input combination and negation operator.
| P | Not P |
| T | F |
| F | T |
Prepositional Logic is kind of logic that studies “Statements” and derives relationship among those statements.
When we talk, we make many sentences, but all sentences are not
. A sentence qualifies as a statement when it has a truth value. There is only two truth value for a statement –
or
.
For example,
What \hspace{5px}is \hspace{5px}your \hspace{5px}name?The above sentence is a question, and we cannot give a truth value for this sentence. It is neither true nor false.
If someone reply to the question with an answer such as following
My \hspace{5px}name \hspace{5px} is \hspace{5px} Peter.The above is an example of statement because it can be true or false.
Suppose there are two prepositions.
\begin{aligned}
&I \hspace{5px}am \hspace{5px} eating.\\
&I \hspace{5px}am \hspace{5px} sleeping.
\end{aligned}Such individual statement is called simple prepositions and we do not need to write them every time. Instead, we can assign an alphabet to each of these statements.
\begin{aligned}
&p : I \hspace{5px} am \hspace{5px} eating.\\
&q: I\hspace{5px} am\hspace{5px} sleeping.
\end{aligned}We can also make complex statements using these simple prepositions. However, we need a logical connective to do that.
There are many logical connectives but the most common connectives are
\begin{aligned}
&and \hspace{5px} ( conjunction )\\
&or \hspace{5px} ( disjunction )
\end{aligned}and
are compound statements.
It means following
\begin{aligned}
&p \wedge q : I \hspace{5px} am \hspace{5px} eating \hspace{5px}and \hspace{5px}I \hspace{5px}am \hspace{5px}sleeping.\\
&p \vee q : I \hspace{5px}am \hspace{5px}eating \hspace{5px}or \hspace{5px}I \hspace{5px}am \hspace{5px}sleeping.
\end{aligned}The truth value of the compound preposition depends on the individual simple preposition in the compound preposition.
In the above example, suppose truth value of p is true and q is false, then
\begin{aligned}
p \wedge q = true \wedge false = false
\end{aligned}Similarly,
\begin{aligned}
p \vee q = true \vee false = true
\end{aligned}We shall see more of these using a truth table in future lessons.
Hasse Diagram is created for POSET or Partially Ordered Set. It means that there is a set of elements in which certain element are ordered, sequenced or arranged in some way. It is usually denoted as ≤, this is not “Less than, Equal to”, this symbol shows that elements are ordered.
Now, there is a relation among all the elements in the partial order set and it is some binary relation R, this relation must satisfy following properties
Due to the reflexive property all elements have direct edge to itself.

Hasse Diagram showing all relations
In this diagram, it shows the relations removed all the self-directing loops.

All Self-Directing Edges Removed
The green lines shows transitivity, so we remove all the transitive lines. Out diagram look like the following.

Hasse Diagram without Transition and Loops
Replace all the vertices with dots and directed edges with ordinary lines. This final diagram is called the Hasse Diagram of poset.

Hasse Diagram for A = { 1, 3, 5, 12, 15 } and relation a | b i.e., a divides b
Here is an exercise for you to practice. The prerequisite for Hasse Diagram is to know how to represent relations using graphs.
Let A be a poset, A = { 2, 4, 6, 8 } and the relation a | b is ‘a divides b. Draw a Hasse Diagram for the poset showing all the relations.
nCr = n!/r!(n-r)!
For example, select 3 objects from 4 objects, then
4C3 = 4!/3!(4 – 3)! = 4 x 3!/ 3! . 1! = 4 ways
Consider our previous example of permutation ,we selected one combination from each of the column. This is because in combination order of objects does not matter. Each column is combination of 3 objects only.
But in permutation the order of object is counted as one arrangement.
A B C B C D A B D A C D = 4 ways
A C B B D C A D B A D C
B A C C B D B A D C A D
B C A C D B B D A C D A
C A B D C B D A B D A C
C B A D B C D B A D C A
Problems for Math Exam:
Q1: How many way to form a committee of 6 men and 2 women out 10 men and 5 women?
source : Mathematical foundation by p.r.vittal
Solution:
Number of ways to select 6 men = 10C6
= 10! / 6! ( 10 – 6 )!
= 10 x 9 x 8 x 7 x 6! / 6 ! x 4 !
3
= 10 x 9 x 8 x 7 / 4 x 3 x 2
= 30 x 7
= 210 ways
Number of way to select 2 women = 5C2
= 5 !/ 2 ! ( 5 – 2)!
2
= 5 x 4 x 3!/ 2! x 3!
= 10 ways
Therefore, Total ways to form the committee with 2 women and 6 men is 210 x 10 = 2100 ways.
Q2: From 6 boys and 4 girls, 5 are to be selected for admission to a particular course . In how may ways this can be done if there must be exactly 2 girls?
source : Mathematical foundation by p.r.vittal
Solution:
If there are exactly two girls then we must select at least 3 boys for the course.
Number of ways to select girls = 4C2
= 4! / 2! (4 – 2)!
2
= 4 x 3 x 2 ! / 2! . 2!
= 2 x 3
= 6 ways
Number of ways to select 3 boys = 6C3
= 6! / 3! (6 – 3)!
= 6 x 5 x 4 x 3! / 3! ( 3)!
= 20 ways
Hence , Total way to select 5 student with exactly 2 giral is 120.
Q3: How many 3 letter works can be created using letters of DEFAULT.
Solution:
Number of arrangement of 3 letters out of 7 letters of word = DEFAULT.
7P3 = 7! / (7 – 3)!
= 7 x 6 x 5 x 4! / 4 !
= 30 x 7
= 210 words
Now, I you can try a few
Q 4 : How many words can be created using letters of word – EXAMINATIONS. ?
Q 5: Find number of even numbers between 100 and 1000 ?
A set of element S with binary operation * is semi-group if two of the property is satisfied
2. It must satisfy associative property.
i.e., a,b,c ∈ S , then (a * b) * c = a * (b * c)
It is denoted as (S, *) where * is the binary operation.
R is set of real number, then R is semi-group with respect to addition , + and denoted as (R, +).
If S1 is subset of semi-group S, then it is called sub-semi group of S with respect to *, if S1 satisfies all the property satisfied by S.
If semi-group (S, *) has an identity element ‘e’ such that e ∈ S
e * a = a * e = a
then (S, *) is called Monoid.
If a subset (M, *) is called a sub-monoid if it satisfies all the properties of monoid (S, *) with respect to binary operation * such that e ∈ M.
If monoid have commutative property then it is called commutative monoid.
Example , a * b = b * a , where a,b ∈ (M, *).
There is two semi-group (S, *) and (T, ⨀ ), then a one – to – one function from (S, *) to (T, ⨀ ) is called Homomorphism.
There is two semi-group (S, *) and (T, ⨀ ), then a one – to – one and onto function from
(S, *) to (T, ⨀ ) is called Isomorphism.
In this article , you will find common laws for preposition logic. These are very helpful in solving problems like simplifying a complex prepositional statement into a simple one. They also form the basis for arguments which you will learn in future lessons.
Identity Laws (1)
$latex p \wedge T \equiv p$
$latex p \vee F \equiv p$
| p | T | p and T |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 | 1 |
| p | F | p or T |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 1 |
Domination Laws (2)
$latex p \vee T \equiv T$
$latex p \wedge F \equiv F$
| p | T | p or T |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| p | F | p and F |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
Idempotent Laws (3)
$latex p \vee p \equiv p$
$latex p \wedge p \equiv p$
| p | p | p or p |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| p | p | p and p |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Double Negation Law (4)
$latex \neg(\neg p) \equiv p$
| p | not p | not (not p) |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 0 | 1 |
Commutative Laws (5)
$latex p \vee q \equiv q \vee p$
$latex p \wedge q \equiv q \wedge p$
| p | q | p or q | q or p |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
| p | q | p and q | q and p |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Associative Laws (6)
$latex (p \vee q) \vee r \equiv p \vee (q \vee r)$
$latex (p \vee q) \vee r \equiv p \vee (q \vee r)$
| p | q | r | p or q | q or r | (p or q) or r | p or (q or r) |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Distributive Laws (7)
$latex p \vee (q \wedge r) \equiv (p \vee q) \wedge (p \vee r)$
$latex p \wedge (q \vee r) \equiv (p \wedge q) \vee (p \wedge r)$
| p | q | r | q and r | p or (q and r) | p or q | p or r | (p or q) and (p or r) |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
De Morgan’s Laws (8)
$latex \neg( p \wedge q) \equiv \neg p \vee \neg q$
$latex \neg( p \vee q) \equiv \neg p \wedge \neg q$
| p | q | not p | not q | not(p or q) | not p and not q |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 0 |
| p | q | not p | not q | not(p and q) | not p or not q |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 | 1 |
Absorption Laws (9)
$latex p \vee (p \wedge q) \equiv p$
$latex p \wedge (p \vee q) \equiv p$
| p | q | p and q | p or (p and q) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
| p | q | p or q | p and (p or q) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Negation Laws (10)
$latex p \vee \neg p \equiv T$
$latex p \wedge \neg p \equiv F$
| p | not p | p or not p |
|---|---|---|
| 0 | 1 | T |
| 1 | 0 | T |
| p | not p | p and not p |
|---|---|---|
| 0 | 1 | F |
| 1 | 0 | F |
In the previous post , we learned about the prepositional statements and truth tables. You can visit the first post by clicking here.
Formal definition of Tautology, “It is a statement which is True for all it’s variable values”.
Meaning, It is a compound statement and each of it’s variable has a truth value and combination of those truth value give an output which is always true. It’s very easy to understand using a truth table.
| Truth Table for P v P’ |
We can see that the output of p v p’ is True for all combination. This is called a Tautology.
Formally, “A Contradiction is a statement which is false for all possible assignments to is prepositional variables”.
If a compound statement has a truth value assigned to it’s variables and there combination is always false for all possible assignments then it is a contradiction. We will again consider an example truth table, so that it will be easier to understand.
| Truth Table for p and p’ |
Again we see that the output gives us False for all possible assignments.
“A Logical statement which is not Tautology, nor Contradiction , is called Contingency”.
To understand contingency we will construct truth table for (p ∧ q)-> r .
| Truth Table for Contingency |
Some compound statements have same truth values , it is denoted as p <=> q.
It is very simple to find, we complement the connectives ∨, ∧ , ¬ and obtain the dual of a priposition p which denoted as p*.
s = (p ∨ q) ∨ r , then Dual is s* = p ∧ ( q ∧ r)
s = p v (q ∧ r), then the Dual is s* = p ∧ ( q ∨ r)
| TRUTH TABLE FOR P’ AND Q |
| TRUTH TABLE FOR ¬p ∧ (¬p ∧ ¬q ) |
Logical statements have truth values such as true or false. One or more simple logical statements can be connected to make a compound statement which also has truth value. The connectives are logical operators that connect one or more logical statements or atomic statements.
The outcome depends on the truth value of individual statements that are part of the compound statement; therefore, all combination of truth values for each atomic statements displayed in a tabular form called the truth table including outcome for each input combinations.
In prepositional logic, there are 5 basic logical connectives which is the topic of this article. These are,
| Connective | Name | Symbol |
| Negation | Not operator | |
| Conjunction | And operator | |
| Disjunction | Or operator | |
| Implication | if-then operator | |
| Biconditional | if-and-only-iff or iff |
We have already discussed negation in previous video. Negation simply negates the truth value of an atomic statement. If
is a statement with value – True, then
is False.
The truth table for negation is given below.
The negation is unary operator which means it only takes a single element or a group of elements enclosed in parenthesis.
The conjunction is connective that takes two or more atomic statements and make a compound statement. The output of conjunction is similar to boolean and operator. If all the input combination of a compound statement is True, then the output is True; otherwise, it is False. The conjunction or and operator works on the “all or nothing” principle. The truth table for conjunction is given below.
The total number of rows in this table depends on the number of variables; therefore, if there are two variables.
Number \hspace{5px} of \hspace{5px} rows = 2^n = 2^2 =4Note that the only row with result True is where both inputs are True.
The disjunction is similar to boolean OR logic. It takes one or more atomic statement and makes a compound statement. If the said compound statement is True then there is at-least one atomic statement with a truth value – True. The truth table for disjunction also depends on the number of variables.
In the next article, we will discuss about the implication and biconditional connectives. We discuss why they are different from other basic connectives.
In previous lessons, you learned about graph models and some basic graph terminologies.
In this lesson, you will learn about simple graph types, we learned earlier that a simple graph is one in which each edge has two unique vertices.
The following is a list of simple graph types that we are going to explore.
Let us discuss each one them.
A complete graph on n vertices, denoted by $latex K_n$ is a simple graph that contains exactly one edge between each pair of distinct vertices. It any edge from the pair of distinct vertices is not connected then it is called non-complete.
Here are some examples of complete graph.
A cycle is denoted as $latex C_n$ where $latex n \geq 3$ consists of n vertices v1, v2, …, vn and edges { v1, v2 }, { v2, v3 }, …, { vn, v1}.
Here are some examples of cycles.
A wheel graph is easy to construct. You get a wheel, $latex W_n&s=1$ when you add an additional vertex to a cycle $latex C_n&s=1$, for $latex n \geq 3&s=1$ and place it in center of the cycle. This will connect each of the n vertices of cycle using new edges.
Some examples of wheels.
A n-dimensional hyper-cube or n-cube is denoted by $latex Q_n&s=1$ is simple graph that has vertices representing the $latex 2^n&s=1$ bit-strings of length n.
In this scheme, two vertices are adjacent iff the bit strings differ only in one bit position. If this is confusing for you, see the following example.
Suppose $latex Q_1&s=1$ is given by following diagram.
The n-Cube, $latex Q1$ graph contains bit string length of 1. To construct $latex Q2$ from $latex Q1$ write another copy of $latex Q1$ and prefix 0 and 1 to each opposite end.
Similarly, to draw $latex Q3$ graph from $latex Q2$, do same as above, make a copy of $latex Q2$ and add 0 and 1 to opposite ends everywhere. Then join them by edges.
There is a special type of simple graph called bipartite graph. A simple graph $latex G$ is bipartite if its vertex set $latex V$ can be partitioned into two disjoint sets – $latex V1$ and $latex V2$, such that every edge in the graph $latex G$ connects a vertex in $latex V1$ and $latex V2$. It means no edge in $latex G$ connects two distinct vertices in either $latex V1$ or $latex V2$.
When this condition is holds, then you call the pair $latex (V1, V2)$ bi-partition of $latex V$ of graph $latex G$.
Consider following graphs.
In the first graph, the vertex set $latex V$ is divided into
$latex V1 = { S, R }$
$latex V2 = { A, B, C }$
This graph is a bipartite because there is no edge between nodes of same set. Every edge is connecting two vertices – one from each subset of $latex V$.
The second graph, the vertex set is divided into
$latex V1 = { A, B }$
$latex V2 = { C, D }$
This graph is not a bipartite because $latex A$ and $latex B$ has an edge and both $latex A$ and $latex B$ belong to subset $latex V1$.
If you recall, a complete graph is a graph $latex K_n&s=1$. However, a complete bipartite graph $latex K_{m,n}&s=1$ has its vertex set $latex V$ partitioned into m and n vertices, respectively with an edge between two vertices if and only if one vertex is in the first subset and the other vertex is in the second subset.
The total number of vertices in the set $latex V = m + n$ and the total number of edges is $latex E = m * n$ in a complete bipartite graph.
In the previous lesson, you learned about graph models. In this article, you will learn about basic graph terminologies. There are some important terminologies that you will come across frequently, it is important to learn them first.
Two vertices u and v are adjacent or neighbor in graph G if u and v are endpoints of edge e of G. Then we can say that edge e is incident with vertices u and v and also, connects u and v.
The set of all neighbors of graph G = (V, E) is denoted by N(v) and it is called Neighborhood of v. The smaller v denotes a single vertex and larger V is a set of all vertices for the graph. If A is a subset of V, then N(A) is set of all vertices that are adjacent to at least one vertex in A.
$latex N(A) = \cup_{v \epsilon A}N(v)$
The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop contributes twice to the degree of the vertex. The degree of a vertex is denoted by $latex deg(v)$.
Degree of Graph
In the above figure, $latex deg(A) = deg(B) =2, deg(C) = 3$. When the degree is 0 then the node is said to be isolated and when the degree is 1, the node is said to be a pendant.
For example, $latex deg(D) = 1$ and $latex deg(E) = 0$.
The handshake theorem is a special theorem that takes the total amount of degrees of a graph. It goes like this, let $latex G = (V, E)$ be an undirected graph with m edges, then
$latex 2m = \Sigma_{v \epsilon V} deg(v)$
Note: This applies even when multiple edges and loops are present.
Example:-
Consider the above example graph $latex G = (V, E)$ where $latex V = {A, B, C, D, E }$ and $latex E = { (A, B), (A, C), (B, C), (C, D) } = |E| = 4$
$latex 2 x 4= deg(A) + deg(B) + deg(C) + deg(D) + deg(E)$
$latex 8 = 2 + 2 + 3 + 1 + 0$
$latex 8 = 8$
Right Hand Side = Left Hand Side
An undirected graph has an even number of vertices of odd degree.
To prove the above statement, we will consider a graph $latex G = (V, E)$ where $latex V$ is the non-empty set of vertices and $latex E$ is a set of edges for the graph. Now, we will divide the $latex V$ into two sets – $latex V1$ and $latex V2$.
The set $latex V1$ has all nodes with odd degrees. The set $latex V2$ has all the nodes with even degrees.
Therefore,
$latex V = V1 + V2$
Example:-
To prove this theorem let’s take a graph with $latex G = (V, E)$.
A graph with vertices that has even and odd degrees
The above graph we can split the vertices into V1 (odd degrees) and V2 (even degrees).
$latex V1 = { A, B, C , E}$
$latex V2 = { D }$
$latex deg(A) = 3$
$latex deg(B) = 3$
$latex deg(C) = 3$
$latex deg(E) = 1$
$latex \Sigma_{v \epsilon V1}deg(v) = 10$
$latex deg(D) = 2$
$latex \Sigma_{v \epsilon V2}deg(v) = 2$
Now, we need the total number of edges in G which is $latex |E| = 6$.
therefore,
$latex 2 \times 6 = 10 + 2$
$latex 12 = 12$
R.H.S = L.H.S
That means, the theorem is correct and also, $latex V1 = { A, B, C, E }$ is a set with even number of vertices with odd degrees.
We already know that a directed graph has directed edges from the lesson – graph models.
In a graph with directed edges the in-degree of vertex v, denoted by deg-{v}, is the number of edges with v as a terminal vertex.
The out-degree of vertex v, denoted by deg+{v}, is the number of edges with v as an initial vertex for the edges.
Note:- A loop on the vertex contribute 1 to both in-degree and out-degree at the same time.
Example:-
Find the in-degree and out-degree for the following directed graph $latex G = (V, E)$.
The Directed Graph with In-Degree and Out-Degrees for Each Node.
The solution to the problem of counting in-degree and out-degree of each node in the above-directed graph is given in tabular format. You can see that some nodes have 0 degrees or 0 out-degree.
In-Degree and Out-Degree for the Directed graph
Note that a graph with a directed edge and its underlying undirected graph has the same number of edges.