Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

ITEP 102: DISCRETE MATHEMATICS Truth Table

TOPIC 1: LOGIC AND PROPOSITIONS - List all the possible condition of truth value (decision
Logic and Mathematical reasoning value) for P1 . . . . . Pn . Also called logical matrix
- numerous applications in computer science as well as in (professional term).
I.T. Truth Table (Conjunction)
- used in the design of computer circuits, development of p q p^q
computer programs, verification of the correctness of the T T T
programs T F F
- Verification Of the correctness (2) F T F
1. Workability - execution of the program (syntax F F F
errors) - How to know the number of possible condition 2 as base
2. Accuracy - correct output of the program (logical for the number of truth value (true (1) and false (2)) and
𝑛
errors) the exponent as the number of proposition (2 ).
- Process of CORRECT REASONING Example:
- FOCUS on RELATION (relationship between statements over p q r ?
other statements) T T T
Propositions T T F
- basic building block of logic T F T
- is a declarative sentence that is either true or false, but T F F
not both. F T T
- Declarative sentence that is either ANSWERABLE F T F
with YES/NO F F T
- TRUTH VALUE: know whether the proposition is F F F
either TRUE/FALSE
2. Disjunction
Examine whether the following are propositions or not proposition
- p v q (read as p or q)
1. Earth is the only planet in the universe that has life.
- is the proposition that is false when both p and q
is false and is true otherwise.
2. 3 is an odd integer.
Truth Table (Disjunction)
p q pv q
3. Quezon City is the capital of the Philippines.
T T T
T F T
4. 12 /4 = 3.
F T T
F F F
5. Who are you talking to?
3. Negation
6. Read this sentence carefully.
- ¬True = False
- ¬False = True
7. X + 4 = 1
- ¬ (read as not)
8. V + V =W Example:
a)
Logical Connectives p: a decade is 10 years. True
1. Conjunction q: 5! = 120. True
- Standard notation (ALWAYS start with p: - lowercase means r: 5 * 7 = 36. False
specific; 𝑃1 - uppercase means general or 𝑃1 = 𝑝^𝑞) s: 1 * 3 = 2. False
- p^q (read as propositions p and q or p and q)
Example:
p: 1 + 1 = 2
q: 1 + 3 = 4
p^q = 1 + 1 = 2 and 1 + 3 = 4. Don’t forget the period
= p^q b)
= T^T
=T

TRUTH VALUE: both true = true and if with one or two false = false
4. Conditional Proposition & Logic Equivalence - Truth Value of Conditional Proposition
- The proposition p is called the hypothesis ( or a. p->q
antecedent ) and proposition q is called the conclusion =T->T
( or consequent ) =T
- If p then q / p -> q b. p->q
- if p (,) then q. =F->T
Example =T
p: The math dept, gets an additional Php.20.000. 6. Biconditional Proposition
q: The math dept, hires one new faculty member. - “p if and only if q” is called biconditional proposition
- If Math Dept gets an additional Php.20.000, then it will and is denoted by p <-> q
hire one new faculty member. - An alternate way to state “p if and only if q” is “p is a
necessary and sufficient condition for q”, or “p iff q”
RULES FORM OF CONDITIONAL PROPOSITION Truth Table
1. The hypothesis is the clause following the if. p q p<->q
- transposition/ (statement 1 -> statement 2) T T T
2. The only if clause is the conclusion, if p -> q is T F F
considered logically the same as p only if q. F T F
- No transposition F F T
- may -> if // only if -> then - proposition p and q must have the same value
3. When means the same as if. Example
- no transposition p: 1<5
4. The conclusion expresses, a “necessary condition” q: 2<8
- no transposition - 1 < 5 if and only if 2 < 8
- “a necessary condition for” == if - p<->q
5. The hypothesis expresses, a “sufficient condition” - p<->q
- transposition = T<->T
Truth Table =T
p q p->q 7. Logically Equivalent Proposition
T T T - two diff. compound propositions have the same truth
T F F values no matter what truth values their constituents
F T T have
F F T - denoted by P≡Q
- Conclusion is false/proposition q == false 1. ¬(p v q) ≡ ¬p v ¬q
Truth Table
5. Converse p q p v q ㄱ(pvq) ㄱp ㄱq ㄱp v ㄱq
- converse of conditional proposition p->q is q->p T T T F F F F
- reverses the roles of p and q T F T F F T T
Truth Table F T T F T F T
p q q->p F F F T T T T
T T T
T F T 8. Contrapositive
F T F - logically equivalent form of the conditional
F F T proposition
- Conclusion is false/proposition q == false - Transposition
Example - The Contrapositive of conditional proposition
a) if 1<2 , then 3<6 p->q is ¬q -> ¬ p
b) if 1>2, then 3<6 - Contrapositive reverses the notes of p and q and
- Conditional Proposition Symbolically negates each of them
a. p->q Example:
b. p->q p: 1<4 q: 5>8

- Converse of each Statement Symbolically and in Words


a. q->p – If 3<6, then 1<2
b. q->p – If 3<6, then 1>2
LESSON 3 Examples:
1. QUANTIFIERS 1. For every positive Real numbers x, x2 ≥ 0 is a
- P(x) is a propositional function ( with respect to D ) if universally quantified statement. The domain of
for each x in D, discourse is the set of positive real numbers.
- P(x) is a proposition (Prove)
- x is the variable
- D is the domain of discourse.
- Symbolic == P(x) / Words == P of x
Characteristics 2. The universally quantified statement for every positive
1. Statement should have a variable. integer n, if n is even then n 2 + n + 19 is prime is false.
2. Should have possible domain of discourse (D) n = 38 (prove)
3. If the value of the variable came from D then the
statement should be a proposition that is answerable
by TRUE or FALSE.
Examples: 3. Existentially Quantified Statement
a. P(n) is the statement, n is an odd integer and Dbe the - The statement for some x, P, P(x) is said to be an
set of positive integers existentially quantified statement.
If n=1, we obtain the proposition - The symbol ϶ is called existential quantifier
1, is an odd integer which is True - “for some”, “for at least one” or “there
If n=2, we obtain exists”
2 is an odd integer which is False - The statement
b. n2+2n is an odd integer. - For some X,P(x) is true if P(x) is true for at
(domain of discourse = set of positive integers) least one x in D.
- The statement
- for some X,P(x) Is false if P(x) is false for
every x in D.
c. The Restaurant rated over two stars in Chicago NOTES:
magazine. 1. 3 TRUTH VALUE for FALSE and 1 for TRUE
(domain of discourse = set of restaurant rated in
Chicago magazine) Examples:
1. The existentially quantified statement for some Real
2
numbers x, x/ 𝑥 +1 = ⅖ is true. For ex., if x=2 we obtain
the proposition.
2. UNIVERSAL QUANTIFIED STATEMENT
- The statement for every x, P, P(x) is said to be a
universally quantified statement.
- Due to the word for every, it can also be for 2. the existentially quantified statement for some
all, for any positive integer n, if n is prime, then n+1 , n+2, n+3, and
- The symbol U means “For every/all/any”. n+4 are not prime, is true
- Thus the statement
a. For every x,P(x) is true if P(x) is true
for every x in D.
b. For every x, P(x) is false, If P(x) is LESSON 4:
false for at least one x in D 1. Mathematical Induction
- Have basis step and induction step
NOTES: - ↡ the SERIES
1. The value of the variable that makes the proposition Example: 1●2 + 2●3 +3●4 + . . . . . . . n (n+1) = n (n+1)(n+2)/3
false is called “counter example” a. Basis Step - value of variable is always equal to 1
2. Only solve for the left side of the equation (mirrored) n (n+1) = n (n+1)(n+2)/3
3. 3 TRUTH VALUES for true and 1 COUNTER EXAMPLE for
false

b. Inductive Step - all variable should be [variable + 1],


DON’T FORGET THE SERIES
2. Sequence
- a list in which order is taken into account
- In a sequence notice that order is indeed important

In general, the cost Cn of travelling n miles is 1.00 (The cost of


travelling the first mile) plus $0.50 times the number (n-1) of
additional miles. That is
Cn = 1 + 0.5(n-1)
● ὶ = called the index, m is called the lower limit, n is
As example
called the upper limit
𝐶5 = 1 + 0.5 (5-1)
Example:
𝐶5 = 1 + 0.5 (4) Let a be the sequence defined by an=2n > 1 then
𝐶5 = 1 + 2
𝐶5 = 3
● We frequently denote the first element of the
sequence as 𝑆1 , the second element as 𝑆2 , and so on.
In General, 𝑆𝑛 denotes the nth element of a sequence.
- n the index of the sequence
Example: 3. String
The Ordered List - A string is a finite sequence of characters.
a, a, b, a, b - A “string over x” where X is a finite set, is a finite
t denote this sequence, we have sequence of elements from X.
t1=a ,t2=a, t3=b, t4=a, t5=b. Example:
- Sequences unlike sets can have repetitions. Let X = { a, b, c } If we Let
β1= b , β2= a , β3= a , β4= c.
Example: We obtain a string over x. this string is written as baac
The Ordered List - The string baac is different from string caab .
2, 4, 6, . . . . .2n . . . .
The nth element of the sequence is 2n. If we let S denotes this ● Repetitions in string can be specified by superscripts
sequence, we have For example:
S1=2 ,S2=4, S3=6 . . . . Sn=2n…. The string bbaaac may be written
2 3
- Sequence may have infinite no. of element or a finite 𝑏𝑎𝑐
no. of element.
● The string with no elements is called the null string
● Here S or {Sn} denotes the entire sequence, S1,S2, S3. . . and is denoted by λ
. . . We use the notation Sn to denote the single, nth We let:
element of the sequence S. - X* denote the set of all strings over X, including the
Example: null string.
Define a sequence {tn} by the Rule - X+ denotes the set of all non null strings over X.
tn = n2 – 1 , n ≥ 1 Example:
The first five terms of the sequence are Let X= { a , b } Some element in X* are
0, 3, 8, 15, 24, …………………… λ, a, b, abab, b20a5ba
The 55term is Example:
t55 = 552 - 1 = 3024 If d = aabab and β = a3b4a32 then
|d| = 5 and | β| = 39 - no. of elements/characters
● An infinite sequence V whose initial index is 0 is ● written dβ is called the concatenation of d and β

denoted {𝑉𝑛} 𝑛 = 0
4. Substring
● A finite sequence X indexed from-1 to 4 is denoted
- Substring of string α is obtained by selecting some or
4
{𝑋𝑛} 𝑛 =− 1 all consecutive elements of α.

The string β = add is a substring of α = aaaddad.

You might also like