CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II 2011-03-02 Will Apple continue to thrall its users with outstanding technology amidst tons.

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

§3 Dynamic Programming Use a table instead of recursion 1. Fibonacci Numbers: F(N) = F(N – 1) + F(N – 2) int Fib( int N ) { if ( N
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 #21 Artificial Intelligence IBM’s Watson is being used by researchers in Canada to “provide early.
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 #11 : Recursion II Microsoft filed a patent that proposed to use the 3D depth camera to estimate.
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.
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.
CS10 : The Beauty and Joy of Computing Lecture #10 Social Implications of Computing CS10 has been chosen as one of 30 courses (all across 10.
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.
CS-2852 Data Structures LECTURE 12B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
Computer Science: A Structured Programming Approach Using C1 6-9 Recursion In general, programmers use two approaches to writing repetitive algorithms.
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.
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.
The Beauty and Joy of Computing Lecture #6 Algorithms MIT researchers recently created an algorithm which they say will be able to predict what topics.
Dynamic Programming.
The Beauty and Joy of Computing Lecture #10 Social Implications of Computing Online education now has a player in the open access / free education space,
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.
“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.
The Beauty and Joy of Computing Lecture #11 Recursion II Toby Shachman created this amazing spatial programming language called “Recursive Drawing” that.
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.
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.
FIBONACCI NUMBERS AND RECURRENCES Lecture 26 CS2110 – Spring 2016 Fibonacci (Leonardo Pisano) ? Statue in Pisa Italy.
Recursion Function calling itself
Arithmetic and Geometric Sequences.
Yahoo predicts contest already!
The Beauty and Joy of Computing Lecture #4 Functions
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
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
Presentation transcript:

CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Will Apple continue to thrall its users with outstanding technology amidst tons of competition from its Android Rivals? Will Steve Jobs make an appearance? Will you buy one? UC Berkeley EECS Lecturer SOE Dan Garcia Hello to Yue Li, CS Associate Prof, Nat. U of Defense Technology, Hunan, CHINA

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (2) Garcia, Spring 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, Spring 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 (4) Garcia, Spring 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 (5) Garcia, Spring 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 (6) Garcia, Spring 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

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (7) Garcia, Spring 2011  It’s important to understand the machine model  Recursion is a very powerful idea, and one way to separate good from great Summary Menger Cube by Dan Garcia