CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II 2011-10-10 Microsoft filed a patent that proposed to use the 3D depth camera to estimate.

Slides:



Advertisements
Similar presentations
Tree Recursion Traditional Approach. Tree Recursion Consider the Fibonacci Number Sequence: Time: , 1, 1, 2, 3, 5, 8, 13, 21,... /
Advertisements

CPE 130 Algorithms and Data Structures Recursion Asst. Prof. Dr. Nuttanart Facundes.
CS10 The Beauty and Joy of Computing Lecture #7 Algorithmic Complexity One million Wi-Fi devices isn’t cool. You know what’s cool? A Billion.
FIBONACCI Lecture 23 CS2110 – Spring 2015 Fibonacci (Leonardo Pisano) ? Statue in Pisa Italy And recurrences.
CS10 The Beauty and Joy of Computing Lecture #10 Social Implications of Computing Having just returned from the UC Online Pilot Project Workshop,
CS10 The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction At CES 2011 in Vegas, companies showed lots of tablets and internet TV.
CS39N The Beauty and Joy of Computing Lecture #11 Recursion II Researchers at Microsoft, UW and U Toronto have come up with a technique to interact.
CS 202 Computer Science II Lab Fall 2009 October 29.
CS10 The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction Watch the student testimonials about CS10, what it means to them, and how.
CS10 The Beauty and Joy of Computing Lecture #17 Higher Order Functions I Silicon (normally what processors are made of) is rigid and expensive,
CS10 The Beauty and Joy of Computing Lecture #25 : Tree Recursion The newly released (and much- hyped) Microsoft Kinect system for the XBOX.
CS39N The Beauty and Joy of Computing Lecture #11 Recursion III It has been a challenge to power electronic components implanted within a body.
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Will Apple continue to thrall its users with outstanding technology amidst tons.
Great Theoretical Ideas in Computer Science.
Linear, Exponential, and Quadratic Functions. Write an equation for the following sequences.
Fibonacci numbers Fibonacci numbers:Fibonacci numbers 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,... where each number is the sum of the preceding two. Recursive.
The Beauty and Joy of Computing Lecture #6 Algorithms Alan Turing ( ) would have turned 100 this year. He was a brilliant British mathematician.
Great Theoretical Ideas in Computer Science.
Time Complexity Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
CS Algorithm Analysis1 Algorithm Analysis - CS 312 Professor Tony Martinez.
The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction Watch the student testimonials about the course, what it means to them, and how it has.
CS-2852 Data Structures LECTURE 12B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Instructor : Sean Morris Security Flaws in your OS
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
Fundamentals CSE 373 Data Structures Lecture 5. 12/26/03Fundamentals - Lecture 52 Mathematical Background Today, we will review: ›Logs and exponents ›Series.
The role of data mining in the last presidential election. A mind-blowing piece on how the Obama campaign used various sources of data to target voters.
Recursion. What is recursion? Rules of recursion Mathematical induction The Fibonacci sequence Summary Outline.
Week 6 - Monday.  What did we talk about last time?  Exam 1!  Before that:  Recursion.
Dynamic Programming.
Chapter 5 – Functions II Outline Recursion Examples Using Recursion: The Fibonacci Series.
David Stotts Computer Science Department UNC Chapel Hill.
DATA STRUCTURES AND ALGORITHMS Lecture Notes 2 Prepared by İnanç TAHRALI.
The Beauty and Joy of Computing Lecture #6 Algorithms I UC Berkeley EECS Sr Lecturer SOE Dan Garcia.
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
CS2852 Week 6, Class 1 Today The run-time stack Writing and proving recursive methods SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
“The coolest phones we’ve seen from the world’s largest mobile show so far include quad-core chips, larger screens, and even one with a projector built.
1Computer Sciences. 2 GROWTH OF FUNCTIONS 3.2 STANDARD NOTATIONS AND COMMON FUNCTIONS.
The Beauty and Joy of Computing Lecture #11 Recursion II Toby Shachman created this amazing spatial programming language called “Recursive Drawing” that.
CS2852 Week 6, Class 2 Today Class exercise: Implementing a recursive method Binary Search Trees Tomorrow: Quiz at start of lab Implementing a recursive.
The Beauty and Joy of Computing Lecture #7 Algorithms II minors-delete-activity/story?id= /
Essential Questions Introduction to Sequences
Intro to Analysis of Algorithms. Algorithm “A sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any.
The Beauty and Joy of Computing Lecture #12 Social Implications of Computing I Online education now has a player in the open access / free education space,
The Beauty and Joy of Computing Lecture #7 Algorithmic Complexity “Data scientists at Yahoo are using prediction markets – along with polls, sentiment.
CS10 The Beauty and Joy of Computing Lecture #20 Pyhton II UC Berkeley EECS Lecturer Gerald.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
Analyzing Programs: Order of Growth CMSC Introduction to Computer Programming October 11, 2002.
The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction Watch the student testimonials about the course, what it means to them, and how it has.
UC Berkeley EECS Lecturer SOE Dan Garcia The success of Apple’s Siri (only available on the iPhone 4S) has sparked competition, to be sure. Google’s IRIS.
CS10 The Beauty and Joy of Computing Lecture #4 : Functions UC Berkeley EECS Lecturer SOE Dan Garcia Researchers at Microsoft and UW are working.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia Valve (video game makers of Half-Life) believes the future of video games may not be in the input device (ala.
Yahoo predicts contest already!
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
Fibonacci Fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Definition:
Fibonacci numbers Golden Ratio, recurrences
Fibonacci numbers Golden Ratio, recurrences
The Beauty and Joy of Computing Lecture #10 Recursion II
The Beauty and Joy of Computing Lecture #10 Recursion II
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
Functional Programming
Induction: One Step At A Time
Induction: One Step At A Time
CSE 373 Data Structures Lecture 5
Recursion Taken from notes by Dr. Neil Moore
Asymptotic Notations Algorithms perform f(n) basic operations to accomplish task Identify that function Identify size of problem (n) Count number of operations.
Fibonacci numbers Golden Ratio, recurrences
CS210- Lecture 2 Jun 2, 2005 Announcements Questions
Induction: One Step At A Time
Lawrence Snyder University of Washington
Presentation transcript:

CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Microsoft filed a patent that proposed to use the 3D depth camera to estimate the age of the viewer (height, head-width to shoulder-width, torso length to overall height), and automatically restrict access to content. Tech-savvy kids usu override controls, we’re told. UC Berkeley EECS Lecturer SOE Dan Garcia scans-estimate-age-automate-parental-controls

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (2) Garcia, Fall 2011  Factorial(n) = n! Inductive definition:  n! = 1, n = 0  n! = n * (n-1)!, n > 0  Let’s act it out…  “Little people”, or “subcontractor” model  5! How the Computer Works … n! nn!

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (3) Garcia, Fall 2011 a) Constant b) Logarithmic c) Linear d) Quadratic e) Exponential Order of growth of # of calls of n! (source: FallingFifth.com)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (4) Garcia, Fall 2011  Inductive definition:  fib(n) = n, n < 2  fib(n) = fib(n-1)+fib(n-2), n > 1  Let’s act it out…  “contractor” model  fib(5) How the Computer Works … fib(n) nfib(n) Leonardo de Pisa aka, Fibonacci en.wikipedia.org/wiki/Fibonacci_number Let’s now: trace… (gif from

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (5) Garcia, Fall 2011 a) Constant b) Logarithmic c) Linear d) Quadratic e) Exponential Order of growth of # of calls of fib(n) Chimney of Turku Energia, Turku, Finland featuring Fibonacci sequence in 2m high neon lights. By Italian artist Mario Merz for an environmental art project. (Wikipedia)Mario Merz

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (6) Garcia, Fall 2011  Given coins {50, 25, 10, 5, 1} how many ways are there of making change?  5: 2 (N,5 P)  10  4 (D, 2N, N 5P, 10P)  15  6 (DN,D5P,3N,2N5P,1N10 P,15P)  100? Counting Change (thanks to BH)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (7) Garcia, Fall 2011 Call Tree for “Count Change 10 (10 5 1)” 10 (10 5 1) 10 (5 1) 10 (1)10 ()09 (1)9 ()08 (1)8 ()07 (1)7 ()06 (1)6 ()05 (1)5 ()04 (1)4 ()03 (1)3 ()02 (1)2 ()01 (1)1 ()00 (1)15 (5 1)5 (1) 5 ()04 (1)4 ()03 (1)3 ()02 (1)2 ()01 (1)1 ()00 (1)1 0 (5 1)1 0 (10 5 1) 1  Skip Coin Use Coin  D NN N 5P 10P D? N? N? P? P? P? P? P? P? P? P? P? P? P? P? P? P? P?

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (8) Garcia, Fall 2011  It’s important to understand the machine model  It’s often the cleanest, simplest way to solve many problems  Esp those recursive in nature!  Recursion is a very powerful idea, and one way to separate good from great Summary Menger Cube by Dan Garcia