Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.

Slides:



Advertisements
Similar presentations
Introduction to Programming
Advertisements

Heuristic Search techniques
ACM Programming Team Bill Punch. ACM Programming Contest One of the premier programming competitions. Held every year since 1977 MSU was the winner that.
CS 206 Introduction to Computer Science II 02 / 27 / 2009 Instructor: Michael Eckmann.
Intro to CIT 594
Best-First Search: Agendas
Jotto! SophsJrsSrs audio 1audio 2audio 1 Frosh audio 2 graze 3graze 1 graze 2 alloy 1 alloy 2 fresh 2fresh 1fresh 2fresh 1 This term's first class to guess.
CS 106 Introduction to Computer Science I 11 / 09 / 2007 Instructor: Michael Eckmann.
22-Jun-15 Labs, etc.. 2 Extra sessions Some of you are really new to computer programming, other have considerable experience I will have an extra weekly.
CS 206 Introduction to Computer Science II 10 / 08 / 2008 Instructor: Michael Eckmann.
Please open your laptops, log in to the MyMathLab course web site, and open Daily Quiz 18. You will have 10 minutes for today’s quiz. The second problem.
Introduction to Programming Environments for Secondary Education CS 1140 Dr. Ben Schafer Department of Computer Science.
Introduction to Programming (in C++) Introduction Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
Welcome to Programming Practicum You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting knuth (or turing or…)
Welcome to CS 115! Introduction to Programming. Class URL Please write this down!
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.
Introduction CSE 1310 – Introduction to Computers and Programming
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
COMP 111 Programming Languages 1 First Day. Course COMP111 Dr. Abdul-Hameed Assawadi Office: Room AS15 – No. 2 Tel: Ext. ??
Our School population of 213 students range from Preschool to Grade 12.
C OMPUTER S CIENCE G EMS 5 Challenging Projects. P ROJECT 1: M ASTERMIND Summary: A code breaking game 12 guesses Feedback is # correct and # correct.
Chapter Eight Academic Survival Skills. Study Skills  For most students time is the greatest issue.  The first rule to follow is to allow two or three.
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 9, 2015)
Chapter An Introduction to Problem Solving 1 1 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
Week 4. Due for this week…  Homework 4 (on MyMathLab – via the Materials Link)  Monday night at 6pm.  Prepare for the final (available tonight 10pm.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
By the end of this session you should be able to...
Welcome to CS 115! Introduction to Programming. Class URL Write this down!
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports Lecture clinic liaison phone call coding chunky strings.
Curricularizing the ACM... ? Zach Dodds ~ November 13, 2010.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
ACM today Some nice unix commands… practice problems? code.google.com/codejam/ This week: beyond Floyd-Warshall.
ACM today This week's problems… New and improved :-) ACM table slacking! not slacking… missing entries? let me know…
Coming Up: Today: Review Quiz 2 Lecture on Section 2.4: Word problems! NOTE: This homework is due at the beginning of the next class session. Coming up.
HOW TO STUDY??? STUDY HABITS Who needs them? We all do. Everyone has deadlines to assignments. No matter how much we like or dislike a subject we are working.
ACM reminders October HMC Mock contest 9: :30 November regional contest This is the next ACM meeting !! Contest-like problems dynamic.
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
WELCOME to CS244 Brent M. Dingle, Ph.D Game Design and Development Program Mathematics, Statistics and Computer Science University of Wisconsin -
Intro to CIT 594
Reactive and Output-Only HKOI Training Team 2006 Liu Chi Man (cx) 11 Feb 2006.
Compsci 101.2, Fall Plan for FWON l Review current assignments and APTs  Review Dictionaries and how to use them  Code and APT walk-through.
CS1101: Programming Methodology Preparing for Practical Exam (PE)
Summary CGS 3460, Lecture 43 April 26, 2006 Hen-I Yang.
CS 3343: Analysis of Algorithms Lecture 19: Introduction to Greedy Algorithms.
David Evans Class 15: P vs. NP (Smiley Puzzles and Curing Cancer) CS150: Computer Science University of Virginia Computer.
Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting.
LECTURE 02: EVALUATING MODELS January 27, 2016 SDS 293 Machine Learning.
Efficiently Solving Computer Programming Problems Doncho Minkov Telerik Corporation Technical Trainer.
Copyright © 2014 Curt Hill Algorithms From the Mathematical Perspective.
Amortized Analysis and Heaps Intro David Kauchak cs302 Spring 2013.
Coming Up: Today: Review Quiz 2 Lecture on Section 2.4: Word problems! NOTE: This homework is due at the beginning of the next class session. Coming up.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
St Peter’s CofE Primary School
Spring 2008 Mark Fontenot CSE 1341 – Honors Principles of Computer Science I Note Set 1 1.
Multiple Sequence Alignment with PASTA Michael Nute Austin, TX June 17, 2016.
Welcome to CS 115! Introduction to Programming Spring 2016.
Part III – Gathering Data
CMPT 409 – Competitive Programming (Spring 2018)
Choice of Programming Language
Welcome to CS 1010! Algorithmic Problem Solving.
Problem Solving: Brute Force Approaches
Fundamentals of Data Representation
ACM today… ! DP for NP! DP for APSP! Knapsack Floyd-Warshall
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Amortized Analysis and Heaps Intro
CMSC201 Computer Science I for Majors Lecture 12 – Program Design
Presentation transcript:

Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting knuth (or turing or…) installing Debian 3.1 the dumpster University of St. Petersburg On the 405, in traffic, being chased by police (and TV) helicopters. Mailing something at the Claremont Post Office Waiting for the snow enveloping you on Route 5 N to melt Krispy Kreme’s drive-through Teaching Honors English for Janice Barbee at Pomona High School Worldcom Headquarters Leading a Gray Davis / Gary Coleman / Arnold “T-800” Schwarzenegger gubernatorial fundraiser exploring martian soil Being dragged off-course 18 miles into a marathon race by a crazed spectator Massey University Palmerston North, NZ Pittsburgh Driving N on the Dalton Highway… (though it feels like it!) Victorville, for DARPA's Urban Granc Challenge Waiting in line to vote in the Florida primaries… Denver, CO or Minneapolis, MN DC for the inauguration On fire just W of here!! Harbin!

Introductions! Zach Dodds Office Olin fan of low-tech games fan of low-level AI

Fall '09 Jotto: tied for the longest game yet… SophsJrsSrsOthers icily 0 icily 1 strep 2 strep 1 spork 1spork 3spork 0 spend 2 peeps 2peeps 1peeps 2peeps 1 furls 1 furls 0furls 1 Ghost 2Ghost 1 Ghost 0 Tanks 2Tanks 1Tanks 2Tanks 1 Gecko 2Gecko 1

What is this course about?

A chance to “improve” your programming skills Algorithm analysis and insight Program design and implementation optimizing coding time, not running time ACM programming contest What Why Research/prototype programming Hands-on practice with algorithms and techniques Unofficial course name: CS -70 Familiarity with Java’s libraries OR your choice of language "reasonable"

Last year's ACM regional contest

Ice festival!

in the ice!

Class Organization alternating format discussion sessions lab sessions problem and program analysis discussion of strategy and coding tips deciding on functional decomposition, data structures, language facilities, and algorithms to use in teams of 2-3 teams may use 1 machine per person (only the mock contest adheres to ACM rules) these problems count for each member of the group sometimes new problems, other times with known ones 3~ 4 problems given out per week… a team might want to practice with only 1 machine

Class Organization Feedback from prior semesters… make individual vs. team-based work clear, lectures vs. labs problems are, in general, individually completed -- except there should be an opportunity to start coding “cold” snacks and jotto! problems per person per week? about 1~2 (if you work on a team in lab) and consider all of the weeks of the term! those done during the lab "mock contest" sessions submit for each person ( me if there are problems…) provide the code to all team members you may or may not choose to work as a team afterwards better support for newcomers and for contest problems!!

Course Organization Jan 19 Welcome! ~ 4-5 problems Jan 26 Lab/Mock contest session: 4 problems Feb 2 No class meeting - trip to finals! Feb 9 Discussion session on geometry problems: 4 problems Feb 16 Lab/Mock contest session: 4 problems Feb 23 Discussion session on search and A*: 4 problems Mar 2 Lab/Mock contest session: 4 problems Mar 9 Discussion session on something you haven't seen! Mar 16 Spring break - no class Mar 30 Finale: mock ACM contest, 4:15pm – 8:15pm, 6 problems You may submit problems until the end of exams… Need a serious programming competition…? I may need help here…

Course webpage references administrative info problem statements and sample data problems you have solved

Grading CS 189 is graded individually... (it’s possible to take it P/F, too) Coding Guidelines problems can be done any time during the semester discussion of algorithms always OK coding should be within teams you may use any references except an existing solution or partial solution… one person should take the lead on each problem use /cs/ACM/acmSubmit to submit on knuth try things out ! the reason for ACM! though not for CS elective credit…

Problem credits Problems are worth double if You solve them during the 4:15 - 5:30 lab sessions It's one of the "extra difficult" problems, which may be determined as we go… Any standard language is OK -- but do keep in mind that the competition allows only Java, C, and C++. Other "standard" languages: the team gets credit, up to 3 people somewhat reasonable alternatives will also be considered… C#, Python, Ruby Language Choice? Problems are also worth double if they are written up for "the book."

A prior term's summary: languages python 82 java 60 C++ 40 Tallies per problem and per language… 17 (+2) 8416 (+2) 1 (+1) 6 (+1) 20 (+12) (+2) 3 (+1) (+1) 1 (+1) 17 (+9) (+2) 4 (+2) (+2) 13 (+10) 14 (+9) 121 (+16) (+4) 1115 (+14) number of 2x scores number of 4x scores d 8 ruby 6 scheme 3 lua 2 awk 2 js 2 sql cobol basic x86 asm pascal mathematica sh, latex 1 each

The "book" Overheard at last fall's contest… We will continue a multi-term effort to create an HMC "book" - need to be in Java or C++ (or C) a secret weapon? Problems contributed to the book are worth double, but - need to be beautifully formatted - need to be fully commented - need to be useful for people who did not write it! - variable names and other constructs ~ evident Sign up for a problem if you want to do this. (It's OK to work in a team of 2 or 3, as well.) - need a thorough introductory explanation…

Dynamic programming? Action!

Dynamic programming? practice contest…

Dynamic programming? Action!

Dynamic programming!

Excitement from the judges’ room

Dynamic programming When a seemingly intractable problem has lots of repeated substructure, go DP! Build a table of partial results. Replace computation with table look-up when possible and some of the others, too…

Dynamic programming the dollar dayz problem, for example: 5 3 The number of different combinations of items it is possible to purchase Input Amount of money that Farmer Ran has… 5 Output Ideas? Costs range from 1 up to this value how?

Dynamic programming the dollar dayz problem, for example: 5 3 The number of different combinations of items it is possible to purchase Input Amount of money that Farmer Ran has… 5 Output Ideas? Costs range from 1 up to this value

Dynamic programming the xoinc problem, for example: The highest total amount the first player can acquire (assuming the second player plays optimally) Input If the prev player took 1 coin, the next player can take 1 or 2. 9 Output Ideas? First player can take 1 or 2 coins from the top ? If the prev player took 2 coins, the next player can take 1 to 4 coins. If the prev player took N coins, the next player can take 1 to 2*N coins.

Jotto! SophsJrsSrsProfs A word-guessing game similar to mastermind… pluot 1pluot 0pluot 1pluot 2 Next Tuesday: Lab bring a laptop, if you have one… pluot 1pluot 0pluot 1pluot 2

Dynamic programming Build a table of partial results. Replace computation with table look-up when possible the binary-decimal problem, for example: Numbers, N, up to 10 6 Input 0 marks the end of the input the smallest decimal multiple of N with only the digits 0 and 1 ! Output Ideas? When a seemingly intractable problem has lots of repeated substructure, go DP!

One way… Count up to the solution, starting from 1… adding digits changes the error (remainder) in predictable ways insight: from CS 60!

Dynamic programming Storing intermediate results in a table for fast look-up: input N = 6 possible remainders upon dividing by N (6) # of digits in answer

input N = 6 possible remainders upon dividing by N (6) # of digits in answer Dynamic programming Storing intermediate results in a table for fast look-up:

input N = 6 possible remainders upon dividing by N (6) # of digits in answer Dynamic programming Storing intermediate results in a table for fast look-up:

input N = 6 possible remainders upon dividing by N (6) # of digits in answer Dynamic programming Storing intermediate results in a table for fast look-up:

input N = 6 possible remainders upon dividing by N (6) # of digits in answer Dynamic programming Storing intermediate results in a table for fast look-up:

DP! Only checking values for which a remainder has not yet been used… Fast

Problem Set #0 (3-4 problems) In teams of 2~3, read over these… I need a picture of Farmer Ran! Only students new to ACM may do this one for credit… 0-multiple, too!

Problem Set #0 (3-4 problems) In teams of 2~3, read over these & discuss: Where might the structure of the problem depend on similar (but smaller!) substructure? Think of your class's next 5-letter jotto word or guess… ! How might you build up a table of values toward an overall solution? How difficult are they? Which might be DP?

Another example binary-as-decimal problem "pebbles" problem (2007 ACM regionals) Square array, up to 15x15, of integers from 1 to 99 Input Output Idea place "pebbles" on integers, trying to maximize total, but no two pebbles may be adjacent… maximum possible sum 14? vertically, horizontally, or diagonally naïve running time?

Pebbles Square array, up to 15x15, of integers from 1 to 99 Input DP Idea consider all possibilities for pebbling each row - they only depend on the previous row's best scores! Subset chosen (pebbles) Row # abc Store the BEST score available for each possible subset.

Square array, up to 15x15, of integers from 1 to 99 Input DP Idea consider all possibilities for pebbling each row - they only depend on the previous row's best scores! Subset chosen (pebbles) Row # abc Store the BEST score available for each possible subset. 0 68x39xx Pebbles

Square array, up to 15x15, of integers from 1 to 99 Input DP Idea consider all possibilities for pebbling each row - they only depend on the previous row's best scores! Subset chosen (pebbles) Row # abc Store the BEST score available for each possible subset. 0 68x39xx xxx Pebbles

Square array, up to 15x15, of integers from 1 to 99 Input DP Idea consider all possibilities for pebbling each row - they only depend on the previous row's best scores! Subset chosen (pebbles) Row # abc Store the BEST score available for each possible subset. 0 68x39xx xxx xxx 0+13 c +13 b +9 a +9 ? running time? What is the best here? Pebbles

binary-as-decimal problem "pebbles" problem (2007 ACM regionals) Square array, up to 15x15, of integers from 1 to 99 Input Output Idea place "pebbles" on integers, trying to maximize total, but no two pebbles may be adjacent… maximum possible sum 572 code Pebbles

Thanks, Martijn! Scanner sc = new Scanner(System.in); even a bit easier! Martijn is shifty! Martijn is VERY shifty! Where is the table? This sure is sum code… to the max

Jotto! SophsJrsSrsMe A word-guessing game similar to mastermind… pluot 1pluot 0pluot 1pluot 2

Problem Set #1 (6 probs, 3 wks) Input 4 tow cat row care....#.....## 0 # of words in the puzzle (to follow) # of rows in the puzzle (after the words) the words the puzzle this indicates the end of the input…

Problem Set #1 (6 probs, 3 wks) Input 4 tow cat row care....#.....## 0 either the solution OR a statement that it can't be solved… Output Problem 1 cat a#o row e## Problem 2: no layout is possible.

Problem Set #1 (6 probs, 3 wks) Input # of empty boxes on the form # of clerks in the office (three lines each) clerk #0 this indicates the end of the input… the box(es) CHECKED the box(es) ERASED the clerks who get a copy clerk #1 clerk #2 clerk #3 clerk # the form

Problem Set #1 (6 probs, 3 wks) Input # of empty boxes on the form # of clerks in the office (three lines each) clerk #0 this indicates the end of the input… the box(es) CHECKED the box(es) ERASED the clerks who get a copy clerk #1 clerk #2 clerk #3 clerk # the form let's try it…

Problem Set #1 (6 probs, 3 wks) Input # of empty boxes on the form # of clerks in the office (three lines each) clerk #0 this indicates the end of the input… the box(es) CHECKED the box(es) ERASED the clerks who get a copy clerk #1 clerk #2 clerk #3 clerk # the form Output the boxes checked the last time it leaves clerk #0's desk…

Problem Set #1 (6 probs, 3 wks) Input RDDR Speedy M 0101 Jumper F 0101 Slowpoke M 1101 Terror F 1100 Shadow F 1001 *** Frisky 0101 Sleepy 1101 *** list of traits, R == "recessive" D == "dominant" D traits are passed if EITHER parent has them R traits are passed if BOTH parents have them all of the parents, gender, and traits the baby shrews… Deduce their possible parents!

Problem Set #1 (6 probs, 3 wks) Input RDDR Speedy M 0101 Jumper F 0101 Slowpoke M 1101 Terror F 1100 Shadow F 1001 *** Frisky 0101 Sleepy 1101 *** list of traits, R == "recessive" D == "dominant" D traits are passed if EITHER parent has them R traits are passed if BOTH parents have them all of the parents, gender, and traits the baby bunnies… Deduce their possible parents! Output Frisky by Jumper-Slowpoke or Jumper-Speedy or ______ Sleepy by _________

Problem Set #1 (6 probs, 3 wks) Input RDDR Speedy M 0101 Jumper F 0101 Slowpoke M 1101 Terror F 1100 Shadow F 1001 *** Frisky 0101 Sleepy 1101 *** list of traits, R == "recessive" D == "dominant" D traits are passed if EITHER parent has them R traits are passed if BOTH parents have them all of the parents, gender, and traits the baby bunnies… Deduce their possible parents! Output Frisky by Jumper-Slowpoke or Jumper-Speedy or Shadow-Speedy Sleepy by Shadow-Slowpoke

Problem Set #1 (6 probs, 3 wks) Decide which problem is the easiest and which one is the hardest … (to code, not to compute!) Read these three problems… then

Problem Set #1 (6 probs, 3 wks) my estimates… hardest easiest important heuristic: I’m always wrong

See you next Tuesday in the CS labs… !

Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting knuth (or turing or…) installing Debian 3.1 Engineering dept. the dumpster University of St. Petersburg On the 405, in traffic, being chased by police (and TV) helicopters. Mailing something at the Claremont Post Office Waiting for the snow enveloping you on Route 5 N to melt Krispy Kreme’s drive through Teaching Honors English for Janice Barbee at Pomona High School Worldcom Headquarters Leading a Gray Davis / Gary Coleman / Arnold “T-800” Schwarzenegger gubernatorial fundraiser exploring martian soil Being dragged off-course 18 miles into a marathon race by a crazed spectator Massey University Palmerston North, NZ Pittsburgh Driving N on the Dalton Highway… (though it feels like it!)

Excitement from the judges’ room

Backpacks not permitted…

What is this course about? A chance to “improve” your programming skills Algorithm analysis and insight Program design and implementation optimizing coding time ACM programming contest What Why Research/prototype programming Hands-on practice with algorithms and techniques Unofficial course name: CS -70 Familiarity with Java’s libraries OR your choice of language

Course Organization Jan 16 Welcome! Random teams of 3: 6 problems, 3 weeks Jan 23 Lab session to work on problems (Beckman B102 or 105) Jan 30 Discussion session on the first set of problems Feb 6 Lab session with new problems: 4 problems, 2 weeks Feb 13 Discussion session on the second set of problems Feb 20 Lab session with new problems: 6 problems, 3 weeks Feb 27 Discussion session on the third set of problems Mar 6 No class - Fall break Mar 20 Mock ACM contest, 9pm – 1am, teams of 3, 6 pr, 4 hours Mar 27 No class (out of town) Apr 3 Discussion session on the mock contest + Finale! You may submit problems until the end of exams… 2 per team 2/team 3 per team 1-4 / team

Class Organization alternating format discussion sessions lab sessions problem and program analysis discussion of strategy and coding tips deciding on functional decomposition, data structures, language facilities, and algorithms to use in teams of 2-3 teams should use 1 terminal per person (only the mock contest adheres to ACM rules) these problems count for each member of the group sometimes new problems, other times with known ones ~1 problem per week per person…

Course webpage reference links administrative info problem statements and test data problems your team has solved

Grading CS 189 is graded individually... (it’s possible to take it P/F, too) Coding Guidelines problems can be done any time during the semester discussion of algorithms always OK coding should be within teams you may use any references except an existing solution or partial solution… one person should take the lead on each problem use /cs/ACM/acmSubmit to submit try things out ! the reason for ACM!

Choose your language… extensive library of data structures and algorithms available Java is almost the universal choice for the competition… I/O made simpler with 1.5’s Scanner and printf the C in CS! Input from stdin Output to stdout

Choose your language… Python is niceC# Whatever language you choose needs to be able to run on the Macs in the CS labs (and preferably knuth, as well…) I’ll likely need your help to get things set up for testing… def floyd_warshall(W, infinity): n = matrix.get_num_rows(W) D = matrix.clone(W) DD = matrix.make(n,n) for k in xrange(n): for i in xrange(n): for j in xrange(n): DD[i][j] = min(D[i][j], D[i][k] + D[k][j]) DD, D = D, DD return D Others ? Marty: prolog!

Problem Set #1 (6 probs, 3 wks) Input 4 tow cat row care....#.....## 0 # of words in the puzzle (to follow) # of rows in the puzzle (after the words) the words the puzzle this indicates the end of the input…

Problem Set #1 (6 probs, 3 wks) Input # of empty boxes on the form # of clerks in the office (three lines each) clerk #0 this indicates the end of the input… the box(es) CHECKED the box(es) ERASED the clerks who get a copy clerk #1 clerk #2 clerk #3 clerk # the form Output the boxes checked the last time it leaves clerk #0's desk…

Problem Set #1 (6 probs, 3 wks) Input RDDR Speedy M 0101 Jumper F 0101 Slowpoke M 1101 Terror F 1100 Shadow F 1001 *** Frisky 0101 Sleepy 1101 *** list of traits, R == "recessive" D == "dominant" D traits are passed if EITHER parent has them R traits are passed if BOTH parents have them all of the parents, gender, and traits the baby shrews… Deduce their possible parents! Output Frisky by Jumper-Slowpoke or Jumper-Speedy or ______ Sleepy by _________

Problem Set #1 (6 probs, 3 wks) Decide which problem is the easiest and which one is the hardest … (to code, not to compute!) Read these three problems… then

Coaches’ Room

Choose your language… extensive library of data structures and algorithms available Java/Cthe universal choice for the competition… I/O made simpler with 1.5’s Scanner and printf the C in CS! Input from stdin Output to stdout

Choose your language… Python is nice def floyd_warshall(W, infinity): n = matrix.get_num_rows(W) D = matrix.clone(W) DD = matrix.make(n,n) for k in xrange(n): for i in xrange(n): for j in xrange(n): DD[i][j] = min(D[i][j], D[i][k] + D[k][j]) DD, D = D, DD return D Ruby :-) Marty: prolog! Postscript!

FroshSophsJrsSrsOthers pluto 0pluto 2pluto 3pluto 1 andes 1 andes 0andes 2andes 1 wired 1 wired 0 xenon 1 xenon 0 tenet 1tenet 0 tenet 3tenet 0 clack 2clack 1 clack 0clack 1 grime 1 grime 0 these 0these 1these 0these 4these 1 flour 0flour 2 flour 1 ACM Jotto finale: Fall '08 This set the record for the longest jotto game I've played at Mudd!

Welcome to Programming Practicum “Putting the C into CS” You aren’t here writing clinic reports clinic liaison phone call coding chunky strings rebooting knuth (or turing or…) installing Debian 3.1 Engineering dept. the dumpster University of St. Petersburg On the 405, in traffic, being chased by police (and TV) helicopters. Mailing something at the Claremont Post Office Waiting for the snow enveloping you on Route 5 N to melt Krispy Kreme’s drive-through Teaching Honors English for Janice Barbee at Pomona High School Worldcom Headquarters Leading a Gray Davis / Gary Coleman / Arnold “T-800” Schwarzenegger gubernatorial fundraiser exploring martian soil Being dragged off-course 18 miles into a marathon race by a crazed spectator Massey University Palmerston North, NZ Pittsburgh Driving N on the Dalton Highway… (though it feels like it!) Victorville, for DARPA's Urban Granc Challenge Waiting in line to vote in the Florida primaries…

What is this course about? A chance to “improve” your programming skills Algorithm analysis and insight Program design and implementation optimizing coding time ACM programming contest What Why Research/prototype programming Hands-on practice with algorithms and techniques Unofficial course name: CS -70 Familiarity with Java’s libraries OR your choice of language

Class Organization alternating format discussion sessions lab sessions problem and program analysis discussion of strategy and coding tips deciding on functional decomposition, data structures, language facilities, and algorithms to use in teams of 2-3 teams should use 1 machine per person (only the mock contest adheres to ACM rules) these problems count for each member of the group sometimes new problems, other times with known ones ~3 problems per week per person…

Class Organization Feedback from prior semesters… make individual vs. team-based work clear, lectures vs. labs problems are, in general, individually completed, except there should be an opportunity to start coding “cold” snacks and jotto! problems per person per week? ~2 in the fall ~3 in the spring those done during the lab "mock contest" sessions submit for each person (or me…) provide the code to all team members you may or may not choose to work as a team afterwards

Course Organization Jan 29 Welcome! Review of dynamic programming: 4 problems Feb 5 Lab/Mock contest session: 4 problems Feb 12 Discussion session on geometry problems: 4 problems Feb 19 Lab/Mock contest session: 4 problems Feb 26 Lab/Mock contest session: 4 problems Mar 4 Discussion session on search problems: 4 problems Mar 11 No class… need to be away Mar 18 No class - Spring break Mar 23 Mock ACM contest, 9pm – midnight, 6 problems Mar 25 Discussion and wrap-up of the semester You may submit problems until the end of exams… Sat. Mar 8 and Sat. Apr 19 external competitions…

Competition Options Sat. Mar 8 and Sat. Apr 19 external competitions…

Course webpage references administrative info problem statements and test data problems you have solved

Grading CS 189 is graded individually... (it’s possible to take it P/F, too) Coding Guidelines problems can be done any time during the semester discussion of algorithms always OK coding should be within teams you may use any references except an existing solution or partial solution… one person should take the lead on each problem use /cs/ACM/acmSubmit to submit try things out ! the reason for ACM!

Problem multipliers Problems are worth double if You solve them during the 4:15 - 5:30 lab sessions You are the first person to use a particular language - though there is an additional responsibility here: to set up the testing system to handle that language! It's one of the "extra difficult" problems, which will be determined as we go… languages already used: the team gets credit, up to 3 people python 56 ruby 12 java 6 c++ 11 perl 2 postscript 2 c# 8 haskell 1 prolog 2 c 5 php 1 These multipliers may be accumulated…

Dynamic programming When a seemingly intractable problem has large amounts of repeated or redundant substructure, DP can sometimes provide an efficient solution. Build a table of partial results. Replace computation with table look-up when possible For example: Numbers, N, up to 10 6 Input 0 marks the end of the input the smallest decimal multiple of N with only the digits 0 and 1 ! Output Ideas?

One way… Count up to the solution, starting from 1…

Dynamic programming Storing intermediate results in a table for fast look-up: input N = 6 possible remainders upon dividing by N (6) # of digits in answer

DP! Only checking values for which a remainder has not yet been used…

Problem Set #1 (4 problems) In teams of ~3, think about - how would you solve this problem? - how could you most simplify the programming ? - think of a 5-letter jotto word… ! - is it a dynamic programming problem? - divide up with one problem per group -

Competition Options Sat. Mar 8 and Sat. Apr 19 external competitions…