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.

Slides:



Advertisements
Similar presentations
Silicon Valley CSTA Presents: The Beauty and Joy of Computing Josh Paley, Teacher Computer Science & Mathematics Henry M. Gunn HS (Palo Alto, CA)
Advertisements

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.
CS10 The Beauty and Joy of Computing Lecture #10 Social Implications of Computing Having just returned from the UC Online Pilot Project Workshop,
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
CS10 The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction At CES 2011 in Vegas, companies showed lots of tablets and internet TV.
CS10 The Beauty and Joy of Computing Lecture #5 : Programming Paradigms Intel has shown demos of the game Wolfenstein whose visual images weren’t.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 2: Introduction, and Conditionals.
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 #5 : Programming Paradigms Times like these make us all appreciate the value of freedom… China.
CS10 The Beauty and Joy of Computing Lecture #25 : Tree Recursion The newly released (and much- hyped) Microsoft Kinect system for the XBOX.
Chapter 2 Writing Simple Programs
CS39N The Beauty and Joy of Computing Lecture #11 Recursion III It has been a challenge to power electronic components implanted within a body.
CS39N The Beauty and Joy of Computing Lecture #6 : Programming Paradigms In response to a 30,000+ signature petition, British PM Gordon Brown.
CS10 The Beauty and Joy of Computing Lecture #11 : Recursion II Will Apple continue to thrall its users with outstanding technology amidst tons.
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.
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.
Grammars and Parsing. Sentence  Noun Verb Noun Noun  boys Noun  girls Noun  dogs Verb  like Verb  see Grammars Grammar: set of rules for generating.
CSC 1701B Computing: Science and Creativity. Outline  Types  Variables  Operators  Control: sequence, selection, repetition  Functions (block headings.
Functional Programing Referencing material from Programming Language Pragmatics – Third Edition – by Michael L. Scott Andy Balaam (Youtube.com/user/ajbalaam)
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.
Introduction to Python
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
The Beauty and Joy of Computing Lecture #5 Programming Paradigms Story details the move to Digital of many things precious to us – music, photos, videos.
Prof. Aiken CS 169 Lecture 61 Project Planning CS169 Lecture 6.
Fall Week 3 CSCI-141 Scott C. Johnson.  Say we want to draw the following figure ◦ How would we go about doing this?
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
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.
1. Exam Topics Difference between computers and calculators John creates a new device. It will compute the orbit of all the planets in the solar system.
CS10 The Beauty and Joy of Computing Lecture #1 Welcome; Abstraction The algorithm is rapidly taking over vital functions of businesses, from.
The Beauty and Joy of Computing Lecture #5 Programming Paradigms UC Berkeley EECS Sr Lecturer SOE Dan Garcia invent.citris-uc.org motherboard.vice.com/read/click-print-gun-the-inside-story-of-the-3d-printed-gun-movement-video.
Making Decisions uCode: October Review What are the differences between: o BlueJ o Java Computer objects represent some thing or idea in the real.
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.
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,
CSC 110 Using Python [Reading: chapter 1] CSC 110 B 1.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Math – What is a Function? 1. 2 input output function.
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 #5 Programming Paradigms invent.citris-uc.org
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
The Beauty and Joy of Computing Lecture #7 Algorithms II minors-delete-activity/story?id= /
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
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.
The Beauty and Joy of Computing. UC Berkeley’s CS Breadth Course Designed to be non-intimidating to students in non-technical majors. But also designed.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia printing-aims-to-prevent-a-piracy-plague/ Quest.
CS 104 – Fall 2011 Exploring Computer Science Build Your Own Blocks September 19, 2011.
CS61A Lecture 1 Introduction and Basics Tom Magrino and Jon Kotker UC Berkeley EECS June 18, 2012.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
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.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
IST 210: PHP Basics IST 210: Organization of Data IST2101.
CS10 The Beauty and Joy of Computing Lecture #4 : Functions UC Berkeley EECS Lecturer SOE Dan Garcia Researchers at Microsoft and UW are working.
CS10 : The Beauty and Joy of Computing Lecture #5 Programming Paradigms If you visited google.com on Saturday, you saw a tribute to this founding.
CSC 1010 Programming for All Lecture 5 Functions Some material based on material from Marty Stepp, Instructor, University of Washington.
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.
The Beauty and Joy of Computing Lecture #6 Algorithms I Jon Kotker UC Berkeley EECS 2010, 2013 Microsoft
Functional Programming
CS314 – Section 5 Recitation 9
Chapter 2 Writing Simple Programs
Yahoo predicts contest already!
Chapter No. : 1 Introduction to Java.
UC Berkeley EECS Sr Lecturer SOE Dan Garcia
The Beauty and Joy of Computing Lecture #4 Functions
Unit I Flash Cards Start.
Intro to Algorithms in SNAP!
Javascript Chapter 19 and 20 5/3/2019.
COMPUTING.
Presentation transcript:

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 (Siri spelled backward), and now Evi (available on BOTH iOS and Android). The popularity has meant the servers are down (they didn’t use Cloud storage clearly – we’ll learn about that later). Love where this is going! Quest (first exam) in in 14 days!! CS10 : The Beauty and Joy of Computing Lecture #4 Functions

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (2) Garcia, Spring 2012 Enrollment – everyone IS in

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (3) Garcia, Spring 2012  You are going to learn to write functions, like in math class: y = sin(x)  sin is the function  x is the input  It returns a single value, a number Generalization (in CS10) REVIEW “Function machine” from Simply Scheme (Harvey) x sin

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (4) Garcia, Spring 2012 Function basics  Functions take in 0 or more inputs and return exactly 1 output  The same inputs MUST yield same outputs.  Output function of input only  Other rules of functions  No state (prior history)  No mutation (no variables get modified)  No side effects (nothing else happens) CS Illustrated function metaphor

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (5) Garcia, Spring 2012 Which is NOT a function? a) b) c) d) e)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (6) Garcia, Spring 2012  Domain  The “class” of input a function accepts  Examples  Sqrt of  Positive numbers  Length of  Sentence, word, number  _ < _  Both: Sentence, word, number  _ and _  Booleans  Letter _ of _  Number from 1 to input length  Sentence, word, number  Range  All the possible return values of a function  Examples  Sqrt of  Non-negative numbers  Length of  Non-negative integer  _ < _  Boolean (true or false)  _ and _  Boolean (true or false)  Letter _ of _  Letter More Terminology (from Math)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (7) Garcia, Spring 2012 Types of input (there are more)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (8) Garcia, Spring 2012  If a function only depends on the information it gets as input, then nothing else can affect the output.  It can run on any computer and get the same answer.  This makes it incredibly easy to parallelize functions.  Functional programming is a great model for writing software that runs on multiple systems at the same time. Why functions are great! Datacenter

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (9) Garcia, Spring 2012  Scratch  MIT  Maintained by MIT  Huge community  Sharing via Website  No functions   Scratch 2.0 in Flash  No iOS devices.   scratch.mit.edu  BYOB (to be “S NAP !”)  Based on Scratch code  Maintained by jens & Cal  Growing community  No sharing (yet)   Functions! … “Blocks”  BYOB 4.0 in HTML5  All devices  byob.berkeley.edu Scratch  BYOB (Build Your Own Blocks)

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (10) Garcia, Spring 2012 Why use functions? (1) The power of generalization!

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (11) Garcia, Spring 2012 Why use functions? (2) They can be composed together to make even more magnificent things. They are literally the building blocks of almost everything that we create when we program. We call the process of breaking big problems down into smaller tasks functional decomposition

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (12) Garcia, Spring 2012  Command  No outputs, meant for side-effects  Reporter (Function)  Any type of output  Predicate (Function)  Boolean output  (true or false) Types of Blocks

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (13) Garcia, Spring 2012 Quick Preview: Recursion Recursion is a technique for defining functions that use themselves to complete their own definition. We will spend a lot of time on this. M. C. Escher : Drawing Hands

UC Berkeley CS10 “The Beauty and Joy of Computing” : Functions (14) Garcia, Spring 2012  Computation is the evaluation of functions  Plugging pipes together  Each pipe, or function, has exactly 1 output  Functions can be input!  Features  No state  E.g., variable assignments  No mutation  E.g., changing variable values  No side effects  Need BYOB not Scratch Functional Programming Summary en.wikipedia.org/wiki/Functional_programming f(x)=(x+3)* x + x 3 * x f x