Logic in Descreet maths
Logic in Descreet maths
1. Introduction to Logic
Logic is the study of principles and methods that differentiate valid arguments from invalid ones.
2. Statements
A statement is a declarative sentence that is either true or false, but not both.
Examples of Statements
:
True: "Grass is green."
False: "4 + 2 = 7."
Non-statements:
Questions: "May I come in?"
Commands: "Close the door."
Incomplete: "x > 2."
3. Compound Statements
Built using
simple statements
combined with
logical connectives
:
AND ( :)True if both statements are true.
OR ( :)True if at least one statement is true.
NOT (~): Negates the truth value of a statement.
Conditional ( :)"If p then q" is false only if pp is true and qq is false.
Biconditional ( :)True when both statements have the same truth value.
4. Symbolic Representation
Statements are symbolized as p,q,rp, q, r, etc.
Examples
:
p=p = "Islamabad is the capital of Pakistan."
q=q = "17 is divisible by 3."
5. Truth Tables
Used to determine the truth values of compound statements for all possible combinations of their components.
6. Logical Equivalence
Two logical expressions are equivalent if their truth tables are identical.
Examples:
Double negation: ( p) \simp (\sim p) \equiv p.
DeMorgan’s Laws:
(p q) ( p q)\sim
(p \land q) \equiv (\sim p \lor \sim q).
(p q) ( p q)\sim
(p \lor q) \equiv (\sim p \land \sim q).
Contradiction
: A statement that is always false.
Example: p pp
\land \sim p.
8. Implication and Its Variants
Conditional Statement (p q)
:
pp: Hypothesis.
qq: Conclusion.
Variants:
Inverse: p \simq p \sim q.
Converse: q pq p.
Contrapositive: q \sim
p q \sim p (Equivalent to original conditional).
9. Practice Problems
Translate English sentences into symbolic form.
Analyze compound statements using truth tables.
Examples:
"It is not hot but sunny" p \simq p \land q.
"If Ali is a CS student, then he is good at math" c mc m.
Explanation
1. What is Logic?
Identify valid arguments (those where the conclusion follows logically from the premises).
Distinguish valid reasoning from invalid reasoning.
2. Simple Statement
A statement (or proposition) is any declarative sentence that is either true or false, but not both.
Examples:
1. "2 + 2 = 4" This is a True statement.
2. "It is Sunday today" Truth depends on the day, but it is a statement.
3. "Grass is blue" A False statement.
3. Truth Value
4. Compound Statements
A compound statement is formed by combining simple statements using logical connectives. Here are the main connectives:
a) Negation (~):
Negates the truth value of a statement.
Example:
Truth Table:
pp p\sim p
T F
F T
Truth Table:
pp qq p qp\land q
T T T
T F F
F T F
F F F
c) Disjunction (OR, \lor):
True if at least one of the statements is true.
Example:
Truth Table:
pp qq p qp\lor q
T T T
T F T
F T T
F F F
Truth Table:
pp qq p qp\to q
T T T
T F F
F T T
F F T
Truth Table:
pp qq p qp\leftrightarrow q
T T T
T F F
F T F
F F T
5. Logical Equivalence
Two statements are logically equivalent if their truth tables are identical.
Important Laws:
1. Double Negation: ( p) \sim(\sim
p p) \equiv p.
2. DeMorgan’s Laws:
(p q) ( p q)\sim
(p \land q) \equiv (\sim p \lor \sim q).
(p q) ( p q)\sim
(p \lor q) \equiv (\sim p \land \sim q).
Contradiction:
A statement that is always false.
Example: p pp
\land \sim p.
Example:
To analyze a compound statement, we create a truth table showing the truth values of all possible combinations of its components.
9. Exercises for Practice
1. Construct the truth table for p ( q r)p\lor (\sim q \land r).
2. Translate "If Ali is a Computer Science student, then he is good at math" into symbols.
3. Use DeMorgan’s Laws to simplify (p q)\sim (p \lor q).