Perspectives on Programming

Similar documents
MERRY CHRISTMAS Level: 5th year of Primary Education Grammar:

Outreach Connect User Manual

Graduation Party by Kelly Hashway

CS177 Python Programming

PREP S SPEAKER LISTENER TECHNIQUE COACHING MANUAL

Renaissance Learning 32 Harbour Exchange Square London, E14 9GE +44 (0)

Houghton Mifflin Online Assessment System Walkthrough Guide

Kindergarten - Unit One - Connecting Themes

SNAP, CRACKLE AND POP! INFUSING MULTI-SENSORY ACTIVITIES INTO THE EARLY CHILDHOOD CLASSROOM SUE SCHNARS, M.ED. AND ELISHA GROSSENBACHER JUNE 27,2014

Tap vs. Bottled Water

AC : TEACHING COLLEGE PHYSICS

Appendix L: Online Testing Highlights and Script

Enduring Understandings: Students will understand that

Star Math Pretest Instructions

This curriculum is brought to you by the National Officer Team.

Listening to your members: The member satisfaction survey. Presenter: Mary Beth Watt. Outline

Investigations for Chapter 1. How do we measure and describe the world around us?

Industrial Assessment Center. Don Kasten. IAC Student Webcast. Manager, Technical Operations Center for Advanced Energy Systems.

FUZZY EXPERT. Dr. Kasim M. Al-Aubidy. Philadelphia University. Computer Eng. Dept February 2002 University of Damascus-Syria

UDL Lesson Plan Template : Module 01 Group 4 Page 1 of 5 Shannon Bates, Sandra Blefko, Robin Britt

a) analyse sentences, so you know what s going on and how to use that information to help you find the answer.

Five Challenges for the Collaborative Classroom and How to Solve Them

Excel Intermediate

Attendance/ Data Clerk Manual.

Getting Started with Deliberate Practice

TEACHING Simple Tools Set II

Executive Guide to Simulation for Health

Lecture 1: Machine Learning Basics

Eggs-periments & Eggs-plorations

The lasting impact of the Great Depression

Connect Microbiology. Training Guide

University of Toronto Physics Practicals. University of Toronto Physics Practicals. University of Toronto Physics Practicals

CLASS EXPECTATIONS Respect yourself, the teacher & others 2. Put forth your best effort at all times Be prepared for class each day

Testing A Moving Target: How Do We Test Machine Learning Systems? Peter Varhol Technology Strategy Research, USA

Part I. Figuring out how English works

Hentai High School A Game Guide

If we want to measure the amount of cereal inside the box, what tool would we use: string, square tiles, or cubes?

WiggleWorks Software Manual PDF0049 (PDF) Houghton Mifflin Harcourt Publishing Company

PART C: ENERGIZERS & TEAM-BUILDING ACTIVITIES TO SUPPORT YOUTH-ADULT PARTNERSHIPS

Grades. From Your Friends at The MAILBOX

The Task. A Guide for Tutors in the Rutgers Writing Centers Written and edited by Michael Goeller and Karen Kalteissen

Spring 2015 Achievement Grades 3 to 8 Social Studies and End of Course U.S. History Parent/Teacher Guide to Online Field Test Electronic Practice

THE HEAD START CHILD OUTCOMES FRAMEWORK

KS1 Transport Objectives

Operations and Algebraic Thinking Number and Operations in Base Ten

Let's Learn English Lesson Plan

Completing the Pre-Assessment Activity for TSI Testing (designed by Maria Martinez- CARE Coordinator)

Missouri Mathematics Grade-Level Expectations

School Year 2017/18. DDS MySped Application SPECIAL EDUCATION. Training Guide

2 months: Social and Emotional Begins to smile at people Can briefly calm self (may bring hands to mouth and suck on hand) Tries to look at parent

Intel-powered Classmate PC. SMART Response* Training Foils. Version 2.0

10 tango! lessons. for THERAPISTS

A Pumpkin Grows. Written by Linda D. Bullock and illustrated by Debby Fisher

Individual Component Checklist L I S T E N I N G. for use with ONE task ENGLISH VERSION

Preferences...3 Basic Calculator...5 Math/Graphing Tools...5 Help...6 Run System Check...6 Sign Out...8

Mini Lesson Ideas for Expository Writing

MADERA SCIENCE FAIR 2013 Grades 4 th 6 th Project due date: Tuesday, April 9, 8:15 am Parent Night: Tuesday, April 16, 6:00 8:00 pm

Formative Assessment in Mathematics. Part 3: The Learner s Role

CAFE ESSENTIAL ELEMENTS O S E P P C E A. 1 Framework 2 CAFE Menu. 3 Classroom Design 4 Materials 5 Record Keeping

A process by any other name

Quantitative Research Questionnaire

Creating and Thinking critically

FORCE : TECHNIQUES DE DESSIN DYNAMIQUE POUR L'ANIMATION FROM PEARSON EDUCATION

Introduction to Causal Inference. Problem Set 1. Required Problems

Chapter 4 - Fractions

MOODLE 2.0 GLOSSARY TUTORIALS

Speak with Confidence The Art of Developing Presentations & Impromptu Speaking

Experience College- and Career-Ready Assessment User Guide

On May 3, 2013 at 9:30 a.m., Miss Dixon and I co-taught a ballet lesson to twenty

Activities for School

The Foundations of Interpersonal Communication

Improving Conceptual Understanding of Physics with Technology

Syllabus: CS 377 Communication and Ethical Issues in Computing 3 Credit Hours Prerequisite: CS 251, Data Structures Fall 2015

Unit 3 Ratios and Rates Math 6

2014 Free Spirit Publishing. All rights reserved.

Curriculum Design Project with Virtual Manipulatives. Gwenanne Salkind. George Mason University EDCI 856. Dr. Patricia Moyer-Packenham

Renaissance Learning P.O. Box 8036 Wisconsin Rapids, WI (800)

Case study Norway case 1

Radius STEM Readiness TM

Picture It, Dads! Facilitator Activities For. The Mitten

HUBBARD COMMUNICATIONS OFFICE Saint Hill Manor, East Grinstead, Sussex. HCO BULLETIN OF 11 AUGUST 1978 Issue I RUDIMENTS DEFINITIONS AND PATTER

Dyslexia and Dyscalculia Screeners Digital. Guidance and Information for Teachers

CLASSROOM PROCEDURES FOR MRS.

Student Handbook. This handbook was written for the students and participants of the MPI Training Site.

Cognitive Development Facilitator s Guide

Language Acquisition Chart

We are going to talk about the meaning of the word weary. Then we will learn how it can be used in different sentences.

STUDENT PERCEPTION SURVEYS ACTIONABLE STUDENT FEEDBACK PROMOTING EXCELLENCE IN TEACHING AND LEARNING

TEKS Comments Louisiana GLE

Reviewing the student course evaluation request

PowerTeacher Gradebook User Guide PowerSchool Student Information System

Blank Table Of Contents Template Interactive Notebook

Classify: by elimination Road signs

South Carolina College- and Career-Ready Standards for Mathematics. Standards Unpacking Documents Grade 5

ADVANCED MACHINE LEARNING WITH PYTHON BY JOHN HEARTY DOWNLOAD EBOOK : ADVANCED MACHINE LEARNING WITH PYTHON BY JOHN HEARTY PDF

MULTIMEDIA Motion Graphics for Multimedia

arxiv: v1 [math.at] 10 Jan 2016

16.1 Lesson: Putting it into practice - isikhnas

CALCULUS III MATH

Sight Word Assessment

Transcription:

Perspectives on Programming Amr Sabry Computer Science Indiana University 7 March 2016 1

Programming is... A Form of Communication 2

Talking to children Did you notice how we talk to children? We don t say: Assuming the standard three-dimensional physical space, please identify the coordinates of the spherical object in question. Instead we say: Where... is... ball? and then we might say: Here is ball! 3

Why? Why do we talk to children this way? Children can only understand a simple vocabulary Children only understand simple ideas Children can only understand slowly- and clearly-enunciated sounds Children understand the emotion in the sentence more than the actual words 4

Instructing a child We talk to children to express love, to make them feel safe, etc., and sometimes to make them do things for us. We talk to machines to make them do things for us. 5

Instructing a 3-year old to get you a drink Walk to the fridge Open the fridge Get the milk. Be careful, it s heavy. Put the milk on the counter. Close the fridge Get a glass from the cabinet to your right. Pour some milk. Not too much. It might spill. Bring me the glass. Use two hands. Put the milk back in the fridge. Don t forget to close the door. 6

Instructing a 3-year old to get you a drink Our instructions are tailored to what we understand about the child s abilities. We assume that the child can interpret basic English sentences, that the child can walk, that the child can exercise the right muscles to carry a heavy container, etc. We don t give any instructions about how to perform such tasks. We are careful to use instructions that the child can understand and has a chance at performing. We don t ask the child to go to the store to buy some milk or ask the child to read the labels on the containers. 7

Instructing a 3-year old to get you a drink We assume the child can carry a full glass but we know this is challenging. We give detailed instructions about such tasks. We assume the child can only remember a few things at once. We break the task into small steps and wait for feedback before giving the next step. 8

Asking a close adult to get you a drink I am thirsty honey. The person understands that when you are thirsty and that the nice thing to do is to offer you a drink. We can rely on the person to have a memory of our preferences and to get a glass of milk; if there is no milk we expect the person to make a decision to get water instead, etc. 9

Talking to a microwave Sometimes it is very easy to say what we want to say. If we want to say heat this item for one minute all we have to do is push one button. Some things are harder to say. Have you ever tried to thaw a chicken using a microwave? It involves a long complicated process with many buttons and it usually does not work! Some things are easy to say but only once you convert them to the right language. When a recipe says to cook the food for 3 minutes, it generally assumes a standard 700-watt oven. If your oven is a 1400-watt oven, for how long should you cook the food? 10

Talking to a cell phone Dialing a phone number is trivial: Grandma can do it. Maintaining a Contacts List is almost trivial: Grandma s contact list will likely have duplicates, stale, and conflicting information. Actually my contact list has duplicates, stale, and conflicting information. Turning your favorite song into a ringtone is more complicated. Grand-daughter will do it for Grandma. 11

Programming Microwaves and Cell Phones Talking to a machine is generally called programming the machine. With microwaves and cell phones we can usually express two kinds of programs: Microwaves and cell phones are very special-purpose computers and we talk to them all the time. The simplest programs just tell the machine to do something it was designed to do automatically with the push of one button. Heat food for one minute. More complicated programs involve a sequence of commands. Set the power to 30%, then cook for 10 minutes, then increase the power to 50%, and cook for 10 more minutes. 12

Programming With more advanced machines (computers!), we can express more sophisticated programs: Repeat the following commands until a certain condition holds. Keep downloading pictures until the user clicks Done. Try to do the following commands. If something goes wrong, abort the commands and execute these other commands instead. Try to copy this folder and the files it contains to the data stick; if the data sticks becomes full in the middle of copying one file, erase this one file, and tell the user that the operation failed. 13

Lessons on how to talk to children (or machines!) As in any communication, we must tailor our instructions to the machine. We must understand what the machine is capable of doing! Can t ask your cell phone to heat your pizza We must understand the language that the machine can interpret. Can t ask the microwave to heat your leftovers by singing to it. Must push the right buttons on the panel. We must monitor the progress of the machine and give appropriate instructions. Turn the microwave off when the popping sounds are more than a second apart. 14

Programming is... About Algorithms 15

Sorting Let s do something simple: sorting a deck of cards Algorithm I: Find the ace of spades and put it upside down Find the 2 of spades and put it upside down on the ace of spades Find the 3 of spades...... 16

Sorting Algorithm I Find the ace of spades and put it upside down: might have to go through 52 cards Find the 2 of spades and put it upside down on the ace of spades: might have to go through 51 cards Find the 3 of spades...... Might have to go through 52 + 51 + 50 +... cards = 1378 17

Sorting Algorithm II Separate the four suits: Goes through 52 cards Sort each of the suits using Algorithm I: might have to go through 13+12+11+... cards four times Goes through 416 cards Best algorithm: goes through at most 205 cards 18

The Seven Bridges of Königsberg Can one walk around the city in a way that would involve crossing each bridge exactly once? 19

The Seven Bridges of Königsberg Can one walk around the city in a way that would involve crossing each bridge exactly once? 20

Programming is... About Language 21

What is programming again? A program is a set of directions telling a computer exactly what to do. A programming language is a precise notation for specifying sequences of directions to a computer. Unlike English there are no ambiguities and no nuances. An algorithm is the general idea with which we try and solve the problem. 22

Programming a bare computer When you buy a new laptop, it says Intel inside What if we only had that Intel thing and nothing else? To print Hello on the screen in x86 assembly language: Message db "Hello".code mov dx,offset Message mov ax,seg Message mov dx,ax mov ah,9 int 21h mov ax,4c00h int 21h END 23

System software For convenience, modern computers come with layers and layers and layers of software who job is to translate from some humanlike language to the low-level assembly language. Even better it is very easy to teach a computer to speak almost any language of our choice, provided somebody knows how to translate this language to the low-level assembly language or to some other language that has a translation to assembly language. 24

Choosing a language If I want to say something to this computer, the first decision is to choose the language in which I want to say it. There are millions of computer languages; some are general-purpose, and some very specific to a class of applications. Even better, we can make up our own language! 25

Invent a language A honors project for H211 students. Take a description written in this made-up language: yellow matte apply sphere 2.0 1.0 1.0 scale 0.0 0.0 3.0 translate white matte apply plane 0.0-2.0 0.0 translate union /scene 1.0-1.0 1.0 point 1.0 1.0 1.0 point light /l 0.3 0.3 0.3 point [l] scene 1 90.0 320 200 "ellipsoid.ppm" render 26

And the output is... 27

How? Write an interpreter from our made-up language to some language that the computer already understands. Really once you master interpreters you can say anything you want to the computer and in the way you want it! 28

Mouse in a maze Let s try to develop a complete but small example to tell the computer how to find its way in a maze. 29

Commands Let s invent a language with the following commands: Step forward Turn left Turn right In maze? Facing wall? 30

Problem Construct a program that gets the mouse from entry to exit! Use the commands on the previous slide. Don t go through walls! 31

Ideas? 32

Ideas? Hug the wall! Have the mouse walk hugging the wall to its right. 33

Algorithm step forward; while (inside the maze?) { turn right; while (facing a wall?) { turn left; } step forward; } 34

Programming is... About Scale 35

Scaling Up 36

Scaling Up Now let s scale this up to programs that are millions of lines of code. Nobody can keep track of that much information in their head We need ABSTRACTION to be able to focus on one part of problem We want to be able to break the program into manageable pieces that we can develop individually and then COMPOSE together. 37

Finding the right abstraction Which is the right abstraction for a human? 38

Enforcing abstraction Programming language must enforce levels of abstraction Checked and enforced by the compiler Types, types, and types With really advanced type systems, we have the following theorem : if it typechecks it is correct!!! 39

Programming is... About Interacting with the Physical World 40

Quantum Computing Computing is the process of transforming information about a situation to information about another situation 41

Quantum Computing Unit of information: bit Is the bit something physical? Many physicists argue YES! 42

Quantum Computing 43

Quantum Computing In any case, computers manipulate physical representations of bits, e.g., electric signals which are quite real: they drain your battery and heat up your computer Your SSN, your bank account, your address, etc. are nothing but bits. Not only are these bits real but they are worth protecting with perhaps millions of dollars. 44

Quantum Computing So computing... converts some physical representation of information to another we do not want to think of energy, electric signals, bits, etc. We want to abstract from that and focus on the structure of information the process of computing should obey the laws of physics but should be expressed at an abstract level corresponding to the structure of information 45

Quantum Computing Classical vs. quantum computing One relies on the laws of classical physics: the world is black and white, fixed, and completely deterministic The other relies on the laws of quantum of mechanics: the world is fuzzy, dynamic, and probabilistic 46

Programming is... Science, Engineering, Language, Communication, Compassion, and Understanding 47

Conclusions Machines are supposed to work for us. To tell them what we need done, we must learn their language. Machines are very precise: they do what you tell them verbatim! We must be very careful and accurate when talking to machines. Sometimes it feels like we work for them. But when we make the machine do something complicated for us something that we couldn t have done without the machine it is all worth it! Will we ever scale quantum computers? What will this look like??? 48