Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
INTRODUCTION TO COMPUTER SCIENCE WEEK6(TA HOUR) Xinchen Yan Oct.16th, 2012 Outline - - Problems in Class Q&A Advanced Topics Halting Problem Relative Primality Stern-Brocot tree Pascal Triangle Lucas Thm Halting problem All programs Finite length Countably infinite P1, P2, P3, … Relative Primality m⊥n m,n are integers and gcd(m,n) = 1 m/n is in lowest terms gcd(m,n) = 1 In general, m/gcd(m,n) ⊥n/gcd(m,n) k ⊥m and k ⊥n k ⊥mn Mediant of m/n and m’/n’: m+m’/n+n’ Suppose n,n’ > 0 and m,m’ ≥ 0 Assume m/n < m’/n’ Stern-Brocot tree(a kind of binary tree) Stern-Brocot tree Stern-Brocot tree Property I: m’n-mn’=1 Consider: m+m’/n+n’ Property II: m/n < m+m’/n+n’ < m’/n’ Question: for any a,b>0 and a ⊥b, a/b exists? Stern-Brocot tree Algorithm St0: St1: St2.0: if equals, done. St2.1: if less than St3.1: St2.2: if more than St3.2: St4: back to St1 Stern-Brocot tree Property III: Pf. We have Thus, Finally, Stern-Brocot tree(Farey) Farey series F1, F2, F3, F4, F5, … Suppose m/n, m’/n’, and m’’/n’’ are consecutive elements of FN. Relationship? Farey series F1, F2, F3, F4, F5, … Suppose m/n, m’/n’, and m’’/n’’ are consecutive elements of FN. Relationship? Farey series Stern-Brocot tree(Farey) Stern-Brocot tree(3 Amazing results) Going down left/right: L/R Ex. 5/7 is LRRL S: a sequence of LR f(S): fraction corresponding to S f(LRRL) = 5/7 Stern-Brocot tree(Amazing result No.1) Stern-Brocot tree(Amazing result No.2) Stern-Brocot tree(Amazing result No.3) Irrational numbers don’t appear in the S-B tree. But all rational numbers are close to them do. Consider We found that Stern-Brocot tree(Amazing result No.3) That’s why |2*| = |N|, but |2^N| ≠ |R|. Then why |2^N| = |R|? Have a rest Pascal Triangle Important counting ideas(I) Pascal Triangle (x + y)2 = x2 + 2xy + y2 = 1x2y0 + 2x1y1 + 1x0y2 (x + y)n = a0xn + a1xn−1y + a2xn−2y2 + ... + an−1xyn−1 + anyn Pascal Triangle(Question Type 1) Pascal Triangle(Question Type 2) Pascal Triangle(Question Type 3) The number of odd numbers in each line? How to prove? Lucas Thm. Reference Course Material from CMU 15-251 Great Theoretical Ideas in CS, Fall2011 Course Material from MIT 6.042J Maths for CS, Spring2005 Lecture Notes from SJTU Maths in CS, Winter 2011 Concrete Mathematics by DEK.