EECS 110: Recitation #1: Ionut Trestian Northwestern University

Slides:



Advertisements
Similar presentations
What type of data can a variable hold?
Advertisements

The Derivative in Graphing and Application
Maximal Independent Subsets of Linear Spaces. Whats a linear space? Given a set of points V a set of lines where a line is a k-set of points each pair.
Formal Models of Computation Part II The Logic Model
Properties of numbers EVEN and ODD numbers
Select Team Offense: 14 Offense
COMPANY CONFIDENTIAL PM43C Doors Media Door Used to protect media and print mechanism Front access Door Used for front access to tear bar NOT INCLUDED.
Mon: CS + programming Tue: Data Wed: Algorithms
PROLOG MORE PROBLEMS.
1 Parallel Algorithms (chap. 30, 1 st edition) Parallel: perform more than one operation at a time. PRAM model: Parallel Random Access Model. p0p0 p1p1.
ECBL: An Extended Corner Block List with Solution Space including Optimum Placement Shuo Zhou,Sheqin Dong, Xianlong Hong,Yici Cai Dept. of Computer Science.
CS Data Structures Chapter 4 Lists. Chain (1/3) Chain: Chain: A singly linked list in which the last node has a null link A singly linked list in.
Inverting a Singly Linked List Instructor : Prof. Jyh-Shing Roger Jang Designer : Shao-Huan Wang The ideas are reference to the textbook “Fundamentals.
TS: Explicitly assessing information and drawing conclusions Increasing & Decreasing Functions.
2 x0 0 12/13/2014 Know Your Facts!. 2 x1 2 12/13/2014 Know Your Facts!
Nested If Statements While Loops
Check Digit - Mod 11 Please use speaker notes for additional information!
2 x /10/2015 Know Your Facts!. 8 x /10/2015 Know Your Facts!
2.4 – Factoring Polynomials Tricky Trinomials The Tabletop Method.
1 Lecture 5 PRAM Algorithm: Parallel Prefix Parallel Computing Fall 2008.
5 x4. 10 x2 9 x3 10 x9 10 x4 10 x8 9 x2 9 x4.
MS 101: Algorithms Instructor Neelima Gupta
EMIS 8374 LP Review: The Ratio Test. 1 Main Steps of the Simplex Method 1.Put the problem in row-0 form. 2.Construct the simplex tableau. 3.Obtain an.
Linear Programming – Simplex Method: Computational Problems Breaking Ties in Selection of Non-Basic Variable – if tie for non-basic variable with largest.
A Case Study  Some Advice on How to Go about Solving Problems in Prolog  A Program to Play Connect-4 Game.
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
Whiteboardmaths.com © 2010 All rights reserved
Variational Inference Amr Ahmed Nov. 6 th Outline Approximate Inference Variational inference formulation – Mean Field Examples – Structured VI.
Chapter 8: The Solver and Mathematical Programming Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Computational Facility Layout
Shannon Expansion Given Boolean expression F = w 2 ’ + w 1 ’w 3 ’ + w 1 w 3 Shannon Expansion of F on a variable, say w 2, is to write F as two parts:
(1) MAX X1+3X2+2X3+4X4 X1=AM PHONE, X2=AM RIDE, X3=AFT PHONE, X4=AFT RIDE CONSTRAINTS AM: X1+20X2 < 12(60)=720 AFT: 2X3+30X4 < 14(60) = 840 GAS: X2+X4.
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
MULTIPLICATION OF INTEGERS
Simplex (quick recap). Replace all the inequality constraints by equalities, using slack variables.
Adding & Subtracting Mixed Numbers. Objective: To develop fluency in +, –, x, and ÷ of non-negative rational numbers. Essential Question: How.
7x7=.
ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
EECS 110: Introduction to Programming for Non-Majors
Welcome to IS 313 ! When the course was over, I knew it was a good thing. We don't have strong enough words to describe this class. Information Technology.
Welcome (back) to IST 338 ! Homework 0 Problem 0: Already complete!
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?
CS != programming What is computer science (CS)? Take CS 121.
EECS 110: Lec 3: Data Aleksandar Kuzmanovic Northwestern University
EECS 110: Lec 3: Data Aleksandar Kuzmanovic Northwestern University
EECS 110: Lec 2: What is Programming? Aleksandar Kuzmanovic Northwestern University
Ionut Trestian Northwestern University
Picobot area already covered area not covered (yet!) inspiration? walls Goal: whole-environment coverage with only local sensing … Picobot as envisioned.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
EECS 110: Lec 3: Data Aleksandar Kuzmanovic Northwestern University
Alice and Java Unit 7 1. Day 1  Objective: Gain an introduction to Java and Eclipse  Essential skill: DM-1: Use technology to advance critical thinking.
JavaScript: Conditionals contd.
Roomba! Goal: whole-environment coverage Problem motivation
EECS 110: Lec 2: What is Programming?
What is computer science (CS)?
I am going to see the Optician
Finite State Machines Part I
Multiple Selections (ELIF Statements)
Ionut Trestian Northwestern University
What is a Constitution?.
Nested If Statements While Loops
Program to find equivalence classes
Picobot Challenge! inspiration? walls Picobot area not covered (yet!)
Nate Brunelle Today: Conditional Decision Statements
What is a Constitution?.
Nate Brunelle Today: Conditional Decision Statements
What is a Constitution?.
Roomba! Goal: whole-environment coverage Problem motivation
Ionut Trestian Northwestern University
Presentation transcript:

EECS 110: Recitation #1: Ionut Trestian Northwestern University

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

If statements (2) 3 name = raw_input('Hi... what is your name? ') if name == 'Ionut‘: print 'x1' else: print 'x2' print 'x3'

If statements (3) 4 name = raw_input('Hi... what is your name? ') if name == 'Ionut': # is it Ionut? print 'x1' elif name == 'Aleksandar': print 'x2' else: # in all other cases... print 'x3' print 'x4' hw0pr1.py Homework 0, problem 1

If statements (4) 5 name = raw_input('Hi... what is your name? ') if name == 'Ionut': print 'x1' elif name == 'Aleksandar': print 'x2' else: print 'x3' print 'x4'

If statements (5) 6 name = raw_input('Hi... what is your name? ') if name == 'Ionut': # is it Ionut? print 'x1' elif name == 'Aleksandar': print 'x2' elif name == 'Lisa': print 'x3' else: # in all other cases... print 'x4' print 'x5' hw0pr1.py Homework 0, problem 1

If statements (6) 7 name = raw_input('Hi... what is your name? ') if name == 'Ionut‘: print 'x1' elif name == 'Aleksandar’: print 'x2' elif name == 'Lisa': print 'x3' else: print 'x4' print 'x5'

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

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

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

How many distinct surroundings are there? N E W S xxxxNxxxxExxxxWxxxxSNExxNxWxNxxS xEWxxExSxxWSNEWxNExSNxWSxEWSNEWS (won’t happen) == 16 possible … 2424 Surroundings

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

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

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

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

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

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

Ideas for the maze? the maze Hold on to one wall !!