Download presentation
Presentation is loading. Please wait.
Published byAmanda Clark Modified over 9 years ago
1
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 words to describe this class. - New York Times Review of Courses - US News and Course Report We give this course two thumbs! - Ebert and Roeper 3 handouts… slides - syllabus - honesty policy
2
About us… Chris StoneZach Dodds dodds@cs.hmc.edustone@cs.hmc.edu Olin 1251 Office Olin 1255 Email fan of low-tech games Slovenia?! fan of low-level AI alternating in CS5 Scotland!?
3
Take-home message… http://www.cs.hmc.edu/twiki/bin/view/CS5/ depending on where "home" is, perhaps… Links to EVERYTHING!
4
CS 5 Sections About Gold and Black sections… Everyone has been placed based only on past experience, not ability. Gold is for students new to CS, Black for students with previous CS experience, such as the AP. Most CS majors enter CS 5 without previous experience Tradeoff: more careful coverage vs. a few more applications Both Gold and Black sections will prepare you well for CS 60 Future computational work A happy and fulfilling life :-) official alien of the CS 5 Gold section official mascot of the CS 5 Black section and the Green section is officially Bio/CS 6 Switch?
5
Today in CS 5 What is CS? How does CS 5 run? A little bit about Python… What will the course cover? This week's homework This week's homework is a-MAZE-ing! HELP!
6
1.In a sentence or so, what is computer science? Or, what are some major aspects of CS? 2.Try to describe one thing that you think that a researcher in computer science might study. What is CS? "Quiz" CS? Hmmm… Name: Credit Suisse? Counter-Strike C 10 H 5 ClN 2 : CS gas CompuServe Computer Science Cultural Survival Extra moment? Read over the honesty policy & hand it in, too…
7
CS != programming programming : CS ::
8
"not equal to" CS != programming
9
programming : CS :: machining : engineering unicycles : HMC grammar : literature equations : mathematics a vehicle, not a destination Programming CS CS != programming
10
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 ? "equal to"
11
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
12
Study of complexity How can it be done? How well can it be done? Can it be done at all? "Make3d" What information is being transformed here?
13
What Google thinks we look like "Chris Stone" "Zach Dodds" First Google Image hit (8/30/09) for a search of
14
What Google thinks we look like "Chris Stone" "Zach Dodds" First Google Image hit (8/30/09) for a search of Images are difficult!
15
What Google thinks we look like "Chris Stone" "Zach Dodds" Images are difficult! First Google Image hit (8/30/09) for a search of
16
Information Study of complexity How can it be done? How well can it be done? Can it be done at all? The N-body problem: lots of interactions! What information is being tracked here? Hubble photo: galaxies colliding Protein folding!
17
HW problem 0: Reading & Research about CS's future…
18
HW problem 0: Reading & Research about your future!? 4:15 pm this Thursday: Convocation (here) 5:30 pm this Th., 9/3/09: Summer Research Posters @ LAC Writeups: Brief, thoughtful responses… hw0pr0.txt
19
Why CS ? Information is life’s fundamental building block. CS is a set of fundamental techniques for understanding and leveraging this information… Genetic Code: DNAOur senses and experiences GTAGCACAITTAGC… More coffee required… us “constructing with”
20
Whatever you are, be a good one. - Abraham Lincoln
21
… CS will help! Whatever you are, be a good one. - Abraham Lincoln
22
Why CS 5 ? A broad look across computer science 1 2 3 4 5 recursion simulation design
23
What is programming ? Baggage ! 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
24
The foreign language of python… Homework 0, problem 1 hw0pr1.py name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Zach': # is it Zach? print 'Sorry - I\'m "offline." Try later.' elif name == 'Chris': # is it Chris? print "But you're in Slovenia!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!"
25
Python and IDLE: Use them at home! Editor window: code Shell window: running code Here, you can try things out at the command prompt >>> Here, you can save and change programs. Hitting F5 runs your program over in the shell
26
The foreign language of python… syntax?semantics?intent? How it looksWhat it doesWhat it should do name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Zach': # is it Zach? print 'Sorry - I\'m "offline." Try later.' elif name == 'Chris': # is it Chris? print "But you're in Slovenia!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!"
27
What about me? 'Zach' 'Chris' Zach Chris
28
The foreign language of python… syntax?semantics?intent? How it looksWhat it doesWhat it should do Syntax www.theonion.com how punctuation is used the language keywords that are used use of whitespace peculiarities of formatting how behavior is affected … How Python looks!
29
How Python looks… name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Zach': # is it Zach? print 'Sorry - I\'m "offline." Try later.' elif name == 'Chris': # is it Chris? print "But you're in Slovenia!" else: # in all other cases... print 'Welcome', name, '!' my_choice = random.choice( [ 'R','P','S' ] ) print 'My favorite object is', my_choice, "!" Look at the live code…
30
Hw 0, Problem 2 syntax?semantics?intent? How it looksWhat it doesWhat it should do Save hw0pr1.py under a new name, hw0pr2.py Change hw0pr2.py to play rock-paper-scissors. Feel free to add to the dialog, if you wish… It does not have to play fair! Submit your hw0pr2.py in the usual way. CS 5 course details?
31
The soundbite syllabus! HW Lectures Office Hours MW or TTh: 1:15-2:30 pm Sunday nights: due by 11:59 pm Insight into the HW problems (what, why, how) feel free to work on HW or just stop by Th and F: 3:00-4:30 pm (or any time!) Key skills, topics, and their motivation Required! Let us know if you won’t make it any time – or contact me by email Lab Guided work on the material M or T: 2:45 - 4:45 pm or 6:30 - 8:30 pm Will SAVE you time and effort in CS 5! Not required, but strongly encouraged… and recommended by 4 out of 5 HMC sophomores! TUTORING HOURS START FRIDAY HOMEWORK 0 IS DUE THIS SUNDAY! Come to Labs! Come to Lectures!
32
Syllabus, briefly HW Lectures Office Hours MW or TTh: 1:15-2:30 pm Sunday nights: due by 11:59 pm Insight into the HW problems (what, why, how) feel free to work on HW or just stop by F: 2:00-4:00 pm, CS labs (or any time!) Key skills, topics, and their motivation We’d like to see you! Let us know if you’ll be sick… any time – or contact me by email Lab Guided work on the material M or T: 2:45 - 4:45 pm or 6:00 - 8:00 pm Will SAVE you time and effort in CS 5! Not required, but strongly encouraged… and recommended by 4 out of 5 HMC sophomores!
33
Grading Note! Grades Exams Based on points percentage if perc >=.95: grade = 'A' elif perc >=.90: grade = 'A-' elif perc >=.70: grade = 'C' see online syllabus for the full grade list... Midterm 1 October 7-8100 points 200 points ~ 70% Assignments ~ 6% Participation/“quizzes” ~ 24% Exams (page of notes OK) Final December 14-18 Pass Midterm 2 November 16-17100 points To pass CS 5, you must have a passing grade on each of the three individual components of the course (exams, HW, and participation/“quizzes”). Failing one component results in failing CS 5, even with a passing total score. Don’t sleep through the exam!
34
Homework Assignments ~ 5 problems/week ~ 100 points extra credit available Due Sunday evening - by 11:59 pm. You have 3 CS 5 Euros to use… Collaborate! Some problems are specified “individual-only.” Others offer the option of working in a pair. You don’t have to You must share the work equally - typing and coaching You should make ONLY ONE submission for both of you Be sure to indicate who your partner was at the submission site! Honor Code You may want to email your partner the code, too. "Late Days"
35
Honor Code You are encouraged to discuss problems with other students – or tutors - or any instructors. You may not share written, electronic or verbal solutions with other students (present or past): No internet or other copying of files except those provided by the course material. No transcribing of programs from paper, whiteboards, blackboards, or other media. You will have the option of working in pairs for MANY of each week’s problems: the same guidelines apply for each pair. Read over the syllabus and honesty policy – sign & submit by lab next week!
36
Software and Website Web Page: http://www.cs.hmc.edu/twiki/bin/view/CS5 Programs: Python and IDLE open-source, free from www.python.org or, google for "HMC CS" - click "Class Schedule" - click "CS 5" This site is the key to all CS 5 happiness! installation instructions on the CS 5 website Grab Python-wrangling picture from CS6…
37
get the next HW or the slides details next lab and assignment place to submit default submission password: asdf Picobot book! Please do not distribute…
38
Why Python ? Python is a general-purpose computer language
39
Why Python ? Python is a general-purpose computer language Physics: LabView Biology: Lasergene, DNA* Engineering: Matlab Mathematics: Maple, Mathematica skills apply to all special-purpose languages ALL with different idiosyncrasies! What about CHEM!?
40
Language is language int main() { std::cout << "Hello, world!"; } 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 v >v"Hello world!"0<,: ^_25*,@ (DEFUN HELLO-WORLD () (PRINT (LIST 'HELLO 'WORLD))) print "Hello, World!"; Perl C++ LISP/Scheme Befunge Intercal Python Perl doesn’t seem too alien… print 'Hello, World!'
41
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(:|(:%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-%x-%Y-%X( ^chr($$/$$)x2016. Perl might be a little bit TOO flexible a language! Goal: expression, not language details.
42
The results back to Python
43
Picobot area already covered area not covered (yet!) inspiration? walls Goal: whole-environment coverage with only local sensing … Picobot as envisioned by an HMC clinic HW problems 3 and 4
44
inspiration! Picobot area already covered area not covered (yet!) walls Goal: whole-environment coverage with only local sensing … iRobot's Roomba vacuum
45
Surroundings Picobot can only sense things directly to the N, E, W, and S For example, here its surroundings are NxWxNxWx N E W S N E W S Surroundings are always in NEWS order.
46
How many distinct surroundings are there? N E W S Surroundings
47
How many distinct surroundings are there? N E W S xxxxNxxxxExxxxWxxxxSNExxNxWxNxxS xEWxxExSxxWSNEWxNExSNxWSxEWSNEWS (won’t happen) == 16 possible … 2424 Surroundings
48
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.
49
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.
50
Wildcards Asterisks * are wild cards. They match walls or empty space: 0 x*** 0N statesurroundingsdirectionnew state and EWS may be wall or empty space I am in state 0. My surroundings are xxWS. Aha! This matches x*** N must be empty
51
What will this set of rules do to Picobot? 0 x*** 0N 0 N*** 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. -> how can we get back down the screen?
52
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. ->
53
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
54
Alter these "up & down" rules so that Picobot will traverse the empty room… "Quiz" #2 the empty room
55
Ideas for the maze? the maze
56
Computer Science Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with”
57
Computer Science Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it How to measure these rooms' complexity? “create with”
58
Computer Science our best: 4 states, 8 rulesour best: 3 states, 7 rules How many states and rules are really necessary ? How much information does each system contain ? Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with” How to measure these rooms' complexity?
59
Computer Science This image: 20 kilobytes!This image: 5 kilobytes How many states and rules are really necessary ? How much information does each system contain ? Information is intrinsic to every system… How can we benefit from this information? Efficiently? Effectively? Possibly? Representing it … Applying it … Measuring it “create with” How to measure these rooms' complexity?
60
Happy Picobotting! Remember Office hours at the CS labs: Friday 2:00-4:00 Tutoring hours all weekend in LAC lab & CS labs… Email me with any account/web/other problems. dodds@cs.hmc.edu
62
Getting help! Graders + Tutors = Grutors You can email cs5help@cs.hmc.edu Goes to all of the CS 5 tutors and profs. My office hours 1:30-4:30 on Friday afternoons in the CS labs: Beckman B105 Lots of help available over the weekend. New graders will begin on Friday… LAC lab!
63
Getting started… Login with one partner's password Change your password so you can remember it! Open a browser Problem-solving, not memorization Partner with someone for this task! Go to www.cs.hmc.edu/~cs5grad/ When finished, submit, logout, and switch partners Have the other partner lead… Choose the Picobot link Login with the submission password asdf You can change your submission password, too. Go to the upper-left apple … System Prefs … Accounts
64
name = raw_input('Hi... what is your name? ') print # prints a blank line if name == 'Geoff': # is it Geoff? print name, '??' print 'Didn\'t I tell you to _stay_ gone?!' elif name == 'Zach': # is it Zach? print 'Aaaaaaaaaah!' else: # in all other cases... print 'Welcome to Python,', name, '!'
65
The results bottom program back to Java
66
Is there a Need for Computer Science? 59%
67
CS: A Broad Discipline Objective: Describe the “big questions” in computer science What does it mean to compute? Can a computer be intelligent? Is there anything a computer can’t do? How does a programming style influence the solution?
68
CS: A Broad Discipline Objective: Describe the relationship between sub-disciplines in CS Functional Imperative Assembly Language Programming Paradigms Digital Logic HMMM Assembly Language Programming Computer Architecture Finite State Machines Turing Machines Big-O running time Theoretical CS And this is just a start!
69
Information Study of complexity How can it be done? How well can it be done? Can it be done at all? Protein Folding 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." Information: sequence and pose of amino acids
70
CS Research ? Theoretical computer science self-balancing data structures - speeding access to data… Polygon unfolding '06: any polygon can be smoothly made convex without changing its side lengths
71
CS Research ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.