Академический Документы
Профессиональный Документы
Культура Документы
PROPOSITIONS
A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both. We use
letters to denote propositional variables (or statement variables), that is, variables that represent propositions, just as letters are
used to denote numerical variables. The conventional letters used for propositional variables are p, q, r, s . . . The truth value of
a proposition is true, denoted by T, if it is a true proposition, and the truth value of a proposition is false, denoted by F, if it is a
false proposition.
The area of logic that deals with propositions is called the propositional calculus or propositional logic. It was first developed
systematically by the Greek philosopher Aristotle more than 2300 years ago.
COMPOUND PROPOSITION
We now turn our attention to methods for producing new propositions from those that we already have. These methods were
discussed by the English mathematician George Boole in 1854 in his book The Laws of Thought. Many mathematical statements
are constructed by combining one or more propositions. New propositions, called compound propositions, are formed from
existing propositions using logical operators.
DEFINITION 1
Let p be a proposition. The negation of p, denoted by ¬p (also denoted by p), is the statement
“It is not the case that p.”
The proposition ¬p is read “not p.” The truth value of the negation of p, is the opposite of the truth value of p.
DEFINITION 2
Let p and q be propositions. The conjunction of p and q, denoted by
p Λ q, is the proposition “p and q.” The conjunction p Λ q is true when both p and q are true and is false otherwise. (“p but q”)
Let p: Today is Monday
q: It is sunny today
DEFINITION 3
Let p and q be propositions. The disjunction of p and q, denoted by
p V q, is the proposition “p or q.” The disjunction p V q is false when both p and q are false and is true otherwise.
Let p: I will pass the exam.
q: I will fail.
DEFINITION 4
Let p and q be propositions. The exclusive or of p and q, denoted by
p q, is the proposition that is true when exactly one of p and q is true and is false otherwise.
DEFINITION 5
The statement p → q is called a conditional statement because p → q asserts that q is true on the condition that p holds. A
conditional statement is also called an implication.
In the conditional statement p → q, p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or
consequence).
TERMINOLOGY USED TO EXPRESS P → Q
“if p, then q” “p implies q”
“if p, q” “p only if q”
“p is sufficient for q” “a sufficient condition for q is p”
“q if p” “q whenever p”
“q when p” “q is necessary for p”
“q follows from p” “q unless ¬p”
“a necessary condition for p is q”
DEFINITION 6
Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and only if q.” The biconditional
statement p ↔ q is true when p and q have the same truth values, and is false otherwise. Biconditional statements are also called
bi-implications.
There are some other common ways to express p ↔ q:
“p is necessary and sufficient for q”
“if p then q, and conversely”
“p iff q.”
TRUTH TABLES
p q ¬p pΛq pVq p q p→q p↔q
T T F T T F T T
T F F F T T F F
F T T F T T T F
F F T F F F T T
¬ 1
V 3
→ 4
↔ 5
1 1 1 1 0
1 0 1 0 1
0 1 1 0 1
0 0 0 0 0
We can extend bit operations to bit strings. We define the bitwise OR, bitwise AND, and bitwise XOR of two strings of the same
length to be the strings that have as their bits the OR, AND, and XOR of the corresponding bits in the two strings, respectively.
We use the symbols V, Λ, and to represent the bitwise OR, bitwise AND, and bitwise XOR operations, respectively.
LESSON 2
PROPOSITIONAL EQUIVALENCES
DEFINITION 1:
CLASSIFICATION OF COMPOUND PROPOSITIONS
A compound proposition that is always true, no matter what the truth values of the propositional variables that occur in it, is
called a tautology. A compound proposition that is always false is called a contradiction. A compound proposition that is neither
a tautology nor a contradiction is called a contingency.
LOGICAL EQUIVALENCES
Compound propositions that have the same truth values in all possible cases are called logically equivalent.
DEFINITION 2:
The compound propositions p and q are called logically equivalent if p ↔ q is a tautology. The notation p ≡ q denotes that p and
q are logically equivalent.
pVF≡p
pΛF≡F
pΛp≡p
pΛq≡qΛp
(p V q) V r ≡ p V (q V r) Associative laws
(p Λ q) Λ r ≡ p Λ (q Λ r)
p V (q Λ r) ≡ (p V q) Λ (p V r) Distributive laws
p Λ (q V r) ≡ (p Λ q) V (p Λ r)
¬(p V q) ≡ ¬p Λ ¬q
p V (p Λ q) ≡ p Absorption laws
p Λ (p V q) ≡ p
p V ¬p ≡ T Complement laws
p Λ ¬p ≡ F
p → q ≡ ¬p V q Implication
p q ≡ (¬p Λ ¬ q) V (p Λ q) Biconditional
The symbol ≡ is not a logical connective, and p ≡ q is not a compound proposition but rather is the statement that p ↔ q is a
tautology. The symbol is sometimes used instead of ≡ to denote logical equivalence.
Example:
1. Show that ¬ [p V (¬p Λ q)] and ¬p Λ ¬q are logically equivalent by developing a series of logical equivalences.
PROOF REASON
¬ [T Λ ( p V q)]
Identity
¬p Λ ¬q
[p Λ (p → q)] → q
PROOF REASON
[p Λ (¬p V q)] → q
Distributive
[F V ( p Λ q)] → q
( p Λ q) → q
Implication
(¬ p V ¬q) V q
¬ p V (¬q V q)
¬pVT
p Q (p → q) Λ →q
T T T T T
T F F F T
F T T F T
F F T F T
[¬P Λ (P V Q)] V F
[¬P Λ (P V Q)]
(¬P Λ P) V (¬P Λ Q)
F V (¬P Λ Q)
¬P Λ Q
P Q PVQ
T T T F
T F T F
F T T T
F F F F
Seatwork:
1. Simplify the following:
a. ¬[A (¬A B)]
b. ¬[A V (¬A Λ B)]
c. [(S V M) Λ (S V ¬M)] V S
d. (A Λ B) V (¬A Λ B) V (A Λ ¬B)
e. (A B) V (A Λ B)
f. (A B) V (A Λ ¬B)
LESSON 3
SET THEORY
SET, Defined:
is a collection of well-defined distinct objects
unordered collection of objects, called elements or members of the set
NAMING A SET
A set can be named using any capital letter in the English alphabet except from U.
Each object in a set is called “elements”.
e.g.: C = { mouse, printer, keyboard, CPU, monitor}
V = {a, e, i, o, u}
A = {1, 2, 3, 4, 5}
2.) Rule method (set builder notation) – it makes use of the description {x | x is an element of…}, which read
as “x such that x is an element of…”
e.g.: C = {x | x is an even integer between 0 and 8}
V ={ x|x is an element of computer hardware}
A = {x/5 | x is a whole number less than 5}
These sets each denoted using a boldface letter, play an important role in discrete mathematics:
W = {1, 2, 3 . . .}, the set of whole numbers
Z = {. . . , −2, −1, 0, 1, 2 . . .}, the set of integers
Z+ = {1, 2, 3 . . .}, the set of positive integers / natural numbers
Q = {p/q | p ∈ Z, q ∈ Z, and q ≠ 0}, the set of rational numbers
R = the set of real numbers
R+ = the set of positive real numbers
C = the set of complex numbers
KINDS OF SET
1.) Equal set – are sets containing exactly the same elements.
e.g.: A = {1, 2, 3, 4, 5}
B = {2, 4, 1, 3, 5}
Therefore, A = B
2.) Equivalent set – are sets with the same number of elements.
e.g.: A = {1, 2, 3, 4, 5}
B = {a, e, i, o, u}
Therefore, A ~ B
3.) Finite set – contains countable number of elements.
e.g.: A = {a, e, i, o, u}
B = { x|x is an element of months in a year}
4.) Infinite set – contains uncountable number of elements.
e.g.: Z = {…, -3, -2, -1, 0, 1, 2, 3 …}
B = {x | x is an element of grains of rice}
Cardinality comes from the common usage of the term cardinal number as the size of a finite set.
VENN DIAGRAM
Is a picture representation of sets, developed by John Venn in 1880 which makes use of rectangle as the
universal set and circles as its subsets
A B
OPERATIONS ON SET
1.) Union () – is the combination of elements in two or more sets without repetition.
e.g.: A = {1, 2, 3, 4, 5}
B = {2, 4, 6, 8, 10} U
AB = {1, 2, 3, 4, 5, 6, 8, 10}
A B
*some reference uses () “or” symbol
to denote Union.
2.) Intersection () – are the element common in the given sets.
e.g.: A = {1, 2, 3, 4, 5}
B = {2, 4, 6, 8, 10} U
AB = {2, 4}
A B
*some reference uses () “and” symbol
to denote Intersection.
3.) Complement (‘) – these are elements found in the universal set but not on the given set.
e.g.: U = {0, 1, 2, 3, 4, 5}
A = {2, 3, 4} U
A’ = {0, 1, 5}
A
4.) Difference ( – ) – these are elements found in a given set but not on the other set.
e.g.: A = {1, 2, 3, 4, 5}
B = {2, 4, 6, 8, 10} U
A – B = {1, 3, 5}
B – A = {6, 8, 10}
A B
2.) Intersection
AU=A A= AA=A
3.) Complement
A’ U = U A’ A = U A’ A =
4.) Difference
A – B = B’ A B – A = A’ B
SET IDENTITIES
1.) Commutative Law
AB=BA AB=BA
2.) Associative Law
A (B C) = (A B) C A (B C) = (A B) C
3.) Distributive Law
A (B C) = (A B) (A C) A (B C) = (A B) (A C)
4.) Identity Law
A=A AU=A
5.) Inverse Law
A’ A = U A’ A =
6.) Domination Law
AU=U A=
7.) Idempotent Law
AA=A AA=A
8.) Complementation
(A’)’ = A
9.) De Morgan’s Law
(A B)’ = A’ B’ (A B)’ = A’ B’
MEMBERSHIP TABLES
Set Notation can be proven using Membership Tables. We consider each combination of sets that an element can
belong to and verify that elements in the same combinations of sets belong to both sets in the identity. To indicate
that an element is in a set, a 1 is used; to indicate that an element is not in a set, a 0 is used.
S D
EXERCISE 1: SETS
LESSON 5
GRAPH THEORY
GRAPH THEORY
The 7 Bridges of Konigsberg
Konigsberg (now called Kaliningrad) is a city on the Baltic Sea wedged between Poland and Lithuania.
A river runs through the city which contains a small island.
There are 7 bridges which connect the various land masses of the city.
The City of Konigsberg
The problem was solved by Leonhard Euler (1707-1783)
TERMS
- a graph becomes a model when a graph is used to represent either a physical entity, or a conceptual entity
1. Niche overlap graphs
Graphs used involving the interaction of different species of animals, it shows the competition between species in an
ecosystem.
2. Acquaintance Graph
Representation whether two persons know each other, that is, whether they are acquainted.
3. Influence Graph
In studies of group behavior it is observed that certain people can influence the thinking of others.
Who influences Brian?
Who can influence Deborah?
Exercise 1
1. Construct a precedence graph for the following program
S1 : x : = 0
S2 : x : = x + 1
S3 : y : = 2
S4 : z : = y
S5 : x : = x + 2
S6 : y : = x + 2
S7 : z : = 4
2. Construct a niche overlap graph for six species of birds, where the hermit thrush competes with the robin and with the blue jay,
the robin also competes with the mockingbird, the mockingbird also competes with the blue jay, and the nuthatch competes with
the hairy woodpecker.
6. Draw a precedence graph that shows the precedence relationship between the following tasks that Joey must complete before
going to bed.
Tasks include: Climbing into bed, brushing teeth, putting on PJs, taking a bath, eating a snack, and turning the night light on at
the far corner of his room.
Reading from the graph, can you determine a possible order for Joey to accomplish his goal of getting to bed? How many
different ways can he order the tasks and get to bed, without violating any of the precedence constraints?
BASIC TERMINOLOGIES
Given two vertices u and v connected by an edge e
Adjacent (neighbors) – two vertices are adjacent if they are connected by an edge. (u and v = adjacent)
Incident – an edge is incident to the vertices it connects. (e is incident with the vertices u and v)
Endpoints – vertices u and v are called endpoints of the edge e.
Size – of a graph is the number of vertices that the graph has.
Path – the route traveled along edges and through vertices.
Given a directed graph
Initial vertex – outgoing transition of an edge. (Source)
Terminal/end vertex – destination of the transition of the edge
Note: the initial vertex and the terminal vertex of a loop are the same
Degree of a Vertex
Theorem 1: Handshaking Theorem
G=(V,E) an undirected graph with e edges.
Note: This applies even if multiple edges and loops are present
Sample:
a. How many edges are there in an undirected graph with the degree sum of 14?
b. Given a graph with 5 vertices whose degree are 4, 6, 1, 5, 6 respectively, determine the number of edges and draw the graph if
it exists.
Graph Representation
Isomorphisms of Graphs
Isomorphic graphs have same form, there is a one-to-one correspondence between vertices that preserves edges
Shortest-Path Problems
Many problems can be modeled using graphs with weights assigned to their edges. Problems involving distances
can be modeled by assigning distances between cities to the edges. Problems involving flight time can be modeled
by assigning flight times to edges. Problems involving fares can be modeled by assigning fares to the edges.
Length of a path in a weighted graph is the sum of the weights of the edges of this path
A Shortest-Path Algorithm
Theorem 2
Dijkstra’s algorithm uses O(n2) operations (additions and
comparisons) to find the length of a shortest path between two
vertices in a connected simple undirected weighted graph with
n vertices.