Lecture 1 and 2 Flashcards
Lecture 1 notes
How to convert Binary to Decimal format
To convert binary to decimal format, starting with the leftmost digit add together 1 x 2^n.
Example- 1110011 is equivalent to 115. 1x2^6 + 1 x 2^5 + 1 x 2^4 + 1 x 2^1 + 1 x 2 ^0. You exclude any that have a 0 in the slot.
How to convert decimal to binary format?
To convert decimal to binary format you continually divide by 2 and track the remainder and then read the remainders backwards.
How to convert decimal to hexadecimal?
To convert decimal to hexadecimal you divide the number by 16 and read the remainders backwards.
How to convert binary to hexadecimal?
To convert binary to hexadecimal you split the binary into groups of 4 and if there is an uneven group of less than 4 add a 0 to the left hand side.
How to convert binary into octal
To convert binary to octal you split the binary into group of 3
How to express a decimal based fraction in binary?
Start by splitting the whole number portion and the fraction
Then multiply the fraction portion by 2 and record the 1 on a separate column and continue to only multiply the fraction portion.
What is the double negative law?
~(~p) = p
What is the commutative law
p v q = q v p
What is the Associative Law?
(p v q) v r = p v (q v r) and
p ^ q) ^ r = p^ (q^r
What is the distributive law?
p ^ (q v r) = (p^ q) v (p^r) and p v (q^r) = (p v q) ^ (p v r)
What is Demorgan’s Law
~(p v q) = ~p ^ ~q
~(p ^ q) = ~p v ~q
Difference between predicate and proposition?
In contrast predicate logic distinguishes the subject of a sentence from its predicate.
i.e “The dog is sleeping”
the phrase is sleeping is the predicate and is symbolized by P(x)
How do you rewrite p XOR q?
2 ways:
- (p v q) ^ ~(p ^ q)
- (p ^ ~q) v (q ^ ~p)
How to rewrite p –> q
~p v q
How to rewrite p q
2 Ways:
- (p –> q) ^ (q –>p)
- ~(p XOR q)
What is the negation of: For all x, P(x)
~(For all x, P(x)) <=> There exists x, ~p(x)
This works for there exists statements as well. to negate these statements change ‘for all’ to ‘there exists’ and vice versa
What is a Theorem (proposition)?
a statement that has been proven to be true.
What are Axioms, postulates, hypotheses, premises?
They are assumptions (often unproven) defining the structures about which we are reasoning.
What are Rules of inference
patterns of logically valid deductions from hypotheses to conclusions.
What is a Lemma
a minor theorem used as a stepping stone to proving a major theorem.
What is a corollary?
a minor theorem proved as an easy consequence of a major theorem
What is a conjecture?
a statement whose truth value has not been proven. May be widely believed to be true anyway.
What is a theory?
the set of all theorems that can be proven.
What is the rule of Addition pertaining to Inference Rules
p is true
p v q is true
What is the rule of simplification pertaining to inference rules
p ^ q is true
q is true
What is the rule of conjunction pertaining to inference rules?
p is true
q is true
p ^ q is true
What is the rule of Modus Ponens aka Law of detachment
p –> q
p is true
therefore q
What is the rule of Modus tollens aka the mode of denying?
p implies q
not p
therefore not q
What is the rule of hypothetical syllogism
p implies q
q implies r
therefore p implies r
What is the rule of disjunctive syllogism?
p v q
not p
therefore q
What is Universal instantiation?
For all x P(x) therefore P(o) (some value)
What is Universal generalization?
P(g) of some arbitrary g
therefore for all x P(x)
What is existential instantiation
there exists x such that P(x) therefore P(c)
What is existential generalization?
P(o)
therefore there exists x such that P(x)
Proof Methods for implications (p implies q) 1. Direct Proof
assume p is true and prove q
Proof methods for implications 2. Indirect Proof
Assume ~q and prove ~p
Proof methods for implications 3. Vacuous Proof
prove ~p by itself
Proof methods for implications 4. Trivial proof
prove q by itself
What is (k+1)! equal to?
(k+1)*k!