Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.

Slides:



Advertisements
Similar presentations
 Communication:  Provide context, e.g., s …  TA Office hour for next Tuesday: CANCELLED  My name is: ??  Show  Scores on-line, Quiz-1 results.
Advertisements

Understanding Depth 0f knowledge
6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Changing Control.
Jefferson County Schools K-5 Math Back to School Conference
An Introduction to Programming and Object Oriented Design using Java 2 nd Edition. May 2004 Jaime Niño Frederick Hosch Chapter 0 : Introduction to Object.
Algebra Problems… Solutions Algebra Problems… Solutions © 2007 Herbert I. Gross Set 4 By Herb I. Gross and Richard A. Medeiros next.
Why Program? CSE111 – Great ideas in Computer Science Clearly programming fits here Programming is a Great Idea in Computer Science. It has allowed computers.
CS 4432lecture #31 CS4432: Database Systems II Lecture #3 Professor Elke A. Rundensteiner.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Design Patterns: someone has already.
SE-565 Software System Requirements More UML Diagrams.
What Does it Take to Learn 'Programming Thinking'? Anna Eckerdal, Anders Berglund Dept. of Information Technology Uppsala University Sweden.
Programming Logic and System Analysis
Mind Mapping for Girl Scouts Facilitating today: April 8, 2014 Jan Oestreich Betsy Connell For those with headsets, run your audio setup wizard after logging.
Introducing Java.
DEEP with Pattern Blocks in Fractions Jeremy Winters Funded by MTSU Public Service Grant.
Mind Mapping for Girl Scouts Facilitating today: November 21, 2013 Jan Oestreich Marge Schiller For those with headsets, run your audio setup wizard after.
Math Practice #2 Reason Abstractly and Quantitatively.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Welcome – You’ve found CSE120 OR Computer Science Principles OR UWIT…  Announcements are usually listed here and displayed before the start of class 
Problem Solving Session 1 Introduction. In this session we will be Reviewing the topics that will be covered in this module Discussing expectations Filling.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
LOGIC AND ONTOLOGY Both logic and ontology are important areas of philosophy covering large, diverse, and active research projects. These two areas overlap.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 What can a computer be commanded to do?
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Assignment 6.
Chapter 1 Data Structures and Algorithms. Primary Goals Present commonly used data structures Present commonly used data structures Introduce the idea.
Language Acquisition Part III in a 4 Part Series.
CS2110: SW Development Methods Inheritance in OO and in Java Part 2: Topics: Forms of inheritance Interfaces in Java.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 We’re underway …
STUDENT LED CONFERENCES SPRING 2015 BEN IVERSON. Cover Letter Science this year has covered a wide range of topics. We started the year with learning.
 Functions package up computation … when do we use them? All the time.  Write some simple code to achieve a goal … 12/20/2015© 2010 Larry Snyder, CSE1.
Let’s Play Together. It’s fun to play with my friends.
CSCI N100 Principles of Computing Basic Problem-Solving.
Session 3 How to Approach the UML Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 5, 2011 Presented by Kang-Pyo Lee.
CS 1110/1111 The Case for Computer Science CS 1110/1111 – Introduction to Programming.
Algorithms CS280 – 10/20/05. Announcement  Part 1 of project 2 due.  Read chapters 10, 7 for this unit  Tuesday we will also be in the classroom We.
(Superficial!) Review of Uniprocessor Architecture Parallel Architectures and Related concepts CS 433 Laxmikant Kale University of Illinois at Urbana-Champaign.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Functional Abstraction Reduces Complexity.
Recursion, pt. 3: The Towers of Hanoi. Towers of Hanoi One classic recursive problem is that of the Towers of Hanoi.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Making an example of Pacman.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Oregon’s Second Annual GED Summit Creating Promise, Designing Success Thank you to our sponsors:
CONFLICT RESOLUTION. THINK. PAIR. SHARE. What are some positive ways to solve a conflict? What conflicts have you had in the past? What are some negative.
Algebra 1 The Distributive Property. Objective Students will use the distributive property.
University of Louisville Disability Resource Center.
Two paths diverge in the lectures 2 Think of the first as concepts, the second as capabilities This ClassPrinciplesDoing stuff.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Questions and Ponderings On “Life”
Lightbot and Functions CSE 120 Winter 2017
Light Bot Solutions: an analysis
The Need for Algorithms 2 days
CS190/295 Programming in Python for Life Sciences: Lecture 1
The Metacircular Evaluator
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
Light Bot Solutions: an analysis
Light Bot Solutions: an analysis
Chapter 0 : Introduction to Object Oriented Design
Using the Power of XML Personally
Two Paths Diverge in the Lectures
Unit 1: Principles of Computer Science
Computational Thinking
Announcements How to save your work? Quiz solution 5/5/2019
Lawrence Snyder University of Washington
Announcements Survey feedback: summary Quiz: HW 7:
Today: to list: Syllabus change: Grade on-line
Presentation transcript:

Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004

 Functions may seem “obvious” but they are a HUGE idea …  They allow us to solve problems by first creating some useful instructions, and then using them to simplify our work  Let’s review how they work … 1/6/2016© Larry Snyder2 Just Do It!

 Because F1( ) “processes a riser,” we think of the programming task as 1/6/2016© Larry Snyder3 Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( )

 Because F1( ) “processes a riser,” we think of the programming task as  With F1( ), we simplify the programming to just 5 conceptual steps rather than 21 1/6/2016© Larry Snyder4 Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( )

 Because F1( ) “processes a riser,” we think of the programming task as  With F1( ), we simplify the programming to just 5 conceptual steps rather than 21  But, WAIT! What is “Move to next riser”?  It’s a concept … make it a function!  Move_to_ next_ riser ( ) 1/6/2016© Larry Snyder5 Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( ) Move to next riser Process a riser( ) F1( )

1/6/2016© Larry Snyder6 Is this beautiful, or what? Process_R Move_2_N_R Program Is Only Function Calls

 Formulating blocks of computation as a “concept” is functional abstraction [A better definition in a moment]  What we did just now is important …  We spotted a coherent (to us) part of the task  We solved it using a sequence of instructions  We put the solution into a function “package”, gave it a name, “process a riser,” and thus created a new thing, a concept, something we can talk about & use  Then we used it to solve something more complicated … and then we did it again! 1/6/2016© Larry Snyder7

 Collecting operations together and giving them a name is functional abstraction  The operations perform a coherent activity or action – they become a concept in our thinking  The operations accomplish a goal that is useful – and typically – is needed over and over again  Functions implement functional abstraction: 3 parts ▪ A name ▪ A definition (instruction seq), frequently called a “body” ▪ Parameters –stuff inside the parentheses, covered later 1/6/2016© Larry Snyder8

 Functional abstractions in which you are the agent, but someone taught you:  Parallel parking  Backstroke in swimming  Functional abstractions you recognized and in which you are the agent  Doing a load of laundry  Making your favorite {sandwich, pizza, cookies, …}  Others? 1/6/2016© Larry Snyder9

 We have abstracted “process a riser” and “move to the next riser” as components of a solution  As concepts, they are packaged into functions  Maybe you thought of this in a different way  That is, there can be other “coherent” parts of a solution 1/6/2016© 2010 Larry Snyder, CSE10 Just Do It!

 Another way to use a function for the risers 1/6/2016© 2010 Larry Snyder, CSE11

 If M.C. Escher handed us a problem … what would we do? 1/6/2016© 2010 Larry Snyder, CSE12 It only simplifies our thinking; the bot still does all the work

 Say “Hi” to Android’s Software Stack 1/6/2016© 2010 Larry Snyder, CSE13

1/6/2016© 2010 Larry Snyder, CSE14 Just Do It!

 Functions – the packages of computation – will be used everyday in this course  Functional Abstraction – the process of spotting a concept, “packaging” it as a function (at least in your own mind) and using it to solve some tougher problem – will be used everyday for the rest of your life! 1/6/2016© 2010 Larry Snyder, CSE15