EECS 110: Lec 2: What is Programming?

Slides:



Advertisements
Similar presentations
Mon: CS + programming Tue: Data Wed: Algorithms
Advertisements

EECS 110: Recitation #1: Ionut Trestian Northwestern University
OBJECT ORIENTED PROGRAMMING I LECTURE 1 GEORGE KOUTSOGIANNAKIS
COMP 14 – 02: Introduction to Programming Andrew Leaver-Fay August 31, 2005 Monday/Wednesday 3-4:15 pm Peabody 217 Friday 3-3:50pm Peabody 217.
EECS 110: Introduction to Programming for Non-Majors
Welcome to CS 115! Introduction to Programming. Class URL Please write this down!
Welcome to CS 5 ! Introduction to CS an advocate of concrete computing When the course was over, I knew it was a good thing. We don't have strong enough.
EECS 110: Lec 2: What is Programming?
Welcome to CS 3260 Dennis A. Fairclough. Overview Course Canvas Web Site Course Materials Lab Assignments Homework Grading Exams Withdrawing from Class.
COMP Introduction to Programming Yi Hong May 13, 2015.
COMP 171: Principles of Computer Science I John Barr.
Computer Science 10: Introduction to Computer Science Dr. Natalie Linnell with credit to Cay Horstmann and Marty Stepp.
CS != programming What is computer science (CS)? Take CS 121.
Welcome to CS 115! Introduction to Programming. Class URL Write this down!
EECS 110: Lec 3: Data Aleksandar Kuzmanovic Northwestern University
EECS 110: Introduction to Programming for Non-Majors Aleksandar Kuzmanovic Northwestern University
CS , Programming III: C++ 9-9:50am MWF, Hardaway 207 Two Credit Hours (ppts), and Blackboard Learn (submissions and grading)
EECS 110: Lec 2: What is Programming? Aleksandar Kuzmanovic Northwestern University
EECS 110: Introduction to Programming for Non-Majors Aleksandar Kuzmanovic Northwestern University
Picobot area already covered area not covered (yet!) inspiration? walls Goal: whole-environment coverage with only local sensing … Picobot as envisioned.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Computer Science I ISMAIL ABUMUHFOUZ | CS 180. CS 180 Description BRIEF SUMMARY: This course covers a study of the algorithmic approach and the object.
CS 201 Accelerated Introduction to Computer Science LECTURE 1 GEORGE KOUTSOGIANNAKIS 1 Copyright: FALL 2016 Illinois Institute of Technology/ George Koutsogiannakis.
Introduction to CSCI 1311 Dr. Mark C. Lewis
CSC 241: Introduction to Computer Science I
CSc 120 Introduction to Computer Programing II
CMPT 201 Computer Science II for Engineers
Welcome to EECS 395/495 Networking Problems in Cloud Computing
電腦圖學 Computer Graphic with Programming
Course Overview - Database Systems
Development Environment
IST256 : Applications Programming for Information Systems
Welcome to CS 340 Introduction to Computer Networking
CS101 Computer Programming I
CSCI 203: Introduction to Computer Science I
EECS 110: Introduction to Programming for Non-Majors
Introduction to Programming
Lab Introduction Installing Python
Computer Networks CNT5106C
PROBLEM SOLVING AND PROGRAMMING
CSc 2310 Principles of Programming (Java)
Roomba! Goal: whole-environment coverage Problem motivation
Aleksandar Kuzmanovic Northwestern University
What is computer science (CS)?
Computer Science 102 Data Structures CSCI-UA
September 27 – Course introductions; Adts; Stacks and Queues
Using MyMathLab Features
Your required course material:
Week 1 Gates Introduction to Information Technology cosc 010 Week 1 Gates
Welcome to CS 1010! Algorithmic Problem Solving.
The CS5 Times Eager Penguins Invade Computer Lab
Welcome to CS 1010! Algorithmic Problem Solving.
Course Overview - Database Systems
Welcome to CS 1010! Algorithmic Problem Solving.
Welcome to Day One!.
Overview Basic Information Lecture Labs Lab Reports Homework Exams
Welcome to Intro to C/C++ CISC 192
Using MyMathLab Features
Computer Programming 1 introduction to JAVA Lecture 1 Instructor: Ruba A. Salamah Islamic University of Gaza.
CMSC201 Computer Science I for Majors Lecture 25 – Final Exam Review
PHYS 202 Intro Physics II Catalog description: A continuation of PHYS 201 covering the topics of electricity and magnetism, light, and modern physics.
Accelerated Introduction to Computer Science
Picobot Challenge! inspiration? walls Picobot area not covered (yet!)
BIT 115: Introduction To Programming
Welcome to Intro to C/C++ CISC 192
CS Problem Solving and Object Oriented Programming Spring 2019
CSCI 203: Introduction to Computer Science I
Roomba! Goal: whole-environment coverage Problem motivation
CSC 241: Introduction to Computer Science I
Ionut Trestian Northwestern University
Presentation transcript:

EECS 110: Lec 2: What is Programming? Aleksandar Kuzmanovic Northwestern University http://networks.cs.northwestern.edu/EECS110-s17/

elif perc >= .80: grade = ‘B' Grading Grades if perc >= .90: grade = 'A' elif perc >= .80: grade = ‘B' elif perc >= .70: grade = 'C' Based on points percentage ~ 75% Assignments ~ 25% Exams Extra ~ 5% Participation Midterm Wed April 26 Exams Final Wed May 31 To pass EECS 110, you must have a passing grade on both the exams and HW. I will also give quizzes in the class, but they will not be graded. Note!

Getting help! Labs You should attend the labs because they will have you solve about 50% of your homework Recitations There will be a recitation class each Friday (10-10:50 am): help with the rest 50% of the homework Office Hours TA1: Friday 1-3 pm (Wilkinson). TA2: Sunday 3-5 pm (Wilkinson) Professor: Tuesday: 9-11:30 (Wilkinson).

Communication Professor: akuzma@northwestern.edu TAs: Annie Akbar, QuratUlAnnAkbar2015@u.northwestern.edu Melissa Perez, MelissaPerez2019@u.northwestern.edu Yousef Issa, yousef@u.northwestern.edu Kevin Wilde, KevinWilde2018@u.northwestern.edu Group e-mail: via Canvas

Homework Assignments Collaboration Honor Code ~ 4-5 problems/week ~ 100 points 20-25% extra credit available Due Sunday evening - by 11:59 pm. You can submit 3 homeworks 1 day later "Late Days" Some problems are specified “individual-only.” Others offer the option of working in a pair. Collaboration You must share the work equally - typing and coaching Each of you should make ONE submission (2 per team) Be sure to indicate who your partner was at the submission site! Honor Code

Honor Code You may not share written, electronic or verbal solutions with other students (present or past): You are encouraged to discuss problems with other students, TAs, or instructors. Copying of files except those provided by the course material. You will have the option of working in pairs for MANY of each week’s problems: the same guidelines apply for each pair.

Book CS for Scientists and Engineers, by C. Alvarado, Z. Dodds, G. Kuenning, and R. Libeskind-Hadas (Note: this is a preliminary draft!)  Available at: http://networks.cs.northwestern.edu/EECS110-s17/cs5book.pdf (there is a direct link from the documentation page)  The book is recommended, but NOT required

Software and Web site Web page: Programs: Python and Idle http://networks.cs.northwestern.edu/EECS110-s17/ Programs: Python and Idle open source, free from www.python.org installation instructions on the Web site MAKE SURE TO DOWNLOAD python-3.5.1

Submission site https://canvas.northwestern.edu Problems/issues: QuratUlAnnAkbar2015@u.northwestern.edu

Goal: whole-environment coverage with only local sensing… Homework problems 3 and 4 walls Picobot Picobot area not covered (yet!) area already covered Goal: whole-environment coverage with only local sensing… inspiration?

Goal: whole-environment coverage with only local sensing… Picobot walls Picobot area not covered (yet!) area already covered Goal: whole-environment coverage with only local sensing… iRobot's Roomba vacuum inspiration!

NxWx Surroundings N E W S Picobot can only sense things directly to the N, E, W, and S N W E S For example, here its surroundings are NxWx Surroundings are always in NEWS order. N E W S

How many distinct surroundings are there? 24 == 16 possible … xxxx Nxxx xExx xxWx xxxS NExx NxWx NxxS xEWx xExS xxWS NEWx NExS NxWS xEWS NEWS (won’t happen)

State I am in state 0. My surroundings are xxWS. Picobot's memory is a single number, called its state. State is the internal context of computation. Picobot always starts in state 0. State and surroundings represent everything the robot knows about the world

Rules Aha! I should move N. I should enter state 0. I am in state 0. My surroundings are xxWS. Aha! I should move N. I should enter state 0. Picobot moves according to a set of rules: state surroundings direction new state xxWS N If I'm in state 0 seeing xxWS, Then I move North, and change to state 0.

here, EWS may be wall or empty space Wildcards I am in state 0. My surroundings are xxWS. Aha! This matches x*** Asterisks * are wild cards. They match walls or empty space: state surroundings direction new state x*** N here, EWS may be wall or empty space

x*** -> N*** -> ***x -> ***S -> What will this set of rules do to Picobot? state surroundings direction new state x*** -> N N*** -> X 1 1 ***x -> S 1 1 ***S -> X Picobot checks its rules from the top each time. When it finds a matching rule, that rule runs. Only one rule is allowed per state and surroundings.

To do hw0, Problem #3 hw0, Problem #4 (Extra) Write rules that will always cover these two rooms. (separate sets of rules are encouraged…) hw0, Problem #3 hw0, Problem #4 (Extra) but your rules should work regardless of Picobot's starting location

Alter these "up & down" rules so that Picobot will traverse the empty room…

Ideas for the maze? the maze

Python and Idle Editor window: code Shell window: running code Here, you can save and change programs. Hitting F5 runs your program over in the shell Here, you can try things out at the command prompt >>>

If statements (1) hw0pr1.py Homework 0, problem 1 name = input('Hi... what is your name? ') if name == ’Ning': # is it Ning? print('x1’) else: # in all other cases... print('x2’) print('x3’) hw0pr1.py Homework 0, problem 1

If statements (2) name = input('Hi... what is your name? ') if name == ’Ning‘: print('x1’) else: print('x2’) print('x3’)

What is computer science (CS)? CS != programming What is computer science (CS)? Take EECS 101

What is computer science (CS)? CS != programming What is computer science (CS)? Take EECS 101 "not equal to"

a vehicle, not a destination CS != programming programming : CS :: machining : engineering grammar : literature Programming equations : mathematics CS a vehicle, not a destination

CS == computing science Study of complexity (or complex things?) How can it be done? How well can it be done? Can it be done at all? Suppose we have a large group of students that we need to pair up to work on projects. We know which students are compatible with each other and we want to put them in compatible groups of two. We could search all possible pairings but even for 40 students we would have more than three hundred billion trillion possible pairings.

CS == computing science Study of complexity (or complex things?) How can it be done? How well can it be done? Can it be done at all? "equal to"

Information What information does Google work with? What technical problems does Google face?

Information What information does Facebook work with? What technical problems does Facebook face?

Information What information does the iPhone work with? What technical problems does the iPhone face?

Computer Science and Information Information is life’s fundamental building block CS is a set of fundamental techniques for understanding and leveraging this information

Programming as learning a foreign language What is programming? Programming as learning a foreign language 1) Expect it to be different! 2) Don’t feel you need to memorize it 3) Immersion == Experimentation

The foreign language of Python… syntax? semantics? intent? How it looks What it does What it should do name = input('Hi... what is your name? ') print # prints a blank line if name == ’Ning': # is it Ning? print( name, '??’) print(‘You must be a TA!') elif name == ‘Aleksandar’: # is it Aleksandar? print( ‘You must be an instructor!') else: # in all other cases... print( 'Welcome to Python,', name, '!')

The foreign language of Python… syntax? semantics? intent? How it looks What it does What it should do name = input('Hi... what is your name? ') print # prints a blank line if name == ’Ning': # is it Ning? print( name, '??’) print(‘You must be a TA!') elif name == ‘Aleksandar’: # is it Aleksandar? print( ‘You must be an instructor!') else: # in all other cases... print( 'Welcome to Python,', name, '!')

The foreign language of Python syntax? semantics? intent? How it looks What it does What it should do how punctuation is used the language keywords that are used use of whitespace peculiarities of formatting how behavior is affected …

HW 0, Problem 2 syntax? semantics? intent? How it looks What it does What it should do Save hw0pr1.py under a new name, hw0pr2.py Change hw0pr2.py to play rock-paper-scissors. It does not have to play fair! Feel free to add to the dialog, if you wish… Submit your hw0pr2.py in the usual way. Stepping back from Python for a moment…