20
CS != programming What is computer science (CS)? Take CS 121

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

Embed Size (px)

Citation preview

Page 1: CS != programming What is computer science (CS)? Take CS 121

CS != programming

What is computer science (CS)?Take CS 121

Page 2: CS != programming What is computer science (CS)? Take CS 121

CS != programming

What is computer science (CS)?Take EECS 101

"not equal to"

Page 3: CS != programming What is computer science (CS)? Take CS 121

3

Programming

CS

a vehicle, not a destination

programming : CS ::

machining : engineering

grammar : literature

equations : mathematics

CS != programming

Page 4: CS != programming What is computer science (CS)? Take CS 121

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?

Page 5: CS != programming What is computer science (CS)? Take CS 121

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"

Page 6: CS != programming What is computer science (CS)? Take CS 121

Information

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

Page 7: CS != programming What is computer science (CS)? Take CS 121

Information

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

Page 8: CS != programming What is computer science (CS)? Take CS 121

Information

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

Page 9: CS != programming What is computer science (CS)? Take CS 121

Computer Science and Information

Information is life’s fundamental building block

CS is a set of fundamental techniques for understanding and leveraging this information

9

Page 10: CS != programming What is computer science (CS)? Take CS 121

Homework problem

10

Picobot

area not covered

(yet!)

Picobotwalls

area already covered

Goal: whole-environment coverage with only local sensing…

inspiration?

Page 11: CS != programming What is computer science (CS)? Take CS 121

Picobot

11

area not covered

(yet!)

Goal: whole-environment coverage with only local sensing…

area already covered

Picobotwalls

iRobot's Roomba vacuum

inspiration!

Page 12: CS != programming What is computer science (CS)? Take CS 121

Surroundings

12

N

W E

S

Picobot can only sense things directly to the N, E, W, and S

For example, here its surroundings are

NeWsN E W S

Surroundings are always in NEWS order.

Page 13: CS != programming What is computer science (CS)? Take CS 121

How many distinct surroundings are there?

N

EW

S

news News nEws neWs newS NEws NeWs NewS

nEWs nEwS neWS NEWs NEwS NeWS nEWS NEWS(won’t happen)

== 16 possible …24

Surroundings

Page 14: CS != programming What is computer science (CS)? Take CS 121

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 neWS.

Page 15: CS != programming What is computer science (CS)? Take CS 121

Rules

Picobot moves according to a set of rules:

state

I am in state 0. My surroundings

Are neWS.

surroundings

0 neWS 0N

direction new state

If I'm in state 0 seeing neWS,

Then I move North, and change to state 0.

Aha!I should move N.

I should enter state 0.

Page 16: CS != programming What is computer science (CS)? Take CS 121

Wildcards

For a “wild card”, omit the letter and it will match walls or empty

space:

0 nW 0N

state surroundings direction new state

E/e and S/s omitted here, so those directions may be wall or empty space

I am in state 0. My surroundings

Are neWS.Aha! This matches nW

Page 17: CS != programming What is computer science (CS)? Take CS 121

What will this set of rules do to Picobot?

0 n 0N

0 N 1X

1 s 1S

1 S 0X

state surroundings direction new 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.

->

->

->

->

Page 18: CS != programming What is computer science (CS)? Take CS 121

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, Map 0 hw0, Map 2

Page 19: CS != programming What is computer science (CS)? Take CS 121

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

the empty room

0 n 0N

0 N 1X

1 s 1S

1 S 0X

state surroundings direction new state

->

->

->

->

Page 20: CS != programming What is computer science (CS)? Take CS 121

Ideas for the maze?

the maze