Lecture 12(Friday) - def inner_forall(L, P, y) : for x in L...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: def inner_forall(L, P, y) : for x in L : if not P(x,y) : return False # theres a counterexample else : pass return True # no counterexamples def outer_forall(L1, P, L2, Q) : for x in L1 : if not Q(L2, P, x) : return False # theres a counterexample else : pass return True # no counterexamples def inner_exists(L, P, x) : for y in L: if P(x,y) : return True # theres an example else: pass return False # theres no example def outer_exists(L1, P, L2, Q) : for y in L1: if Q(L2, P, y) : return True # theres an example else: pass return False # theres no example def P(x,y) : return x + y == 5 L1 = [1, 2, 3, 4] L2 = [1, 2, 3, 4] slide 13 dangerous switching Can you switch 8 " 2 R + with 9 2 R + without altering the truthfulness of the statement? 8 x 2 R ; 8 " 2 R + ; 9 2 R + ; j x : 6 j < ) j x 2 : 36 j < " (you can!). How about: 8 " 2 R + ; 9 2 R + ; 8 x 2 R ; j x : 6 j < ) j x 2 : 36 j < " This latter is often written in a di erent form: lim x ! : 6 x 2 = 0 : 36 First specify how close to 0.36First specify how close to 0....
View Full Document

Page1 / 6

Lecture 12(Friday) - def inner_forall(L, P, y) : for x in L...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online