0% found this document useful (0 votes)
3 views

CS5002 Lecture Notes_Week 1

The document outlines the first lecture of CS 5002: Discrete Structures, focusing on mathematical logic, including definitions of propositions, truth values, and logical operators such as negation, conjunction, and disjunction. It discusses the historical development of logic from Aristotle to modern symbolic logic, and introduces concepts like predicates, quantifiers, and logical equivalences. The lecture serves as a foundation for understanding formal logic and its applications in mathematics and computer science.

Uploaded by

Jian Han
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CS5002 Lecture Notes_Week 1

The document outlines the first lecture of CS 5002: Discrete Structures, focusing on mathematical logic, including definitions of propositions, truth values, and logical operators such as negation, conjunction, and disjunction. It discusses the historical development of logic from Aristotle to modern symbolic logic, and introduces concepts like predicates, quantifiers, and logical equivalences. The lecture serves as a foundation for understanding formal logic and its applications in mathematics and computer science.

Uploaded by

Jian Han
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

CS 5002: Discrete Structures

Lecture 1
Lecturer: Adrienne Slaughter, Tamara Bonaci Scribes:

Note: LaTeX template courtesy of UC Berkeley EECS dept.


Disclaimer: These notes have not been subjected to the usual scrutiny reserved for formal publications.
They may be distributed outside this class only with the permission of the Instructor.

1.1 Overview
1. Logic: Operators, propositions, equivalences, predicates, quantifiers.
2. Introduction to Boolean algebra
3. Boolean algebra and digital logic
4. Boolean functions

1.2 Introduction

In today’s lecture, we will introduce the field of mathematical logic, a subfield of mathematics that explores
the applications of formal logic to mathematics.

1.3 Logic, mathematical logic, and logic in computer science


Logic is a science of the necessary laws of thought, without which no employment of the
understanding and the reason takes place. Immanuel Kant

It is often considered that the roots of the modern logic stem from a Greek philosopher Aristotle, who
developed the first collection of rules of deductive reasoning that were intended to serve as a basis for the
study of every branch of knowledge. Aristotle’s ideas, however, remained dormant until the seventeenth
century, when the German philosopher and mathematician Gottfried Leibniz proposed the idea of using
symbols to simplify the process of deductive reasoning, in a similar way as algebraic notation is being used
to reason about numbers and their relationship.
Leibniz’s idea was realized by the English mathematicians George Boole and Augustus De Morgan in the
nineteenth century, when they invented the field of symbolic logic. From there, mathematical logic was born.
The expressive power of formal systems, and the deductive power of formal proof system is often considered
the unifying theme of mathematical logic.
Mathematical logic is often divided into the fields of set theory, model theory, recursion theory, and proof
theory, and in this course, we will talk about all of these theories. Today, however, we will start by focusing
on logical form and logical equivalence.

1-1
1-2 Lecture 1

1.3.1 Definitions

Definition 1.1. Proposition


A proposition is a statement that is true or false, but not both.

Examples of Propositions:
• 2 + 2 = 4 TRUE
• Seattle is in Washington. True
• 3 × 6 = 15 False
• Seattle is in California. False
Practice
Which of the following are propositions?
1. What’s your favorite movie? No
2. Read the newspaper. No
3. x2 + y 2 = z 2 Yes
4. Seattle is in California. Yes
Just like with algebra, letters are used to represent propositions:
• p: 2 + 2 = 4
• q: Seattle is in California.
Definition 1.2. Truth Value The truth value of a proposition is true (T) if it is a true proposition and
false (F) if it is false.
Definition 1.3. Truth Table A truth table displays the relationship between the truth values of propositions.

p ¬p
T F
F T

This truth table introduces the negation operator: ¬

1.3.2 Logic Operators

Definition 1.4. Negation The negation operator reverses the truth value of a proposition. Represented
by the symbol: ¬
The proposition ¬p is false when p is true, and true when p is false.

p ¬p
T F
F T
Definition 1.5. Conjunction
A conjunction is a fancy word for and.
Lecture 1 1-3

Represented by the symbol: ∧


The proposition p and q is p ∧ q and is true when p and q are both true, and false otherwise.

p q p∧q
T T T
T F F
F T F
F F F
Example 1.5.1. Let’s consider the following two propositions, p and q:
p: Sam left the party.
q: Pat arrived at the party.
p∧q

p q p∧q
T T T Sam left the party and Pat arrived at the party.
T F F Sam left the party; Pat did not arrive at the party.
F T F Sam did not leave the party; Pat arrived at the party.
F F F Sam did not leave the party; Pat did not arrive at the party.

Definition 1.6. Disjunction Disjunction is a fancy word for or.


also known as inclusive OR
Represented by the symbol: ∨
The proposition p or q (written by p ∨ q) is false when p and q are false, and true otherwise.

p q p∨q
T T T
T F T
F T T
F F F
Example 1.6.1. Let’s consider the following OR example:
p: It is Wednesday.
q: I am preparing lecture.
p∨q

p q p∨q
T T T It is Wednesday and I am preparing lecture.
T F T It is Wednesday but I am not preparing lecture.
F T T It is not Wednesday, but I am preparing lecture.
F F F It is not Wednesday, and I am not preparing lecture.
1-4 Lecture 1

Sometimes I don’t prepare lecture on Wednesdays, but if it’s not Wednesday, then I am preparing lecture.

This is also known as inclusive OR: this, or that, or both.


Sometimes it’s necessary to denote the notion that something is true if p XOR q is true. This is called
exclusive or: this or that, but not both.
Definition 1.7. Exclusive Or (XOR)
Exclusive or refers to when only one of p or q is true, but not both.
Represented by the symbol: ⊕
The proposition p xor q (written by p ⊕ q) is true when p is true OR q is true, but not when p and q are
either both true or both false.

p q p⊕q
T T F
T F T
F T T
F F F
Example 1.7.1. Let’s examine the following XOR example”
p: It is Wednesday.
q: I am preparing lecture.
p⊕q
p q p⊕q
T T F It is Wednesday and I am preparing lecture.
T F T It is Wednesday but I am not preparing lecture.
F T T It is not Wednesday, but I am preparing lecture.
F F F It is not Wednesday, and I am not preparing lecture.

It is either Wednesday, or I am preparing lecture; it is never the case that I am preparing lecture on
Wednesday.
Definition 1.8. Conditional or Implication
A conditional or implication is also known as “if p, then q”. The proposition p → q is false when p is true
and q is false, and true otherwise.

p q p→q
T T T
T F F
F T T
F F T

p is sometimes considered hypothesis, antecedent, or premise. q is sometimes called the conclusion or


consequence.
Lecture 1 1-5

Example 1.8.1. Implication example


p: The weather report says rain.
q: I wear my rain coat.
p→q

p q p→q
T T T The report said rain, so I wore my coat.
T F F The report said rain, so I didn’t wear my coat.
F T T The report said sun, but I wore my coat.
F F T The report said sun, and I didn’t wear my coat.

When p is true, q is true.


When p is false, q might be either true or false, and it doesn’t matter.
In this example, when the report says rain, I always wear my rain coat; but if the report does not say rain,
I may or may not wear my rain coat.

Example 1.8.2. An example with numbers


I define p and q as integers such that:

p = x2 − 4 ≥ 0 (1.1)
q = |x| ≥ 2 (1.2)

I want to determine the relationship between p and q: is it a biconditional? implication? XOR?


To determine this, I look at what I know about p and q, and I build a truth table:

p q ???
T T Does there exist an x such that p and q are both true?
T F Does there exist an x such that p is true and q is false? .
F T Does there exist an x such thatp is falseandqis true?
F F Does there exist an x such that p and q are both false?

An implication is true exactly when the if-part is false or the then-part is true.

Example 1.8.3. If pigs fly, then your account won’t get hacked.
This proposition has the form P → Q where the hypothesis P is and the conclusion Q
is “ ”. We just have to figure out if the proposition is true: We know pigs don’t fly, so we
either are ‘ft’ or ‘ff’: Both cases make the proposition as a whole true.

Definition 1.9. Biconditional operator


The proposition p ↔ q is true when p is true and q is true,
or p is false and q is false, false otherwise.
1-6 Lecture 1

p q p→q
T T T
T F F
F T F
F F T
Example 1.9.1. Biconditional example
p: The weather report says rain.
q: I wear my rain coat.
p↔q

Actually values for p and q


p q p↔q
T T T The report said rain, so I wore my coat.
T F F The report said rain, so I didn’t wear my coat.
F T F The report said sun, but I wore my coat.
F F T The report said sun, and I didn’t wear my coat.

When p is true, q is true.


When p is false, q is false.
In this example, when the report says rain, I always wear my rain coat; but if the report does not say rain,
I never wear my rain coat.
This is an if and only if: I wear my coat if and only if the report says rain.

1.3.3 Evaluating Propositions

Grouping and Order of Operations


Parentheses are used to specify grouping. Innermost statements are evaluated first. The negation operator
is applied before all other logical operators.
¬p ∧ q is the same as (¬p) ∧ q
NOT: ¬(p ∧ q)

1.3.4 Converse and Contrapositive

The proposition q → p is the converse of p → q.


The contrapositive of p → q is ¬q → ¬p.
Example: Given the implication:
“If today is Thursday, then I have a test today”
The converse is: “If I have a test today, then today is Thursday”
Lecture 1 1-7

The contrapositive is: “If I do not have a test today, then today is not Thursday”

1.3.5 Summary: Logical Operators

Symbol said name description


¬p not p negation true when p is false.
p∧q p and q conjunction true when p and q are true.
p∨q p or q disjunction false when p and q are false.
p→q p implies q implication true when p is false or q is
true.
p↔q p if and only if q biconditional true when both p and q are
the same.
p⊕q p xor q exclusive or true when p and q are
different.

p q ¬p p∧q p∨q p→q p↔q p⊕q


T T F T T T T F
T F F T F F T
F T T F T T F T
F F F F T T F

1.3.6 Logical Equivalences

Logical Equivalence
We can evaluate the logical equivalence of two propositions by comparing the truth tables of each
statement.
Prove the following two statements are logically equivalent:
¬p ∨ q and p → q
p q ¬p ¬p ∨ q p→q
T T F T T
T F F F F
F T T T T
F F T T T

Example: Prove the following two statements are logically equivalent:


¬(p ∨ q) and ¬p ∧ ¬q

p q p ∨ q ¬(p ∨ q) ¬p ¬q ¬p ∧ ¬q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
1-8 Lecture 1

1.3.7 Predicates and Quantifiers

Is this a proposition?
p : x2 + y 2 = z 2
Well... kinda.
P (x, y, z) : x2 + y 2 = z 2
Back at the beginning, I said this is a proposition. It’s not really– it’s actually something called a predicate.
Predicates:
P (x) : x > 3
• If x = 5, P (x) = P (5) = 5 > 3 ⇒ true
• If x = 1, P (x) = P (1) = 1 > 3 ⇒ f alse
At this point, you should be thinking: But, we can define some rules that define when P is true and false.

1.3.7.1 Quantifiers:

Definition 1.10. Universal Quantifier: For All


For every value in the universe of discourse, the predicate P is true. P (x) is true for every value of x in
the universe of discourse.
∀xP (x) is a proposition because it is either true or false

Definition 1.11. Existential Quantifier


There exists a value in the universe of discourse such that P is true.
P (x) is true for some value of x in the universe of discourse.
∃xP (x) is a proposition it is either true or false

Example 1.11.1. Quantifiers


“All students in this class are in the ALIGN program. ”
Let: P (x): x is in the ALIGN program.
Define the universe of discourse as “students in this class”, or S(x).
⇒ ∀xS(x) → P (x) domain of discourse (or the universe of discourse), often just referred to as the domain

Example 1.11.2. Quantifiers


“Some students in this class live in Seattle”
Let: P (x): x lives in Seattle.
Define the universe of discourse as “students in this class”, or S(x)’.
⇒ ∃xS(x) → P (x)
Example 1.11.3. Quantifer
Going back to our example of P (x) : x > 3
Lecture 1 1-9

Define the universe of discourse as “integers”, or N (x).


⇒ ∃xN (x) → P (x)
1
Example 1.11.4.

P (x) : x is a professor
Q(x) : x is ignorant
R(x) : x is vain
Express each of the statements using quantifiers and logical operators, where the universe of discourse is
the set of all people.
1. No professors are ignorant. ∀x(P (x) → ¬Q(x))
2. All ignorant people are vain.∀x(Q(x) → R(x))
3. No professors are vain. ∀x(P (x) → ¬R(x))
4. Does (3) follow from (1) and (2)?
No. P implies not Q; P implies not R; and Q implies R, but no statement has been made about
whether P implies R. The statements do not rule out the possibility of other vain people that are not
ignorant.
Example 1.11.5. Another Example2

P (x) : x is a baby
Q(x) : x is logical
R(x) : x is able to manage a crocodile
S(x) : x is despised

Express each of the statements using quantifiers, logical connectives and the statements, where the universe
of discourse is the set of all people.
1. Babies are illogical: ∀x(P (x) → ¬Q(x))
2. Nobody is despised who can manage a crocodile. ∀x(R(x) → ¬S(x))
3. Illogical persons are despised. ∀x(¬Q(x) → S(x))
4. Babies cannot manage crocodiles. ∀x(P (x) → ¬R(x))
5. Does (4) follow from (1), (2) and (3)?
Yes.
If x is a baby, then by (1), x is illogical. By (3), x is despised. (2) says that if x could manage a
crocodile, then x would not be despised. Therefore, x cannot manage a crocodile.

1.4 DeMorgan’s Laws

¬∀xP (x) ≡ ∃x¬P (x) (1.3)


¬(P (a1 ) ∧ P (a2 ) ∧ . . . ∧ P (an )) ≡ ¬P (a1 ) ∨ ¬P (a2 ) ∨ . . . ∨ ¬P (an ) (1.4)
1 Based on Symbolic Logic by Lewis Carroll
2 Also based on Symbolic Logic by Lewis Carroll
1-10 Lecture 1

9/5/19, 3(17 PM

several laws of propositional logic that are particularly useful for establishing the logical
equivalence of compound propositions:
¬∀P (x) ≡ ∃x¬P (x) (1.5)
¬∃P (x) ≡ ∀¬P (x) (1.6)
Table 1.5.1: Laws of propositional logic.

Idempotent laws: p∨p≡p p∧p≡p

Associative laws: (p∨q)∨r≡p∨(q∨r) (p∧q)∧r≡p∧(q∧r)

Commutative laws: p∨q≡q∨p p∧q≡q∧p

p∨(q∧r)≡(p∨q)∧(p∨r p∧(q∨r)≡(p∧q)∨(p∧r
Distributive laws:
) )

Identity laws: p∨F≡p p∧T≡p

Domination laws: p∧F≡F p∨T≡T

Double negation law: ¬¬p ≡ p

p ∧ ¬p ≡ F p ∨ ¬p ≡ T
Complement laws:
¬T ≡ F ¬F ≡ T

De Morgan's laws: ¬( p ∨ q ) ≡ ¬p ∧ ¬q ¬( p ∧ q ) ≡ ¬p ∨ ¬q

Absorption laws: p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p

Conditional
p → q ≡ ¬p ∨ q p q≡(p→q)∧(q→p)
p28
identities:

Figure 1.1: Laws of propositional logic.

PARTICIPATION 1.5.2: The laws of propositional logic can be used to show logical
ACTIVITY equivalence.
1.5 Logic Puzzles (Optional)
Animation
A logic puzzle is content:
a puzzle that provides a story and some clues, and from a few clues, you use logical
reasoning to find the solution. An example is below:
undefined
Example 1.11.6. Logic Puzzle
The U.S.Animation
Air Force captions:
is currently testing a number of new experimental, supersonic aircraft, each built by a
different aerospace company. Using only the clues below, determine the price of each aircraft, as well as the
name of the company that built it. No two aircraft cost the same, and no company built more than
about:blank Page 55one
of 169

aircraft.
Lecture 1 1-11

Clues
1. The Kesseling costs $125 million.
2. The Dragon F-15 costs $175 million.
3. The plane built by Wiseman costs 25 million dollars less than the Kesseling.
4. The plane built by McConnell costs 50 million dollars more than the Vipertooth.
5. The Dragon F-15 is either the $150 million jet or the jet built by Pittakan.
A common way to solve this problem is to draw a chart, fill in the pieces of information that we know from
the clues and then deduce the unknowns from the knowns. It might look something like this:
First, we put an O in the box at the intersection of Kesseling and $125 million. Then, because the plane can
only have one price, and no other plane can have the same price, we fill in X’s to indicate that.
Clue 2: we put an O in the box at the intersection of Dragon F-15 and $175 million, and X’s in the rest of
the row and column.
Clue 3: We know how much the Kesseling costs, so now we know how much the plane built by Wiseman
costs; we mark an O at the intersection of Wiseman and $100 million and the accompanying Xs. We *also*
now know that the Kesseling is NOT made by Wiseman, so we put an X at the intersection of Kesseling and
Wiseman.
Clue 4: We don’t yet know how much the Vipertooth costs, but we know that McConnell didn’t build the
Vipertooth. We also know that the Vipertooth can’t cost $150 or $175 million, and that the plane built by
McConnell MUST cost $150 or $175 million.
Clue 5: This one is a bit more complicated. There are two truth statements here. We know that the overall
clue is TRUE, so one or both of the two statements are true. We know the first part of the statement is not
true (The Dragon F-15 costs $175, not $150 million, which we got from Clue 2), so the second part of the
clue MUST be true. So we put an O in the box at the intersection of Dragon F-15 and Pittakan, and fill in
the accompanying Xs.
At this point, we don’t have any more clues, but we are able to fill in the rest of the grid easily. Then, we
can read the solution off the grid:
An observation: when we get find a truth value of “TRUE” for a given box in the grid, we also get many
more other bits of information, and we can fill out more squares. That is, when we know that one thing
IS true, we know that many other things are FALSE. This isn’t the case when we have a piece of negative
information: just because we know that something ISN’T true, that (by itself) tell us what IS true.

1.6 Boolean Algebra

Boolean algebra is a set of rules and operations for working with variables whose values are either 0 or 1. As
it happens, the rules of Boolean algebra are very similar to the rules of propositional logic, where the value
1 typically corresponds to truth value T in the rules of propositional logic, and the value 0 to truth value F.

1.6.1 Boolean Operations

Variables that can have a value of 1 or 0 are called Boolean variables. Boolean expressions can be built
up by applying Boolean operations to Boolean variables or the constants 1 or 0.

Definition 1.12. Boolean Multiplication


1-12 Lecture 1

Boolean multiplication, denoted by ·, applies to two elements from {0, 1}, and obeys the standard rules for
multiplication. The results of the multiplication operation are the same as the logical ∧ (”and”) operation.

p q Logical p ∧ q x y Boolean x · y
T T T 1 1 1
T F F 1 0 0
F T F 0 1 0
F F F 0 0 0
Definition 1.13. Boolean Addition
Boolean addition, denoted by +, applies to two elements from {0, 1}, and obeys the standard rules for
addition, except for 1 + 1. An outcome of 2 would not be allowed because all values in Boolean algebra
must be 0 or 1. The results of the addition operation are the same as the logical ∨ (”or”) operation.

p q Logical p ∨ q x y Boolean x + y
T T T 1 1 1
T F T 1 0 1
F T T 0 1 1
F F F 0 0 0
Definition 1.14. Boolean Complement
The complement of an element, denoted with a bar symbol, reverses that element’s value. Complementing
a Boolean value is analogous to applying the ¬ (”not”) operation in logic.

p Logical ¬p x Boolean x̄
T F 1 0
F T 0 1

Precedence of Boolean operations


The value of a Boolean expression with multiple operations can depend on the order in which the operations
are applied:
• Boolean multiplication takes precedence over Boolean addition.
• The complement operation is applied as soon as the entire expression under the bar is evaluated.
• Parentheses can be used to override the precedence rules.

1.6.2 Evaluating Boolean Expressions

Two Boolean expressions are equivalent if they have the same value for every possible combination of values
assigned to the variables contained in the expressions. In propositional logic, a special symbol (≡) is used
to denote logical equivalence. In Boolean algebra, the equal sign (=) is used to denote logical equivalence.
The rules of Boolean algebra satisfy the same set of laws (pairs of equivalent expressions) that we studied
in propositional logic.
satisfy the same set of laws (pairs of equivalent expressions) that were satis?ed in
propositional logic:
Lecture 1 1-13

Table 2.1.4: Laws of Boolean algebra.

Idempotent laws: x+x=x x•x=x

Associative laws: (x + y) + z = x + (y + z) (xy)z = x(yz)

Commutative laws: x+y=y+x xy = yx

Distributive laws: x + yz =(x + y)(x + z) x(y + z) =xy + xz

Identity laws: x+0=x x•1=x

Domination laws: x•0=0 x+1=1


⎯⎯⎯⎯⎯⎯⎯
Double complement law: 𝑥=𝑥
xx=0 x+x=1
Complement laws:
1=0 0=1

De Morgan's laws: x+y=xy xy = x + y

Absorption laws: x + (xy) = x x(x + y) = x

Figure 1.2: Laws of Boolean algebra.

The laws of Boolean algebra can be applied in the same way as the laws of propositional
1.6.3 Boolean Function
logic to show that two Boolean expressions are equivalent.
Definition 1.15. Boolean Function
A Boolean function maps one or more Boolean input values to the set {0, 1}. Let B = {0, 1}. Then B k
PARTICIPATION 2.1.4: Simplifying Boolean expressions using the laws of Boolean
is the set of all k-tuples over the set B. A Boolean function with k input variables maps B k to B.
ACTIVITY algebra.
Definition 1.16. Input-Output Table
Input-output table is one way to define a Boolean function. Input-output table shows the output value of
Animation content:
the function for every possible combination of input values. A Boolean function with k input variables will
require an input/output table with 2k rows.

Definition 1.17. Miniterms and Literals


undefined
A literal is a Boolean variable or the complement of a Boolean variable. In a Boolean function whose input
variables are v1 , v2 , . . . , vk , a minterm is a product of literals u1 u2 · · · uk such that each uj is either vj or v̄j .
Animation captions:
In other words, each of the variables appearing in a literal is one of the input variables, and each input
about:blank Page 7 of 5
1-14 Lecture 1

variable appears in one of the literals.

Definition 1.18. Miniterms and Input/Output Table


Each row of a table defining a Boolean function corresponds to a minterm. The minterm evaluates to 1 if
and only if the values of the variables are set according to the corresponding row of the table.
In order to find a Boolean function that is equivalent to the function defined in a table, create a sum of
minterms. The set of minterms included in the sum corresponds exactly to those rows of the table for which
the value of the function is 1.

1.6.4 Disjunctive and Conjunctive Normal Forms

Definition 1.19. Disjunctive Normal Form (DNF)


A Boolean expression that is a sum of products of literals is said to be in disjunctive normal form
(abbreviated as DNF). In other words, a disjunctive normal form (DNF) expression has the form:

c1 + c2 + · · · + cm

where each cj for j ∈ {1, ..., m} is a product of literals.

Definition 1.20. Conjunctive Normal Form (CNF)


A Boolean expression that is a product of sums of literals is said to be in conjunctive normal form
(abbreviated as CNF). Each term in the product that is a sum of literals is called a clause. In other words,
a conjunctive normal form (CNF) expression has the form:
.
d1 · d2 · · · + dm

where each dj for j ∈ {1, ..., m} is a sum of literals, and each d1 is called a clause.

1.6.4.1 Functional Completeness

A set of operations is functionally complete if any Boolean function can be expressed using only operations
from the set. The set {addition, multiplication, complement} is functionally complete because any Boolean
function can be expressed in disjunctive normal form which only uses addition, multiplication, and complement
operations.
What happens, however, if some of the operations {addition, multiplication, complement} are hard to
implement in hardware?
For example, if the addition operation was particularly difficult to implement in hardware, we might want
to implement an equivalent Boolean function using only multiplication and complement operations. The
question that arises: is it possible to express any Boolean function using only multiplication and
complement? In other words, is the set multiplication, complement functionally complete?
The answer that that questions is YES, and here are the steps to express any Boolan function using only
multiplication and complement:
• Start with the input/output table for the function.
• Find a DNF expression that is equivalent to the function.
• Repeatedly apply De Morgan’s law to eliminate each addition operation.
Lecture 1 1-15

On the other hand, if multiplication is a difficult operation to implement (instead of addition), we might
want to implement a Boolean function using only addition and complement operations. Againm, we can do
that, and steps are as follows:
• Start with the input/output table for the function.
• Find a DNF expression that is equivalent to the starting function.
• Repeatedly apply De Morgan’s law until all the multiplication operations have been eliminated.
The result will be a Boolean expression that uses only addition and complement, and is equivalent to the
original function. Therefore, the set addition, complement is also functionally complete.
Inspired by the previous observations we might wonder: could we use only one type of operation to
compute any Boolean function? In other words, is it possible for a single Boolean operation to be
functionally complete by itself? As we’ve already seen, neither addition, multiplication, nor complement are
by themselves functionally complete, so only a new operation could possibly be functionally complete by
itself.
Luckily for us such a function exists.

1.6.4.2 NAND and NOR Operations

Definition 1.21. NAND and NOR Operations


The NAND operation (which stands for “not and”) is denoted by the symbol ↑. The expression x ↑ y
is equivalent to x ¯· y. The NOR operation (which stands for “not or”) is denoted by the symbol ↓. The
¯ y.
expression x ↓ y is equivalent to x +
Input/output tables for NAND and NOR operations are given as follows:
NAND NOR
x y x↑y x↓y
1 1 0 0
1 0 1 0
0 1 1 0
0 0 1 1

1.6.4.3 Boolean Satisfiability

Definition 1.22. Boolean Satisfiability


The Boolean satisfiability problem (called SAT for short) takes a Boolean expression as input, and asks
whether it is possible to set the values of the variables so that the expression evaluates to 1. If there is a
way to set the input variables that causes a Boolean expression to evaluate to 1, then the expression is said
to be satisfiable. Otherwise, the expression is unsatisfiable .

Solving the Boolean satisfiability problem by considering all possible settings for the variables takes time
proportional to 2n for an expression with n variables. Problems that require time proportional to an
exponential of an input are typically called non-polynomial (NP) problems, and are not considered
time efficient.
Note: While a shortcut to solving a Boolean satisfiability problem may exists, as of today, no one knows
a provably efficient method to solve SAT, despite years of research effort. In fact, many computer scientists
1-16

believe that no such eocient method exists.

1.6.5 Boolean Algebra and Digital Logic

Boolean algebra was defined by George Boole in the mid-19th century. Since then, Boolean algebra has
become the basis of computer circuit design due to the fact that the native language of computers is
expressed in 0s and 1s. Although the physical representation has since changed, the underlying mathematical
foundation is still Boolean algebra. The area of computer science concerned with designing computer circuitry
is called digital logic, an indication of the vital role that logic plays in this field.
Circuits are built from electrical devices called gates. A gate receives some number of Boolean input values,
and produces an output based on the values of the inputs. Thus, a gate implements a simple Boolean
function.
Three types of gates that perform the three basic Boolean operations include:
• The AND gates - compute Boolean multiplication
• The OR gates - compute Boolean addition
• The inverters - compute the complement
Summary
• Propositions
• Truth Values
• Truth Tables
• Logical operators (sometimes called Logic Connectives), to create compound statements
• Predicates
• Quantifiers
• Universe of discourse
• Laws of propositional logic
• De Morgan Laws
• Nested quantifiers
• Boolean algebra
• Boolean variables
• Boolean expressions
• Literals
• Miniterm
• Disjunctive Normal Form (DNF)
• Conjunctive Normal Form (CNF)
• Functional completeness
• NAND operation
• NOR operation
• Boolean satisfiability (SAT) problem
• Digital Logic
• Gates

You might also like