Symbolic Processing
-
Upload
joelle-miller -
Category
Documents
-
view
39 -
download
2
description
Transcript of Symbolic Processing
![Page 1: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/1.jpg)
Symbolic Processing
![Page 2: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/2.jpg)
How to Teach “Programming”[email protected]
• Lecture 1: Education for kids– Lego Mindstorms (NQC: Not Quite C)– Scratch
• Lecture 2: Unix for Poets– Request: bring a laptop if possible
• Windows Users: please install http://www.cygwin.com/ – Target audience: Grad Students in Linguistics– Unix shell scripts (almost not programming)– Small is Beautiful
• Lecture 3: Symbolic Processing– Target audience:
• MIT Computer Science Majors (circa 1974)
– LISP: Recursion, Eval, Symbolic Differentiation– Lambda Calculus (“Small is Beautiful” beyond reason)
![Page 3: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/3.jpg)
Agenda
• Old Business– Homework from last week– Nothing to Hand-In but Discussion…
• New Business– No Requests for Next Week
• Today’s Lecture– Symbolic Processing
![Page 4: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/4.jpg)
Symbolic Features(Bet you can’t do this with your favorite statistics package)
• Complex Numbers: Sqrt(-1)• Roots (without approximations)• Differentiation (without approximations)• Integration (without approximations)• The On-Line Encyclopedia of Integer
Sequences• Eval
![Page 5: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/5.jpg)
Sqrt(-1) Error (for many tools)
![Page 6: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/6.jpg)
Roots (without approximations)51x
![Page 7: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/7.jpg)
Approximations such as Newton’s Method
![Page 8: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/8.jpg)
Complex Roots
![Page 9: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/9.jpg)
Newton’s Methodhttp://archives.math.utk.edu/visual.calculus/3/newton.5/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 152.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
-5
0
5
10
15
20
sqrt(5) sqrt(-5)
Iteration (n)
Estim
ate
of s
qrt(
5)
Estim
ate
of s
qrt(
-5)
![Page 10: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/10.jpg)
Symbolic Alternative
1 3 5 7 9 11 13 152.22.32.42.52.62.72.82.9
3
-5
0
5
10
15
20
sqrt(5) sqrt(-5)
Iteration (n)
Estim
ate
of s
qrt(
5)
Estim
ate
of s
qrt(
-5)
![Page 11: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/11.jpg)
![Page 12: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/12.jpg)
![Page 13: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/13.jpg)
Symbolic Methods Search
![Page 14: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/14.jpg)
Recursion
![Page 15: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/15.jpg)
(define (fact x) (if (<= x 1) 1
(* x (fact (- x 1)))))
(define (fib x) (if (<= x 2) 1
(+ (fib (- x 1)) (fib (- x 2)))))
(define (len x)(if (empty? x) 0
(+ 1 (len (rest x)))))
(define (rev x)(if (empty? x) x
(append (rev (rest x)) (list (first x)))))
More RecursionLecture3/recursive_examples.lsp
![Page 16: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/16.jpg)
The Roots of LISPEval
![Page 17: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/17.jpg)
Symbolic Differentiation
![Page 18: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/18.jpg)
Symbolic DifferentiationLecture3/deriv.lsp
http://mitpress.mit.edu/sicp/full-text/sicp/book/node39.html
![Page 19: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/19.jpg)
Syntaxhttp://www.allisons.org/ll/FP/Lambda/
![Page 20: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/20.jpg)
Semantics
![Page 21: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/21.jpg)
Surprise: Church’s Thesis
![Page 22: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/22.jpg)
• Effective Procedure– always give some answer – always give the right answer– always be completed in a finite number of steps– work for all instances of problems of the class
• Recursively Computable– Three definitions later found to be equiv to one another• general recursion• Turing machines• λ-calculus
• Church's thesis:– Effectively Procedure = Recursively Computable – Not a mathematical statement No proof
Church’s Thesishttp://en.wikipedia.org/wiki/Effectively_calculable
![Page 23: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/23.jpg)
![Page 24: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/24.jpg)
Recursion & Factorial
![Page 25: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/25.jpg)
Summary: Symbolic Features(Bet you can’t do this with your favorite statistics package)
• Complex Numbers: Sqrt(-1)• Roots (without approximations)• Differentiation (without approximations)• Integration (without approximations)• The On-Line Encyclopedia of Integer
Sequences• Eval
![Page 26: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/26.jpg)
How to Teach “Programming”[email protected]
• Lecture 1: Education for kids– Lego Mindstorms (NQC: Not Quite C)– Scratch
• Lecture 2: Unix for Poets– Request: bring a laptop if possible
• Windows Users: please install http://www.cygwin.com/ – Target audience: Grad Students in Linguistics– Unix shell scripts (almost not programming)– Small is Beautiful
• Lecture 3: Symbolic Processing– Target audience:
• MIT Computer Science Majors (circa 1974)
– LISP: Recursion, Eval, Symbolic Differentiation– Lambda Calculus (“Small is Beautiful” beyond reason)
![Page 27: Symbolic Processing](https://reader036.fdocuments.us/reader036/viewer/2022062314/5681348c550346895d9b7193/html5/thumbnails/27.jpg)
Optional Homework
• Please watch: http://video.google.com/videoplay?docid=-8860158196198824415#• Google: growing a language • Send feedback to
[email protected]–Do you agree? Disagree? –No opinion? Completely lost?