1 / 18

CSE 2353 – September 8 th 2003

CSE 2353 – September 8 th 2003. Logic and Mathematical Proofs. Negation, Specification, and Generalization. ~( x)[F(x)] = ~(x)[G(x)] =. Negation, etc. Which statement is incorrect? ~( x)[F(x)]  (x)[~F(x)] ~(x)[G(x)]  ( x)[~G(x)] (x)(y) [ P(x,y) ]  (y) (x) [ P(x,y) ].

Download Presentation

CSE 2353 – September 8 th 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 2353 – September 8th 2003 Logic and Mathematical Proofs

  2. Negation, Specification, and Generalization • ~(x)[F(x)] = • ~(x)[G(x)] =

  3. Negation, etc. • Which statement is incorrect? • ~(x)[F(x)]  (x)[~F(x)] • ~(x)[G(x)]  (x)[~G(x)] • (x)(y) [ P(x,y) ]  (y) (x) [ P(x,y) ]

  4. Foundations • Axioms • Theorems: (x) [T(x)] • (A1 ^ A2 ^ A3 ^ … ^ An ^ P) -> Q

  5. Proof Example Prove: if n is even then n^2 is even • E(x) x is even • S(x) x^2 is even • (x) [E(x) -> S(x)]

  6. Proof Example Prove: if n and m are integers divisible by 3 Then nx+my is divisible by 3 • T(x) x is divisible by 3 • Q(n,m) any number of the form nx+my is divisible by 3 • (n) (m) [ (T(n) ^ T(m) ) -> Q(n,m) ]

  7. ContrapositiveProof Example Prove: if n^2 is even then n is even

  8. ContrapositiveProof Example Prove: if nm = 100 then n <=10 or m <=10

  9. Induction Proofs • You can get to the first rung of a ladder. • Once you are on a rung, you can climb to the next one. Or • P(1) • P(k) -> p(k+1)

  10. Prove 1 + 3 + 5 + … + (2n-1) = n^2

  11. Prove 1^2 + 2^2 + 3^2 + … + n^2 = n(n+1)(2n+1)/6

  12. Prove 2^(3n) –1 is divisible by 7

  13. Execution Time • How many times will these loops process data? read n; for i = 1 to n { for j = 1 to i { process_data(); } }

  14. Loop Unrolling i = 0 while (i < 12) { process_data(i); i = i + 1; }

  15. Loop Unrolling i = 0 while (i < 12) { process_data(i); i = i + 1; } process_data(0); process_data(1); process_data(2); process_data(3); … process_data(12);

  16. Loop Unrolling i = 0 while (i < 12) { process_data(i); i = i + 1; } i = 0 while (i < 12) { process_data(i); process_data(i+1); process_data(i+2); i = i + 3; }

  17. Loop Unrolling read n; i = 0 while i < 4^n -1 { process_data(i); process_data(i+1); process_data(i+2); i = i + 3; } read n; i = 0 while i < 4^n-1 { process_data(i); i = i + 1; }

  18. Loop Unrolling Is 4^n -1 divisible by 3 for all positive integers?

More Related