Download PPT - Department of Mathematics and Computer Science

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Logic and Introduction to Sets
Chapter 6
6.1 Logic
. procedures for the simplex method will be illustrated
The
through an example. Be sure to read the textbook to fully
understand all the concepts involved.
Dr .Hayk Melikyan/ Department of Mathematics and CS/
[email protected]
Logic
Logic is not only the foundation of mathematics, but
also is important in numerous fields including law,
medicine, and science. Although the study of logic
originated in antiquity, it was rebuilt and formalized in
the 19th and early 20th century. George Boole (Boolean
algebra) introduced mathematical methods to logic in
1847 while Georg Cantor did theoretical work on sets
and discovered that there are many different sizes of
infinite sets.
Statements or Propositions





A proposition or statement is a declaration which is
either
true
or
false.
Some examples:
2+2 = 5 is a statement because it is a false
declaration.
Orange juice contains vitamin C is a statement that
is true.
Open the door. This is not considered a statement
since we cannot assign a true or false value to this
sentence. It is a command, but not a statement or
proposition.
Negation

The negation of a statement, p , is “not p”
and is denoted by ┐ p
Truth table:
p
┐p
T
F
F
T

If p is true, then its negation is false. If p is false, then its




negation is true.
Disjunction (logical sum or addition)



A disjunction is of the form p V q and is read p or q.
Truth table for disjunction:
p
q
pVq


T
T
F
F

A disjunction is true in all cases except when



T
F
T
F
T
T
T
F
both p and q are false.
Conjunction (logical product or multiplication)


A conjunction is only true when both p and q are true.
Otherwise, a conjunction of two statements will be false:
Truth table:
p
q
T
T
F
F
T
F
T
F
p

T
F
F
F
q
Conditional statement










To understand the logic behind the truth table for the conditional statement,
consider the following statement.
“If you get an A in the class, I will give you five bucks.”
Let p = statement “ You get an A in the class”
Let q = statement “ I will give you five bucks.”
Now, if p is true (you got an A) and I give you the five bucks, the truth value of
p
q is true. The contract was satisfied and both parties fulfilled the
agreement.
Now, suppose p is true (you got the A) and q is false (you did not get the five
bucks). You fulfilled your part of the bargain, but weren’t rewarded with the five
bucks.
So p
q is false since the contract was broken by the other party.
Now, suppose p is false. You did not get an A but received five bucks anyway. (q is
true) No contract was broken. There was no obligation to receive 5 bucks, so truth
value of p
q cannot be false, so it must be true.
Finally, if both p and q are false, the contract was not broken. You did not receive
the A and you did not receive the 5 bucks. So p
q is true in this case.
Truth table for conditional

p
q
T
T
F
F
T
F
T
F
p
q
T
F
T
T
Variations of the conditional

Converse:

Contrapositive:
┐q
The converse of p
┐p
q is q
The contrapositive of p
p
q is
Examples

Let p = you receive 90%
Let q = you receive an A in the course
p
q?

If you receive 90%, then you will receive an A in the course.

Converse: q




p
If you receive an A in the course, then you receive 90%
Is the statement true? No. What about the student who
receives a score greater than 90? That student receives an A
but did not achieve a score of exactly 90%.
Example 2








State the contrapositive in an English sentence:
Let p = you receive 90%
Let q = you receive an A in the course
p
q?
If you receive 90%, then you will receive an A in the course
┐q
┐p
If you don’t receive an A in the course, then you didn’t receive 90%.
The contrapositive is true not only for these particular statements but for
all statements , p and q.
Logical equivalent statements



Show that
pq
is logically equivalent to p  q
We will construct the truth tables for both sides and
determine that the truth values for each statement are
identical.
The next slide shows that both statements are logically
equivalent. The red columns are identical indicating the
final truth values of each statement.
6.2 Sets
This section will discuss the
symbolism and concepts of set
theory
Set properties and set notation



Definition of set: A set is any collection of objects
specified in such a way that we can determine
whether or not an object is or is not in the collection.
Example 1. Set A is the set of all the letters in the alphabet.
Notation:
A = { a, b, c, d, e, …z)
We use capital letters to represent sets. We list the elements
of the set within braces. The three dots … indicate that the
pattern continues. We can determine that an object is or is
not in the collection.
For example . e  A stands for “e is an element of , or e
belongs to set A” . This statement is true.
The statement “ 3  A is false, since the number 3 is not an
element of set A. The statement “ 3 ∈ A” is true.
Null set (Empty Set)

Example. What are the real number solutions of the equation?
x2  1  0

Answer: There are no real number solutions of this equation since
no real number squared added to one can ever equal 0. We
represent the solution as the null set { } or Ø
Set builder notation

Sometimes it is convenient to represent sets using what is called setbuilder notation. For example, instead of representing the set A, letters in
the alphabet by the roster method, we can use set builder notation:
 x x is letter of the English alphabet
means the same as { a , b , c, d, e , …z}

Example two. { x l x 2  9 } = {3 , -3} . This is read as the set of all such
that the square of x equals 9. The solution set consists of the two
numbers 3 and -3.
Subsets





A
B means A is a subset of B. A is a subset of A if every element of A
is also contained in B. For example, the set of integers denoted by
{ …-3, -2, -1, 0, 1, 2, 3, …} is a subset of the set of real numbers.
Formal definition of subset: A
B means if x
A, the x  B
 (null set )is a subset of every set. To verify this statement, let’s use
the definition of subset. “ if x   , then x is an element of A. But

since the null set contains no elements,
the statement x is an element
of the null set is false. Hence, we have a conditional statement in
which the premise is false. We know that p
q is true if p is false.
Since p is false, we conclude that the conditional statement is true.
That is “ if x belongs to the null set, then x belongs to set A” is true,
which implies that the null set must be a member of every set.
Therefore, the null set is a subset of every set.

Number of subsets

List all the subsets of set A = {bird, cat, dog} For
convenience, we will use the notation A = {b , c, d} to
represent set A.
Solution:  is a subset of A. We also know that every set
is a subset of itself so A = {b , c, d } is a subset of set A
since every element of set A is contained within set A.
How many two-element subsets are there?
We have {b, c}, {b, d} , {c, d}
How many one-element subsets? { b} , {c} and {d} .
There is a total of 8 subsets of set A if you count all the
listed subsets.
Set operations
The union of two sets is the set of all elements formed by combining all
the elements of set A and all the elements of set B into one set.
The symbolism used is The Venn Diagram representing the union of A
and B is the entire region shaded yellow.
A
B
A B  {x x  A or x  B}
Example of Union

The union of the rational numbers with the set of irrational numbers is
the set of real numbers. Rational numbers are those numbers that can
be expressed as fractions, while irrational numbers are numbers that
cannot be represented exactly as fractions, such as
2

Rational numbers
a/b, ¾, 2/3 , 0.6
Irrational numbers
such as square root
of two, Pi , square
root of 3
Real numbers: represented by shaded blue-green region
Intersection of sets A and B

The intersection of sets A and B is the set of elements that is common
to both sets A and B. It is symbolized as


A B  { x l x ∈A
and x ∈B }


Represented by Venn Diagrams:
A
B
Intersection
Complement of a set




To understand the complement of a set, we must first define the universal set.
The set of all elements under consideration is called the universal set.
For example, when discussing numbers, the universal set may consist of the
set of real numbers. All other types of numbers (integers, rational numbers,
irrational numbers ) are subsets of the universal set of real numbers.
Complement of set A: The complement of a set A is defined as the set of
elements that are contained in U, the universal set, but not contained in set A.
The symbolism for the complement of set A follows:
A’ = { x ∈ U |x∈ A}
Venn Diagram for complement of set A

Yellow region=
 all
elements in U that
are neither in A or
B.
A
Elements of set
B that are not
in A
A’
A’
B
The complement of set A is
represented by the regions that
are colored blue and yellow. The
complement of set A is the region
outside of the white circle
representing set A.
Related documents