You are on page 1of 12

Logic

Logic: study or science of correct reasoning


All angels are saints
All saints are sinners
Hence, all angels are sinners.
It's correct. Look not on the contents but on the relationships.
Proposition: Declarative statement that is of true value or false value but not both at the same time
1. It should be a declarative statement.
2. It should be answerable by True or False.
Examples:
Identify if they are propositions or not.
1. All real numbers are complex numbers. Answer: Proposition / True
a. Real numbers are all numbers that can be found on the number line.
b. Complex numbers are numbers in the form of a+bi, where a and b are real numbers
c. Real numbers are just complex numbers where b = 0.
2. Run! Answer: Not a proposition
a. Because it is not a declarative statement. It is an exclamatory statement.
3. One (1) is a prime number. Answer: Proposition / False
a. One (1) is uncategorized prime or composite.
4. Jemma bought a ticket. Answer: Proposition / Undefined
a. We just don't know if the event really happened or not.
5. Peel me a grape. Answer: Not a proposition
a. It is an imperative statement.
Logical Connectives
1. Conjunction = p and q / p ^ q
a. TRUE if both are true
2. Disjunction / p or q / (p v q)
a. TRUE if one or both of them is true
3. Exclusion or / p exclusive or q / p q
a. TRUE if one of them is true
b. FALSE if both are true.
4. Negation / p is not p /
Truth Table
p

p^q

pvq

pq

~P

2n is the number of rows where n is the number of propositions

Examples:
1) P = Ric drove a car
Q = Jen got a car
Discrete Mathematics Page 1

Q = Jen got a car


Answer:
p ^ q = Ric drove a car and Jen got a car.
p v q = Ric drove a car or Jen got a car.
~P v ~Q = Ric did not drove a car or Jen did not get a car.
1) P: 3+4 = 6
Q: 2+8 3-5
R: 6-2 > 4+3
Answers:
~P ^ ~Q: 3+4 6 and 2+8 > 3-5
Q v ~R: 2+8 3-5 or 6-2 4+3
4. Conditional where p is the hypothesis and q is the conclusion / if p then q / p --> q
a. The conclusion determines if it's true or false.
b. If p is false and q is false, then the statement is true.
5. Biconditional where p is the hypothesis and q is the conclusion / p iff q / p <---> q
a. TRUE if both values are the same
Truth Table
p

p ---> q p <---> q

6. Inverse of p --> q is ~p --> ~q (negation)


7. Converse of p --> q is q --> p (baliktad)
8. Contrapositive of p --> q is ~q to ~ (baliktad and negation)
Example:
1. When my ears hurt, Jen sings.
Answers:
* When, If, a necessary condition + premise, conclusion
* "A sufficient condition" follows a conclusion before hypothesis
P = When my ears hurt
Q = Jenny sings
P --> Q: If my ears hurt, then Jenny sings
Inverse: ~P --> ~Q / If my ears doesn't hurt, then Jenny doesn't sing.
Converse: Q --> P / If Jenny sings, then my ears hurt.
Contrapositive: ~Q --> ~P / If Jenny doesn't sing, then my ears don't hurt.
2. Rex can dance only if he can sing.
Answers:
P --> Q: If Rex can sing, then he can dance.
Inverse: ~P --> ~Q: If Rex cannot sing, then he cannot dance.
Converse: Q --> P: If Rex can dance, then he can sing
Discrete Mathematics Page 2

Converse: Q --> P: If Rex can dance, then he can sing


Contrapositive: ~Q --> ~P: If Rex cannot dance, then he cannot sing.
Q-->~P: If Rex can dance, then he cannot sing.

3. A necessary condition for the Spurs to win the game is that the Miami quits the game.
Answers:
P --> Q: If the Spurs wins the game, then the Miami quits the game.
Inverse: ~P ---> ~Q: If the Spurs didn't win the game, then the Miami didn't quit the game.
Converse: Q --> P: If the Miami quits the game, then the Spurs wins the game.
Contrapositive: ~Q --> ~P: If the Miami doesnt quit the game, then the Spurs doesn't win the game
4. A sufficient condition for Erica to go to Manila is that she lives in Pureza

P --> Q: If Erica lives in Pureza, then she can go to Manila


Inverse: ~P --> ~Q: If Erica doesn't live in Pureza, then she cannot go to Manila.
Converse: Q --> P: If Erica can go to Manila, then she lives in Pureza
Contrapositive: ~Q --> ~P: If Erica cannot go to Manila, then she doesn't live in Pureza.
Create a Truth Table:
1. p^q --> ~q v r
p

p^q

~q

~q v r

p^q --> ~q v r

2. ~ (P-->~Q) (q v ~r )
~r

q v ~r

~ (P-->Q) (q v ~r )

~q

p --> ~q ~ ( p --> ~q)

3. ~(P --> (~q ^ ~r) v (pr))

Discrete Mathematics Page 3

~q

~r

(~q ^ ~r) p --> (~q v ~ r)

pr

~C

Discrete Mathematics Page 4

An argument is a sequence of propositions written in:


Or

Rules of Inference:

Discrete Mathematics Page 5

(You can conjunct two different conditional proposition)

Discrete Mathematics Page 6

Discrete Mathematics Page 7

Set Theory
Friday, August 01, 2014

7:45 PM

2.1 Sets
Set is a well-designed collection of distinct objects.
a. Well-designed (clear/specific)
b. Collection (group of any objects or no objects)
c. Distinct (unique / no repetitions)
*A set (upper case letter) is an unordered collection of objects, called elements or members (lower case letters) of the set.
*aA to denote that a is an element of the set A.
*a"A denotes that a is not an element of the set A.
*Sets can have other sets as members.
*The order in which the elements of a set are listed does not matter. {1, 3, 5} = {3, 5, 1}
*It does not matter if an element is listed more than once. {1,1,1,3,3,3,5,5,5,} = {3, 5, 1}
3 Methods in Writing Sets
1. Rule Method: describes the elements of a given set
2. Roster Method: list all the elements of a given set
*Seemingly unrelated elements are possible.
*Describes a set without listing all of its members through ellipsis () when the general pattern of the elements is obvious.
Examples:
1. The set V of all vowels in the English alphabet can be written as V={a, e, i, o, u}
2. The set O of odd positive integers less than 10 can be expressed by O={1,3,5,7,9}.
3. {a,2,Fred,New Jersey} is the set containing the four elements a, 2, Fred, and New Jersey.
4. The set of positive integers less than 100 can be denoted by {1,2,3,...,99}
3. Set Builder Notation: uses letters to represent numbers
*stating the property or properties they must have to be members
*If no numbers, nothing to represent
Examples:
1. the set O of all odd positive integers less than 10 can be written as O = {x|x is an odd positive integer less than 10} or
O={xZ+|x is odd and x<10}
2.
Rule Method

Roster Method

Set Builder Notation

A = {All integers from 6 and 10}

A = {6,7,8,9,10}

A = {xZ|6x10}

B = {All Integers from 12 to 14}

B = {12, 13, 14}

B = {xZ|12x<15}

C = {First three months of the Gregorian Calendar} C = {January, February, March}

None

D = {Positive even integers from 2 to 10}

D = {2, 4, 6, 8, 10}

D = {nZ|1n10 and n is even}

E = {All prime numbers from 2 to 7}

E = {2, 3, 5, 7}

E = {xZ|1x10 and x is prime}

*Set A is equal to Set B (A = B): if they have the same elements. A = B = AB and BA

Sets and Subsets:


*Universal Set (U) = contains all the objects under consideration
*Subset (AB) = A is a subset of B (all elements of A are in B). (Lahat ng elements ng A within B)
*Every nonempty set S is guaranteed to have at least two subsets, the empty set (S) and the set S itself (SS).
*Proper Subset (AB) = A is a proper subset of B if A is not equal to B. (Lahat ng elements ng A within B at mas malaki si B dapat)
*For AB to be true, it must be the case that AB and there must exist an element x of B that is not an element of A.
Discrete Mathematics Page 8

*For AB to be true, it must be the case that AB and there must exist an element x of B that is not an element of A.
*A proper subset can be a subset too!
Kinds of Sets:
*Cardinality of sets|n|= positive number of elements in a set.
*Finite Set = a set with countable numbers with n cardinality
*Infinite Set = a set with uncountable number of elements. Undefined cardinality. The set of positive integers is infinite
*Null Set or Empty Set () = set containing no elements. Zero cardinality.
*Singleton Set {} = set containing one element. One cardinality
*Power Set (P(S)) = set containing all of its subsets.
*Power set of a null set is itself. P() = {}
*If a set has n elements, its power set should contain 2 n elements.
1. K = {10, 20,30}
a. Finite Set
b. Cardinality = 3
2. L = {4,5,6,7}
a. Infinite Set (due to the ellipsis)
b. Cardinality: Undefined
3. O = {0}
a. Finite Set
b. Cardinality = 1
4. P = { }
a. Null Set
b. Cardinality = 0
5. W = {6, 7, 8, 9, 10}
X = {7, 8, 9}
Y=
Z = {8, 9, 7}
a. W X: False.
b. X W: True.
c. Y Z: True.
d. Z Y. False.
e. X W. True.
f. Z X. False.

Questions:
1. List all the elements of the set {x|x is the square of an integer and x<100} = {0,1,4,9,16,25,36,49,64,81}
2. A= {{1}} and B = {1,{1}} = Unequal Sets
3. 2 is not an element of {{2},{{2}}} / {{2},{2,{2}}} / {{{2}}}
4. {0} --> False, because is a set, not an element.
5. Find the number of elements of the power set of:
a. P({a, b,{a, b}}) = 8
b. P({,a,{a},{{a}}} = 16
c. P(P()) = 2
2.2 Set Operations:
1. Union (AB) = Pagsamahin.
a. Cardinality of two unioned sets (principle of inclusion-exclusion): |AB|=|A|+|B||AB|
2. Intersection (AB) = Common Elements
a. No intersection? A and B are disjoints
3. Difference (A-B) = Tanggalin lahat ng elements ng B from A.
a. Another denotation (A\B)
b. Also called as the complement of B with respect to A
4. Complement of A (A') = U - A
Discrete Mathematics Page 9

4. Complement of A (A') = U - A
5. Exclusive Union or Symmetric Difference: AB=(AB)(AB)

Discrete Mathematics Page 10

Number Theory
Tuesday, August 12, 2014

9:24 PM

Number theory - the part of mathematics devoted to the study of the set of integers and their properties.
Modular arithmetic operates with the remainders of integers z they are divided by a fixed positive integer, called the
modulus.
*Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the
remainder of the Euclidean division of a by n.
Division:
a|b = a divides b
* There is an integer c such that b=ac, or equivalently, if b/a is an integer.
* When a divides b, we say that a is a factor or divisor of b, and that b is a multiple of a.
* a |/ b = "a doesn't divide b"
Theorem 1:
*Let a, b, and c be integers, where a=/0. Then:
(i) if a|b and a|c, then a|(b+c);
(ii) if a|b,then a|bc for all integers c;
(iii) if a|b and b|c, then a|c.
* If a, b, and c are integers, where a/=0, such that a|b and a|c, then a|mb + nc whenever
M and n are integers.
The Division Algorithm:
Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 r<d, such that a=dq+r.
*In the equality given in the division algorithm, d is called the divisor, a is called the dividend, q is called the quotient,
and r is called the remainder. This notation is used to express the quotient and remainder:
q=a div d, r= a mod d.

*a div d = a/d
*a mod d = a d
Congruence Modulo
*If a and b are integers and m is a positive integer, then a is congruent to b modulo m if m divides ab. We use the
notation a b(mod m) to indicate that a is congruent to b modulo m. We say that ab (mod m)is a congruence and
that m is its modulus (plural moduli).
*Let a and b be integers, and let m be a positive integer. Then a b (mod m) if and only if a mod m= b mod m.
*Recall that a mod m and b mod m are the remainders when a and b are divided by m, respectively.
Letmbe a positive integer. The integersaandbare congruent modulomif and only if there
is an integerksuch thata=b+km.
Letmbe a positive integer. Ifab(modm)andcd(modm), then
a+cb+d(modm) and acbd (modm).
Letmbe a positive integer and letaandbbe integers. Then
(a+b)modm=((amodm)+(bmodm))modm
and
abmodm=((amodm)(bmodm))modm.

Discrete Mathematics Page 11

Although we commonly use decimal (base 10), representations, binary (base 2),
octal (base 8), and hexadecimal (base 16) representations are often used, especially in computer
science.
the termalgorithmoriginally referred to procedures for performing arithmetic operations using the decimal
representations of integers
Representation of Integers:
Decimal Expansion: base 10 integers
Binary Expansion: base 2 integers
Octal Expansion: base 8 integers
Hexadecimal Expansion: base 16 integers

Discrete Mathematics Page 12

You might also like