Presentation is loading. Please wait.

Presentation is loading. Please wait.

August 31, 2005.

Similar presentations


Presentation on theme: "August 31, 2005."— Presentation transcript:

1 August 31, 2005

2 Homework Problem Some information about homework problem.
C'  is the conclusion - it is NOT a hypothesis The problem CAN be done using our original statements (i.e. without replacing T by K) Here’s what the lawyer said If my client is guilty, then the knife was in the drawer Either the knife was not in the drawer or Jason Pritchard saw the knife. If the knife was not there on October 10, it follows that Jason Pritchard did not see the knife. Furthermore, if the knife was there on October 10, then the knife was in the drawer and also the hammer was in the barn. But we all know that the hammer was not in the barn. Therefore, ladies and gentlemen of the jury, my client is innocent.

3 Here are the variables used
C client is guilty K knife was in the drawer T knife was there on October 10 S Jason Pritchard saw knife H hammer was in the barn 1. C -> K hypothesis 2. K' v  S hypothesis 3. T' -> S' hypothesis 4. T -> (K ^ H) hypothesis 5. H' hypothesis

4 Proof 6. H’ v K’ 5. addition 7. (H ^ K)’ 6. DeMorgan’s
8. (K ^ H)’ 7. commutative 9. T’ 4,8 Modus Tollens 10. S’ 3,9 Modus Ponens 11. S v K’ 2 commutative 12 K’ 10,11 disjunctive syllogism 13 C’ 1,12 Modus Tollens

5 Statement of problem If the program is efficient, it executes quickly
Either the program is efficient, or it has a bug. However, the program does not execute quickly. Therefore it has a bug. Please use the letters E,Q,B

6 Propositional form (E → Q) ⋀ (E ⋁ B) ⋀ Q’→ B

7 A solution 1. E → Q hyp (simplification) 2. E ⋁ B hyp (simplification)
4. E’ 1,3 Modus Tollens 5. B 2,4 Disjunctive syllogism

8 Another solution 1. E → Q hyp (simplification)
2. E ⋁ B hyp (simplification) 3. Q’ hyp (simplification) 4. E’⋁ Q 1 implication 5. Q ⋁ E’ 4 commutative 6. E’ ,5 Disjunctive syllogism 7. B ,6 Disjunctive syllogism

9 Still another solution
1. E → Q hyp (simplification) 2. E ⋁ B hyp (simplification) 3. Q’ hyp (simplification) 4. Q’→ E’ contraposition 5. E’ ,3 Modus Ponens 6. (E’)’ ⋁ B 2 double negation 7. E’→ B 6 implication 8 B ,5 Modus Ponens

10 And yet another one 1. E → Q hyp (simplification)
2. E ⋁ B hyp (simplification) 3. Q’ hyp (simplification) 4. (E’)’ ⋁ B double negation 5. E’→ B 4 implication 6. E’ ⋁ Q 1 implication 7. (E’ ⋁ Q) ⋀ Q’ ,3 conjunction 8. Q’ ⋀ (E’ ⋁ Q) commutative 9. (Q’ ⋀ E’) ⋁ (Q’ ⋀ Q) 8 distributive 10. (E’ ⋀ Q’) ⋁ complement property 11. (E’ ⋀ Q’) identity property 12. E’ simplification 13. B 5,12 Modus Ponens

11

12

13 Definition: Compound proposition
“a proposition constructed by combining propositions using logical operators” Conjunction – and Disjunction - or

14 Definition: dual of a compound proposition
The dual of a compound proposition that contains only the logical operators ∨,,¬, is the proposition obtained by replacing each ∨ by , each  by ∨, each T by F and each F by T.

15 Definition: NAND The proposition p NAND q is true when either p or q or both are false; and it is false when both p and q are true.

16 Definition: NOR The proposition p NOR q is true when both p and q are false, and it is false otherwise.

17 Page 27, problem 34 Find a compound proposition involving the propositions p,q and r that is true when p and q are true and r is false, but false otherwise.

18 Page 27, problem 35 Find a compound proposition involving the propositions p, q, and r that is true when exactly two of p, q, and r are true and is false otherwise. Hint: form a disjunction of conjunctions. Include a conjunction for each combination of values for which the proposition is true. Each conjunction should include each of the three propositions or their negation.

19 Modular Arithmetic a.k.a. clock arithmetic
If a and b are integers and m is a positive integer, then we way that a is congruent to b modulo m if m divides a-b. We use the notation a≡b (mod m) to indicate that a is congruent to b modulo m If they are not congruent, we write a≢ b (mod m)

20 Why do we care in c.s.? Applications:
Stripping digits from a base 10 number Check digits on credit cards Hash codes for storing information Generation of pseudo-random numbers Cryptology Check digits on bar codes Enable error detection


Download ppt "August 31, 2005."

Similar presentations


Ads by Google