CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Instructor : Sean Morris Security Flaws in your OS

Slides:



Advertisements
Similar presentations
The Beauty and Joy of Computing Lecture #19 Higher Order Functions II Instructor: Sean Morris Twitter Can Tell Whether Your Community Is Happy or Not
Advertisements

Tree Recursion Traditional Approach. Tree Recursion Consider the Fibonacci Number Sequence: Time: , 1, 1, 2, 3, 5, 8, 13, 21,... /
§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
The Beauty and Joy of Computing Lecture #18 Higher Order Functions I Instructor: Sean Morris
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 #11 : Recursion II Microsoft filed a patent that proposed to use the 3D depth camera to estimate.
6.001 SICP – September Introduction
Linear vs. exponential growth Linear vs. exponential growth: t = 0 A = 1x(1+1) 0 = 1 A = 1x0 + 1 = 1.
CS 206 Introduction to Computer Science II 10 / 14 / 2009 Instructor: Michael Eckmann.
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.
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.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
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 Curriculum and the AP CS: Principles project Brian Harvey, UC Berkeley Dan Garcia, UC Berkeley Jens Mönig, MioSoft.
Great Theoretical Ideas in Computer Science.
Time Complexity Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
CS-2852 Data Structures LECTURE 12B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
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,
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.
10/25/20151 CS 3343: Analysis of Algorithms Lecture 6&7: Master theorem and substitution method.
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.
Today’s topics Orders of growth of processes Relating types of procedures to different orders of growth.
Chapter 5 – Functions II Outline Recursion Examples Using Recursion: The Fibonacci Series.
David Stotts Computer Science Department UNC Chapel Hill.
Java Methods Big-O Analysis of Algorithms Object-Oriented Programming
DATA STRUCTURES AND ALGORITHMS Lecture Notes 2 Prepared by İnanç TAHRALI.
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
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:
8.4 Mathematical Induction Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 Recursively defined sequences Write the first 5.
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 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.
Common Logarithms - Definition Example – Solve Exponential Equations using Logs.
تصميم وتحليل الخوارزميات عال311 Chapter 3 Growth of Functions
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.
The Beauty and Joy of Computing Lecture #7 Algorithms II minors-delete-activity/story?id= /
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 #7 Algorithmic Complexity “Data scientists at Yahoo are using prediction markets – along with polls, sentiment.
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.
Chapter 2 Fundamentals of the Analysis of Algorithm Efficiency Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
CS10 The Beauty and Joy of Computing Lecture #4 : Functions UC Berkeley EECS Lecturer SOE Dan Garcia Researchers at Microsoft and UW are working.
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
The Beauty and Joy of Computing Lecture #10 Recursion II
Generating Functions 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
The sequence of differences is: constant for a linear sequence,
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
Lawrence Snyder University of Washington
Presentation transcript:

CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Instructor : Sean Morris Security Flaws in your OS e/nations-buying-as-hackers-sell-computer- flaws.html?pagewanted=all Nations and companies are paying hackers to expose bugs in their systems. Cyberwar, piracy, espionage, and privacy concerns abound.

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (2) Chun, Summer 2012  Factorial(n) = n!  Informal Definition n! = [ 1 * 2 * 3 * … * n ]  Inductive Definition 1, if n = 0 n * (n-1)!, if n > 0 How the Computer Works … n! n! = {

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (3) Chun, Summer 2012  Let’s act it out…  subcontractor model  5! How the Computer Works … n! nn!

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (4) Chun, Summer 2012 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 (5) Chun, Summer 2012 Fibonacci en.wikipedia.org/wiki/Fibonacci_number

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (6) Chun, Summer 2012  Inductive definition n, n < 2 fib(n-1)+fib(n-2), n > 1  Let’s act it out…  subcontractor model  fib(3) How the Computer Works … fib(n) nfib(n) en.wikipedia.org/wiki/Fibonacci_number fib(n) = {

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (7) Chun, Summer 2012 How the Computer Works … fib(n) en.wikipedia.org/wiki/Fibonacci_number

UC Berkeley CS10 “The Beauty and Joy of Computing” : Recursion II (8) Chun, Summer 2012 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 (9) Chun, Summer 2012  Given coins {50, 25, 10, 5, 1} how many ways are there of making change? 5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 (10) Chun, Summer 2012  Given coins {50, 25, 10, 5, 1} how many ways are there of making change? 5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 (11) Chun, Summer 2012 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 (12) Chun, Summer 2012  It’s important to understand the subcontractor model  It’s often the cleanest, simplest way to solve many problems  Especially those recursive in nature!  Recursion is a very powerful idea, and one way to separate good from great Summary Menger Cube by Dan Garcia