Lecture 0: Welcome! - Harvey Mudd College
Download
Report
Transcript Lecture 0: Welcome! - Harvey Mudd College
Welcome to IS 313 !
Information Technology
We don't have strong enough words to describe this class.
- US News and Course Report
an advocate of
concrete computing
When the course was over, I knew it was a good thing.
- New York Times Review of Courses
We give this course two thumbs!
- Ebert and Roeper
About myself
Who
Zach Dodds
Where
Harvey Mudd College
What
Research includes robotics and computer vision
When
Mondays 4-7 pm here in ACB 108
Contact
Information
[email protected]
909-607-1813
Office Hours:
Friday afternoons, 2-4 pm
or set up a time...
HMC Olin 1255
TMI?
fan of low-tech games
fan of low-level AI
“Quiz”
take a movie of yourself saying
your name & where you're from
• Name
• Preferred email
• A place you consider home
• Your favorite _____ is _____.
• Your least favorite _____ is _____.
• Are you working at a company now?
Where?
• Do you use computer programming?
How/what?
“Quiz”
• Name
Zachary Dodds
• Preferred email
[email protected]
• A place you consider home
Pittsburgh, PA
Burn Notice
drama is _____.
• Your favorite _____
coffee is _____.
decaffeinated
• Your least favorite _____
• Are you working at a company now?
Where?
• Do you use computer programming?
How/what?
Harvey Mudd
java/C++/python
IS 313
What?
Why?
IS 313
What?
Why?
CS for IS
all of CS in one
semester!
CS == Computer Science
IS 313
What?
Why?
CS for IS
IS is about
bridging and
leveraging
technologies
all of CS in one
semester!
but what is CS ?
Credit Suisse?
Counter-Strike
C10H5ClN2 : CS gas
CompuServe
Computer Science
Cultural Survival
CS? Hmmm Let
me check
Google…
CS
!=
programming : CS ::
programming
CS
!=
programming
programming : CS ::
"not equal to"
CS
!=
programming
programming : CS ::
bookkeeping : business
grammar : literature
Programming
equations : mathematics
unicycling : HMC
a vehicle, not a destination
CS
CS == complexity science
Study of complexity
How can it be done?
How well can it be done?
Can it be done at all?
What's it ?
"is equal to"
CS == complexity science
Study of complexity
How can it be done?
How well can it be done?
Can it be done at all?
What's it ?
Information
Information
Study of complexity
How can it be done?
How well can it be done?
Can it be done at all?
What information is being
transformed here?
"Make3d"
Andrew Ng ~
Computers and
Thought award, 2009
What Google thinks I look like
First 4 Google Image hits (8/29/10) for a search of
"Zach Dodds HMC"
What Google thinks I look like
First 4 Google Image hits (8/29/10) for a search of
"Zach Dodds HMC"
What Google thinks I look like
First Google Image hit (8/30/09) for a search of
"Zach Dodds"
Images are difficult!
Information
Study of complexity
How can it be done?
How well can it be done?
Can it be done at all?
What information is
being tracked here?
The N-body problem:
lots of interactions!
Information
Study of complexity
How can it be done?
How well can it be done?
Can it be done at all?
http://www.youtube.com/watch?v=fvBO3TqJ6FE
Protein Folding
Information:
sequence and pose of
amino acids
The 3d structure of a protein is completely
determined by its 1d amino acid sequence.
Understanding this sequence-structure
relationship has been referred to as the
"second half of the genetic code."
CS Research ?
my own…
Why CS ?
Information is our fundamental building block.
Genetic Code: DNA
Our senses and experiences
GTAGCACAITTAGC…
More coffee required…
us
CS is a set of fundamental techniques for
understanding and leveraging this information…
“constructing with”
CS’s motto ?
print
print
print
print
'hv',
'dcle\naemdoe'
'ryu',
'lg!'
details are temporary…
print 'whtvo\na',
print 'eub\neraeo'
print 'yraoo\negdne'
…but CS thinking isn’t !
CS vs. IS and IT ?
greater integration
system-wide issues
smaller details
machine specifics
www.acm.org/education/curric_vols/CC2005_Final_Report2.pdf
CS vs. IS and IT ?
Where will IS go?
CS vs. IS and IT ?
IT ?
Where will IT go?
IT ?
Why IS313 ?
looking to manage, analyze, engineer, lead, innovate at
the next Google / Facebook / OnLive …
without programming or computer science ?
Yes, if you’re retired
No, if you’re not…
Intuition about all the details you’ll be
organizing, managing, and/or using will make
you more effective at all of the above.
About IS313 …
Course Details
Web Page:
http://www.cs.hmc.edu/~dodds/IS313
Assignments, online text, necessary files, lecture slides are linked
First week’s assignment: Starting with Python and Picobot
CS 5 website http://www.cs.hmc.edu/twiki/bin/view/CS5
Textbooks!
optional and online
How to think like a
computer scientist
greenteapress.com/thinkpython/
Programs: python and IDLE
www.python.org
Try installing v2.7 now…!
Try it…
Go to the course page
Click on the
HW page
Install Python 2.7
get & run the file
hw0pr1.py
F5 runs!
http://www.cs.hmc.edu/~dodds/IS313/
Homework
Assignments
~ 2-5 problems/week
~ 100 points
extra credit available
Due Tuesday of the following week (anytime) - or by 11:59 pm.
Assignment 1 due Tuesday, September 14.
1 week + 1 day…
No class next Monday, September 6: Labor Day
Homework
Assignments
~ 2-5 problems/week
~ 100 points
extra credit available
Due Tuesday of the following week (anytime) - or by 11:59 pm.
Assignment 1 due Tuesday, September 14.
Working on programs:
Submitting programs:
Today's Lab:
Problems may be done in groups of 2-3.
Divide the work at the keyboard evenly!
at the submission website
install software Python & ensure accounts are working
try out Python - the HW is officially due on 9/14
Grading
Grades
Based on points percentage
~ 900 points for assignments
if score >= 0.95: grade = “A”
if score >= 0.90: grade = “A-”
if score >= 0.60: grade = “P”
see the 313 syllabus for the full list...
Exams
Final Exam/Project at the end of the semester.
~ 300 points for the final exam
• the last 2-3 weeks will work towards a
larger, final project (this is the "exam")
• there will be a short design phase and a
short final presentation
• I'd encourage you to connect Python to other
information technology that you use/need/like, etc.
Resources
Instructor
Zach Dodds
Harvey Mudd
Office: Harvey Mudd’s Olin 1255
Phone: x71813 (909-607-1813)
Email: [email protected]
Official Office Hours: F 2-4 pm or email
in Linde Activities Center
• Lecture is offered TTh from 9:35-10:50 am or 1:15-2:30 pm
• IS 313 is similar to (but not identical to) CS 5 at Harvey Mudd
http://www.cs.hmc.edu/twiki/bin/view/CS5
• CS 5 == IS 313 is not quite true…
Other Students
• consulting with others (except team members or myself) is
encouraged, but has to be limited to discussion of problems.
Sharing of written, electronic, or verbal solutions/files/code is a
violation of CGU’s academic honesty policy.
Resources
Instructor
Zach Dodds
Harvey Mudd
Office: Harvey Mudd’s Olin 1255
Phone: x71813 (909-607-1813)
Email: [email protected]
Official Office Hours: F 2-4 pm or email
in Linde Activities Center
• Lecture is offered TTh from 9:35-10:50 am or 1:15-2:30 pm
• IS 313 is similar to (but not identical to) CS 5 at Harvey Mudd
http://www.cs.hmc.edu/twiki/bin/view/CS5
• CS 5 == IS 313
"is equal to"
Other Students
for the purposes of many
websites, documents, etc.
• consulting with others (except team members or myself) is
encouraged, but has to be limited to discussion of problems.
Sharing of written, electronic, or verbal solutions/files/code is a
violation of CGU’s academic honesty policy.
Questions ?
Programming… ?!
Information Technology
We don't have strong enough words to describe this class.
- US News and Course Report
an advocate of
concrete computing
When the course was over, I knew it was a good thing.
- New York Times Review of Courses
We give this course two thumbs!
- Ebert and Roeper
Programming… ?!
Information Technology
an advocate of
concrete computing
Computer Psychology
Not the goal…
a = ['print "a =", a', 'for s in a: print s']
print "a =", a
knowing crazy
for s in a: print s
coding details…
ouch!
Goals
a = ['print "a =", a', 'for s in a: print s']
print "a =", a
for s in a: print s
ouch!
thinking like a machine
ENIAC, UPenn, 1945
What is programming ?
Programming as recipe-writing
vs.
Programming as learning a foreign language
What is programming ?
Programming as recipe-writing
vs.
Programming as learning a foreign language
1) Expect it to be different!
2) Don’t feel you need to memorize it
3) Immersion == Experimentation
Baggage !
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 >>>
The foreign language of python…
name = raw_input('Hi... what is your name? ')
print
# prints a blank line
if name == 'Z' or 'Ran':
# is it Z or Ran?
print 'Um, I\'m "offline." Try later.'
elif name == 'Zach':
# is it Zach?
print "But I wanted to meet Cody!"
else:
# in all other cases...
print 'Welcome', name, '!'
my_choice = random.choice( [ 'R','P','S' ] )
print 'My favorite object is', my_choice, "!"
hw0pr1.py
Homework 0, problem 1
What is programming ?
Programming as recipe-writing
vs.
Programming as learning a foreign language
1) Expect it to be different!
2) Don’t feel you need to memorize it
3) Immersion == Experimentation
Baggage !
The foreign language of python…
syntax?
How it looks
semantics?
What it does
intent?
What it should do
name = raw_input('Hi... what is your name? ')
print
# prints a blank line
if name == 'Z' or 'Ran':
# is it Z or Ran?
print 'Um, I\'m "offline." Try later.'
elif name == 'Zach':
# is it Zach?
print "But I wanted to meet Cody!"
else:
# in all other cases...
print 'Welcome', name, '!'
my_choice = random.choice( [ 'R','P','S' ] )
print 'My favorite object is', my_choice, "!"
'Zach'
‘Z’
or ‘Ran’
ZZach
or Ran
'Chris'
Chris
Zach
What about me?
The foreign language of python…
syntax?
How it looks
semantics?
What it does
intent?
What it should do
• how punctuation is used
• the language keywords that are used
• use of whitespace
• peculiarities of formatting
• how behavior is affected …
www.theonion.com
Syntax
How Python looks…
name = raw_input('Hi... what is your name? ')
print
# prints a blank line
if name == 'Z' or 'Ran':
# is it Z or Ran?
print 'Um, I\'m "offline." Try later.'
elif name == 'Zach':
# is it Zach?
print "But I wanted to meet Cody!"
else:
# in all other cases...
print 'Welcome', name, '!'
my_choice = random.choice( [ 'R','P','S' ] )
print 'My favorite object is', my_choice, "!"
Hw 0, Problem 2
syntax?
How it looks
semantics?
intent?
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 for a moment…
Why Python ?
Python is a general-purpose computer language
Why Python ?
Python is a general-purpose computer language
Physics:
LabView
Biology:
Lasergene, DNA*
Also:
Excel, Word, SQL
Business:
SAP, all sorts of
Microsoft products, and many,
many other business solutions
Other general-purpose languages
C, C++, C#, J#, Java, Javascript, Cobol,
Fortran, Perl, Ruby, Visual Basic, ...
see www.python.org…
Language is language
PLEASE DO ,1 <- #13
DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #112
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #238
DO ,1 SUB #7 <- #26
DO ,1 SUB #8 <- #248
DO ,1 SUB #9 <- #168
DO ,1 SUB #10 <- #24
DO ,1 SUB #11 <- #16
DO ,1 SUB #12 <- #158
DO ,1 SUB #13 <- #52
PLEASE READ OUT ,1
PLEASE GIVE UP
Intercal
v
>v"Hello world!"0<
,:
^_25*,@
Befunge
LISP/Scheme
(DEFUN HELLO-WORLD ()
(PRINT (LIST 'HELLO 'WORLD)))
int main()
{
std::cout << "Hello, world!";
}
C++
print "Hello, World!";
print 'Hello, World!'
Perl
Perl doesn’t seem
too alien…
Python
Language is language ?
Perls of wisdom ?
eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,?
odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311
-%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311
(:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v),31-041-,4-B-%c(:v),91-041-,74-B-%c(:%E<,%I:v)1-021-31-E-%x(:v),%I-021-,
91-E-%x(:%K<,231:v),71-81-,31-@-%C(:v),301-81-,%L-@-%C(:v),%u-81-,211-@-%C(:%M<,%u:v),51-61-1-F-%C(:v),%L-61-,021-F-%C(:v),%u
-61-,211-F-%C(:%J<%u:v)751-41-791-[-%C(:v)401-41-441-[-%C(:v)%u-41-291-[-%C(:%b,?bsd`udNw`m)063-080-091-088-,u`fr<?G-,ghmm<?f
sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G
-1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h
oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz%
G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03
1:|dmrdz%E*<01:%d<01:|%b,?%w)E-%d-1(:hg)%K?%u(z%K*<229:%d<,%K:%K<,251:|dmrdz%K*<7:%d<7:|%b,?%w)@-%d-1(:hg)%M?%u(z%M*<271:%d<,
%M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg
))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81
(:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$
4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P
z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y
-%x-%Y-%X(<%b,?bnnser)G(:|>^chr($$/$$)x2016.
Perl might be a little bit TOO
flexible a language!
Language is language ?
Perls of wisdom ?
eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,?
odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311
-%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311
(:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v),31-041-,4-B-%c(:v),91-041-,74-B-%c(:%E<,%I:v)1-021-31-E-%x(:v),%I-021-,
91-E-%x(:%K<,231:v),71-81-,31-@-%C(:v),301-81-,%L-@-%C(:v),%u-81-,211-@-%C(:%M<,%u:v),51-61-1-F-%C(:v),%L-61-,021-F-%C(:v),%u
-61-,211-F-%C(:%J<%u:v)751-41-791-[-%C(:v)401-41-441-[-%C(:v)%u-41-291-[-%C(:%b,?bsd`udNw`m)063-080-091-088-,u`fr<?G-,ghmm<?f
sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G
-1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h
oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz%
G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03
1:|dmrdz%E*<01:%d<01:|%b,?%w)E-%d-1(:hg)%K?%u(z%K*<229:%d<,%K:%K<,251:|dmrdz%K*<7:%d<7:|%b,?%w)@-%d-1(:hg)%M?%u(z%M*<271:%d<,
%M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg
))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81
(:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$
4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P
z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y
-%x-%Y-%X(<%b,?bnnser)G(:|>^chr($$/$$)x2016.
Perl might be a little bit TOO
flexible a language!
Goal: expression, not language details.
The results
thinking computationally,
not language details
HW problems 3 and 4
Picobot
walls
Picobot
area not
covered
(yet!)
area
already
covered
Picobot
the unofficial HMC mascot
inspiration?
Goal: whole-environment coverage
with only local sensing…
Picobot
walls
Picobot
area not
covered
(yet!)
area
already
covered
iRobot's Roomba vacuum
inspiration!
Goal: whole-environment coverage
with only local sensing…
Surroundings
Picobot can only sense things
directly to the N, E, W, and S
N
E
W
S
For example, here its surroundings are
NxWx
N E W S
Surroundings are
always in NEWS order.
Surroundings
How many distinct
surroundings are there?
N
E
W
S
Surroundings
How many distinct
surroundings are there?
N
E
W
S
24 == 16 possible …
xxxx
Nxxx
xExx
xxWx
xxxS
NExx
NxWx
xEWx
xExS
xxWS
NEWx
NExS
NxWS
xEWS
NxxS
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
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
0
surroundings
xxWS
If I'm in state 0
seeing xxWS,
direction
new state
N
0
Then I move North, and
change to state 0.
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
0
surroundings
direction
new state
N
0
x***
here, EWS may be wall or empty space
here, there numst be nothing to the N
What will this set of rules do to Picobot?
state
surroundings
0
0
x***
N***
direction
new state
N
X
0
0
->
->
What happens here?
how do we get back down?
Picobot checks its rules from the top each time.
When it finds a matching rule, that rule runs.
What will this set of rules do to Picobot?
state
surroundings
0
0
x***
N***
1
1
***x
***S
direction
new state
->
->
N
X
0
1
->
->
S
X
1
0
What do states 0 and 1 mean in this case?
Picobot checks its rules from the top each time.
When it finds a matching rule, that rule runs.
What will this set of rules do to Picobot?
state
surroundings
0
0
x***
N***
1
1
***x
***S
direction
new state
->
->
N
X
0
1
->
->
S
X
1
0
What do states 0 and 1 mean in this case?
Picobot checks its rules from the top each time.
When it finds a matching rule, that rule runs.
To do
Write rules that will always cover these two rooms.
hw0, Problem #3
(separate sets of rules are encouraged…)
hw0, Problem #4
but your rules should work regardless of Picobot's starting location
Alter these "up & down" rules so that
Picobot will traverse the empty room…
"Quiz" #2
the empty room
Plan your strategy then try it out at:
http://www.cs.hmc.edu/~dodds/picobot/picobotPlain.html
or login and submit from http://www.cs.hmc.edu/~submissions/submissions/homeworkPages/picobot.py?course=IS313
Ideas for the maze?
the maze
Computer Science
Information is intrinsic to every system…
How can we benefit from this information?
“create with”
Representing it
Efficiently?
…
Applying it
Effectively?
…
Measuring it
Possibly?
Computer Science
Information is intrinsic to every system…
How can we benefit from this information?
“create with”
Representing it
Efficiently?
…
Applying it
…
Effectively?
How to measure these
rooms' complexity?
Measuring it
Possibly?
Computer Science
Information is intrinsic to every system…
How can we benefit
from this information?
“create with”
Representing it
Efficiently?
…
Applying it
…
Effectively?
Measuring it
Possibly?
How to measure these
rooms' complexity?
How many states
and rules are
really necessary ?
our best: 3 states, 6 rules
our best: 4 states, 8 rules
Computer Science
Information is intrinsic to every system…
How can we benefit
from this information?
“create with”
Representing it
Efficiently?
…
Applying it
…
Effectively?
Measuring it
Possibly?
How to measure these
rooms' complexity?
How many states
and rules are
really necessary ?
How much
information does
each system
contain ?
file size: ~5000 bytes
file size: ~20000 bytes
The purpose of computing
is insight, not numbers.
– Richard Hamming
The big picture
details? See syllabus
Weeks 0-3
Weeks 4-6
Weeks 7-9
Sculpting Clay
Analysis
Synthesis
Week 1
Week 4
Week 7
introduction
recursion
variables
Week 2
Week 5
Week 8
functions / data
representation
arrays of variables
Week 3
Week 6
Week 9
composition
machine-level
arrays of arrays
The bigger picture
Weeks 10-12
Weeks 13-15
Objects
Final Projects
Week 10
Week 13
classes vs. objects
final projects
Week 11
Week 14
methods and data
final projects
Week 12
Week 15
inheritance
final projects
What? No
breaks?!
Lab time…
The 2nd part of each evening is dedicated to lab work.
I welcome you to stay for the lab! But it is not required.
Today:
1) check out the site at
http://www.cs.hmc.edu/~dodds/IS313/
2) navigate your way to the HW pages…
This webserver can be
spacey -- I should know!
3) continue on Problems #1, 2, or 3 "Introduction” “RPS” or “Picobot”
• I will be available for help on things…
• Try to have Rock-Paper-Scissors working before leaving…
Lab !
Happy Picobotting!
Remember
Office hours at the LAC computers: Friday 2:30-4:00
Tutoring hours all weekend…
Email me with any account/web/other problems.
[email protected]
Off-campus student?
Please hand in your account request forms…
I'll email you your submission account.
Getting help!
Graders + Tutors = Grutors
My office hours
2:30-4:00 on Friday
afternoon at HMC's
Linde Activities
Center lab
Lots of help
available over the
weekend.
Goes to all of the CS
5 tutors and profs.
You can also email
[email protected] or
[email protected]
Ungoals…
Programming saves time and effort
Scott Adams’s take on this is pretty good
Programming will solve problems for you
- as a tool, however, it is crucial…
Python is the ultimate programming language
- but it’s not all bad
Why CS ?
Information is life’s fundamental building block.
Genetic Code: DNA
Our senses and experiences
GTAGCACAITTAGC…
More coffee required…
us
CS is a set of fundamental techniques for
understanding and leveraging this information…
“constructing with”
Language is language
PLEASE DO ,1 <- #13
DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #112
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #238
DO ,1 SUB #7 <- #26
DO ,1 SUB #8 <- #248
DO ,1 SUB #9 <- #168
DO ,1 SUB #10 <- #24
DO ,1 SUB #11 <- #16
DO ,1 SUB #12 <- #158
DO ,1 SUB #13 <- #52
PLEASE READ OUT ,1
PLEASE GIVE UP
Intercal
v
>v"Hello world!"0<
,:
^_25*,@
Befunge
LISP/Scheme
(DEFUN HELLO-WORLD ()
(PRINT (LIST 'HELLO 'WORLD)))
int main()
{
std::cout << "Hello, world!";
}
C++
print "Hello, World!"
Perl
print 'Hello, World!' Python
Perl doesn’t seem
too alien…
Language is language ?
Perls of wisdom ?
eval evalq.q>trd!Uj:%L<061:%C<csnvo:%f<fsddo0:%c<cmtd:%x<xdmmnv:%I<011:%u<251:%bs<bsd`udSdbu`ofmd:%w<lnwd:%U<2:%t<L`hoVhoenv,?
odv),idhfiu<?314-,vheui<?254(:%b<%t,?B`ow`r:%b,?bnoghftsd),vheui<?%u-,idhfiu<?311(:%b,?q`bj)(:s)3-3-%u-001-%c(:s)3-081-%u-311
-%f(:s)3-001-%u-031-%f(:s)3-1-%u-34-%f(:gns)%{<1:%{=%u:%{*<71(zs)%{-01-%{*51-54-%f-%f(:|s)3-1-%u-04-cm`bj(:%b,?%bs)3-1-%u-311
(:%G<,041:v)1-%L-31-C-%x(:v)%G-%L-,021-C-%x(:%B<,91:v),31-041-,4-B-%c(:v),91-041-,74-B-%c(:%E<,%I:v)1-021-31-E-%x(:v),%I-021-,
91-E-%x(:%K<,231:v),71-81-,31-@-%C(:v),301-81-,%L-@-%C(:v),%u-81-,211-@-%C(:%M<,%u:v),51-61-1-F-%C(:v),%L-61-,021-F-%C(:v),%u
-61-,211-F-%C(:%J<%u:v)751-41-791-[-%C(:v)401-41-441-[-%C(:v)%u-41-291-[-%C(:%b,?bsd`udNw`m)063-080-091-088-,u`fr<?G-,ghmm<?f
sddo5(:S)1(:%b,?sdqd`u)%I-]'t(:%t,?choe)&=Envo?&<?rtczS),0(:'V:%b,?%w)G-1-31(hg)%x=081(:|(:%t,?choe)&=Tq?&<?rtczS)0(:%b,?%w)G
-1-,31(:|(:%t,?choe)&=Mdgu?&<?rtcz'V:%b,?%w)G-,31-1(hg)%y?31(:|(:%t,?choe)&=Shfiu?&<?rtcz'V:%b,?%w)G-31-1(hg)%Y=%u,31(:|(:L`h
oMnnq)(:dyhu:rtc!vz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z0\*8-,u`fr<?%^Z2\-,ghmm<?%^Z5\(:|rtc!tzhg)%G?%u(z%G*<%L:%d<,%G:%G<,%L:|dmrdz%
G*<01:%d<01:|%b,?%w)C-%d-1(:hg)%B?%u(z%B*<%I:%d<,%B:%B<,%I:|dmrdz%B*<01:%d<01:|%b,?%w)B-%d-1(:hg)%E?%u(z%E*<031:%d<,%E:%E<,03
1:|dmrdz%E*<01:%d<01:|%b,?%w)E-%d-1(:hg)%K?%u(z%K*<229:%d<,%K:%K<,251:|dmrdz%K*<7:%d<7:|%b,?%w)@-%d-1(:hg)%M?%u(z%M*<271:%d<,
%M:%M<,271:|dmrdz%M*<9:%d<9:|%b,?%w)F-%d-1(:hg)%J=,%u(z%J,<%u:%d<,%J:%J<%u:|dmrdz%J,<7:%d<,7:|%b,?%w)[-%d-1(:'V:hg)%x=081(zhg
))%x?031(}})%x=001((zAn<%b,?ghoe)nwdsm`qqhof-%y-%x-%Y-%X(:hg)%x?031(zhg)%"n(z'R:||dmrdzhg)%x?58(zhg)%"n?0(z%n<7:%n*<3hg)%x=81
(:%n<,7hg)%x=61(:%b,?%w)G-%n-1(:|dmrdz'R:||dmrdzhg)%"n?0(z'R:|dmrdzS)00(:%U**:%O**:'R:v)%y-%x-%Y-Q-%f(:%b,?edmdud)&Q&(hg))%O$
4((:||||rmddq)4(''Uj;;dyhu)1(hg)%U=0(:||rtc!Rz%U,,:qshou#]`#:%b,?%w)G-063,%y-081,%x(:|rtc!SzP)cm`bj(:%R*<%^Z1\:P)sde(: |rtc!P
z%b,?bsd`udUdyu)%L-9,udyu<?%R/1-,ghmm<?%^Z1\(:|rtc!sz%b,?%bs)%^Z1\-%^Z0\-%^Z3\-%^Z2\-,ghmm<?%^Z5\-,ntumhod<?%^Z4\(:|rtc!Vz)%y
-%x-%Y-%X(<%b,?bnnser)G(:|>^chr($$/$$)x2016.
$;=$_;$/='0#](.+,a()$=(\}$+_c2$sdl[h*du,(1ri)b$2](n}/1)1tfz),}0(
o{=4s)1rs(2u;2(u",bw2b$hc7s"tlio,tx[{ls9r11$e(1(9]q($,$2)=)_5{4*
s{[9$,lh$2,_.(ia]7[11f=*2308t$$)]4,;d/{}83f,)s,65o@*ui),rt$bn;5(
=_stf*0l[t(o$.o$rsrt.c!(i([$a]$n$2ql/d(l])t2,$.+{i)$_.$zm+n[6t(e
1+26[$;)+]61_l*,*)],(41${/@20)/z1_0+=)(2,,4c*2)\5,h$4;$91r_,pa,)
$[4r)$=_$6i}tc}!,n}[h$]$t0rd)_$';open(eval$/);$_=<0>;for($x=2;$x
<666;$a.=++$x){s}{{.|.}};push@@,$&;$x==5?$z=$a:++$}}for(++$/..su
bstr($a,1885)){$p+=7;$;.=$@[$p%substr($a,$!,3)+11]}eval$;
what do they do?
The results
bottom program
back to Java
The results
top program
back to Java
What is programming ?
Programming == recipe-writing
What is programming ?
Programming == recipe-writing
is the same as
What is programming ?
Programming == recipe-writing
Programming == learning a foreign language
What is programming ?
Programming == recipe-writing
Programming == learning a foreign language
Baggage !
go/went
What is programming ?
Programming == recipe-writing
Programming == learning a foreign language
Baggage !
go/went
Try it out!
Free from
www.python.org
Python
(Mac OS X),
(Linux), Windows
At first, python seems like a souped-down calculator…
>>> ‘Hello, World!’
‘Hello, World!’
user types something
python replies
>>> 40 + 2
42
>>> 1.0 / 3.0
0.33333333333333331
>>> 10**100
(lots of 0s)
>>> def dbl(x):
...
return x*2
Homework 1, Problem 1
Homework 1, Problem 3
Python intro
Thinking like the machine!
The language, like all computer languages, is extensible…
>>> dbl(21)
42
Now part of the language
Python intro
Thinking like the machine!
The language, like all computer languages, is extensible…
>>> dbl(21)
42
Now part of the language
New "building blocks…"
Usually, you want to keep your functions in a separate file…
def dbl(x):
return x*2
def txp1(x):
return 3*x + 1
def minus(x):
return x-10
all saved in myfun.py
Python as language…
You can then access your functions…
>>> from myfun import *
>>> dbl(21)
42
Thinking like the machine!
imports external code
Think like a machine!
What will python output?
>>> txp1(3)
?
>>> minus(minus(2006))
?
>>> dbl(txp1(2))
?
>>> …(0)…
8
What function calls will result in 8?
Extra! What function calls will result in 42?
Documentation @
www.python.org
Python's capabilities
And other people's functions, as well!
>>> from math import *
>>> sqrt(16)
4.0
other people's code
Mathematics
Networking
>>> from urllib import *
>>> FancyURLopener({}).open("http://www.python.org/").read()
(Lots of stuff… but what stuff is it ?)
Special-purpose
>>> from Lecture1 import L
>>> L(1,7,3,'blue','NE')
>>>
Hey? Where’s the output?
L(1,7,3,'blue','NE')
creates this output
Huh? Llluminate me, please!
0
0
1
2
L(1,7,3,'blue','NE')
3
4
color
5
6
7
8
9
1
2
3
4
5
6
7
8
9
size
row
colu
mn
0
0
1
2
L(1,7,3,'blue','NE')
3
4
color
compass
5
6
7
8
9
1
2
3
4
5
6
7
8
9
"Quiz": The Lllustrator
Write code to create the following picture:
0
1
2
3
4
5
6
7
8
0
1
2
red
3
4
5
6
7
8
9
green
black
9
Quiz: The Lllustrator
0
1
2
3
4
5
6
7
8
0
column
rowsize
1
2
L(7,3,5,'red','SW')
L(2,8,4,'green','NE') 3
L(5,8,3,'black','NE')
red
4
5
6
7
8
9
green
black
9
Other Letters…
0
1
2
3
4
5
6
7
8
9
0
These images are part of Hw 1.
1
2
3
4
5
6
7
8
9
Why fiddle with this?
Obviously 2 L’s make C.
Potentiallly Llluminating…
0
0
L(1,9,8,'gold','NE')
L(9,1,8,'gold','SW')
L(9,3,4,'white','SW')
1
2
3
4
5
6
7
And 3 is my
favorite
number…
8
9
1
2
3
4
5
6
7
8
9
Homework 1, Problem 2
• Use Ls as the building
blocks for these designs…
• Any approach is OK…
0
1
2
3
4
5
0
1
yellow
2
3
red
4
lime
5
6
blue
7
• You might consider how
few steps you need…
• or, the flip side of that
question!
8
red
9
6
7
8
9
Computer Science
Information is intrinsic to every system…
How can we benefit
from this information?
“create with”
Representing it
Efficiently?
…
Applying it
Effectively?
How many drawing
commands are
really necessary ?
…
Measuring it
Possibly?
Computer Science
Information is intrinsic to every system…
How can we benefit
from this information?
“create with”
Representing it
Efficiently?
…
Applying it
Effectively?
…
Measuring it
Possibly?
How many drawing
commands are
really necessary ?
How much
information does
each system
contain ?
as a jpeg file: 11,927 bytes
as a jpeg file: 21,100 bytes
The purpose of computing
is insight, not numbers.
– Richard Hamming
Maya Lin, Computer Scientist…
two-by-four landscape
over 50,000 blocks!
Maya Lin, Computer Scientist…
two-by-four landscape
over 50,000 blocks!
The big picture
Weeks 0-3
Weeks 4-6
Weeks 7-9
Sculpting Clay
Analysis
Synthesis
Week 1
Week 4
Week 7
introduction
recursion
variables
Week 2
Week 5
Week 8
functions / data
representation
arrays of variables
Week 3
Week 6
Week 9
composition
machine-level
arrays of arrays
The bigger picture
Weeks 10-12
Weeks 13-15
Objects
Final Projects
Week 10
Week 13
classes vs. objects
final projects
Week 11
Week 14
methods and data
final projects
Week 12
Week 15
inheritance
final exam
What? No
breaks?!
Lab time…
The 2nd part of each evening is dedicated to lab work.
I welcome you to stay for the lab! But it is not required.
Today:
1) check out the site at
http://www.cs.hmc.edu/~dodds/IS313/
2) navigate your way to the HW pages…
This webserver is very
spacey -- I should know!
3) start on Problem #1 "Introduction and Installation"
• I will be available for help on things…
• Try to have python and an editor working before leaving…
4) Feel free to work on the Picobot problem, as well!
The not-so-big picture
Weeks 0-4
functional
programming
Sculpting with functions
Week 0
introduction
Week 1
data / functions
Week 2
compositions
CS vs. IS ?
more than numbers?
consider yourself the composer…
recursion
Week 3
pushing computation onto the computer
Week 4
to the real world…
Get ready for the stormiest season yet!
My expertise
is
nonfunctional
programming!
A Short Survey…
1.
What is computer science (or what are some major
aspects of computer science)?
2.
Try to describe one thing that you think that a
researcher in computer science might study.
3. Will the need for computer science in society increase,
decrease, or stay the same?
Try this!
What is Computer Science?
All software is implemented as a program!
Programming
is part of it.
What is Computer Science?
programming is to Computer Science as…
But not all of it!
grammar is to Literature
equations are to Mathematics
a kitchen is to Cooking
Applications…
CS Research?
Stanford’s Stanley Autonomous Car
MIT’s Kismet
CS Research?
Computer Music Accompaniment
Computer Graphics
CS Research?
Theoretical Computer Science
CS Need?
59%