“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.

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.
The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction Instructor : Sean Morris Watch the student testimonials about the course, what it means.
Use of Computer Technology in Education Course Management Systems Learning Management Systems Classroom Teaching Technology Modeling and Simulation and.
Kavita Math231 Recursion and Iteration. Kavita Math231 We use Recursion when we have to perform a complex task that can be broken into the several subtasks.
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.
Recursion. Recursive Definitions In recursive definitions, we define a function, a predicate, a set, or a more complex structure over an infinite domain.
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.
Chapter 15 Recursive Algorithms. 2 Recursion Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
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 #11 : Recursion II Will Apple continue to thrall its users with outstanding technology amidst tons.
Great Theoretical Ideas in Computer Science.
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.
CS-2852 Data Structures LECTURE 12B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
Recursion and Dynamic Programming CSC 172 SPRING 2004 LECTURE 9.
INDUCTION AND RECURSION. PRINCIPLE OF MATHEMATICAL INDUCTION To prove that P(n) is true for all positive integers n, where P(n) is a propositional function,
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.
Recursion. What is recursion? Rules of recursion Mathematical induction The Fibonacci sequence Summary Outline.
Recursion, pt. 1 The Foundations. What is Recursion? Recursion is the idea of solving a problem in terms of itself. – For some problems, it may not possible.
Week 6 - Monday.  What did we talk about last time?  Exam 1!  Before that:  Recursion.
1 Programming for Engineers in Python Autumn Lecture 12: Dynamic Programming.
Recursion. Math Review Given the following sequence: a 1 = 1 a n = 2*a n-1 OR a n+1 = 2*a n What are the values of the following? a 2 = a 3 = a 4 =
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,
Chapter 5 – Functions II Outline Recursion Examples Using Recursion: The Fibonacci Series.
1 CompSci 105 SS 2005 Principles of Computer Science Lecture 6: Recursion Lecturer: Santokh Singh Assignment 1 due tomorrow. Should have started working.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 15 * Recursive Algorithms.
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 #17 Social Implications of Computing III Instructor: Sean Morris Online education now has a player in the open.
The Beauty and Joy of Computing Lecture #11 Recursion II Toby Shachman created this amazing spatial programming language called “Recursive Drawing” that.
A Introduction to Computing II Lecture 7: Sorting 1 Fall Session 2000.
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,
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.
1 Programming for Engineers in Python Autumn Lecture 8: Recursion.
1 Recursion Recursive function: a function that calls itself (directly or indirectly). Recursion is often a good alternative to iteration (loops). Its.
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.
RECURSION (CONTINUED) Lecture 9 CS2110 – Spring 2016.
Recursion Function calling itself
(Proof By) Induction Recursion
Introduction to C++ Programming Language
Fibonacci Fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 Definition:
The Beauty and Joy of Computing Lecture #10 Recursion II
5 HACKS THAT WILL HELP YOU ACHIEVE YOUR MAJOR BEAUTY GOALS.
The Beauty and Joy of Computing Lecture #10 Recursion II
Data Structures and Algorithms
CS201: Data Structures and Discrete Mathematics I
Functional Programming
Induction: One Step At A Time
Induction: One Step At A Time
Recursion Taken from notes by Dr. Neil Moore
Chapter 3 :Recursion © 2011 Pearson Addison-Wesley. All rights reserved.
Induction: One Step At A Time
Lawrence Snyder University of Washington
Recursion Examples.
Presentation transcript:

“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 in.” ve_of_smartphones.html#tk.hp_pop The Beauty and Joy of Computing Lecture #11 Recursion II UC Berkeley iSchool Grad Student Dan Garcia

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