Curricularizing the ACM... ? Zach Dodds ~ November 13, 2010.

Slides:



Advertisements
Similar presentations
ACM Programming Team Bill Punch. ACM Programming Contest One of the premier programming competitions. Held every year since 1977 MSU was the winner that.
Advertisements

Jotto! JRsSRsElderly slate 3 This term's first class to guess another's word earns 1 problem... slate 2slate 1 This term's last class to have its word.
Lindsey Bleimes Charlie Garrod Adam Meyerson
MATH 224 – Discrete Mathematics
CS 1031 Recursion (With applications to Searching and Sorting) Definition of a Recursion Simple Examples of Recursion Conditions for Recursion to Work.
Jotto! JRsSRs other diner 1 This term's first class to guess another's word earns 1 problem... diner 1diner 2 This term's last class to have its word guessed.
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
CS&E 1111 ExIFs IFs and Nested IFs in Excel Objectives: Using the If function in spreadsheets Nesting If functions.
Jotto! JRsSRsElderly A word-guessing game similar to mastermind… slate 3 This term's first class to guess another's word earns 1 problem... slate 2slate.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Introduction to Algorithms
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.
Insertion sort, Merge sort COMP171 Fall Sorting I / Slide 2 Insertion sort 1) Initially p = 1 2) Let the first p elements be sorted. 3) Insert the.
Searching and Sorting SLA Computer Science 4/16/08 Allison Mishkin.
CS 206 Introduction to Computer Science II 10 / 14 / 2009 Instructor: Michael Eckmann.
Discrete Structures & Algorithms EECE 320 : UBC : Spring 2009 Matei Ripeanu 1.
1 CS 177 Week 15 Recitation Slides Review. Announcements Final Exam on Sat. May 8th  PHY 112 from 8-10 AM Complete your online review of your classes.
This material in not in your text (except as exercises) Sequence Comparisons –Problems in molecular biology involve finding the minimum number of edit.
1 Algorithms and Analysis CS 2308 Foundations of CS II.
CS 106 Introduction to Computer Science I 10 / 15 / 2007 Instructor: Michael Eckmann.
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
CS 106 Introduction to Computer Science I 10 / 16 / 2006 Instructor: Michael Eckmann.
Sorting and Searching Arrays CSC 1401: Introduction to Programming with Java Week 12 – Lectures 1 & 2 Wanda M. Kunkle.
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
ACM Welcome! Sep 11 Welcome! and DP problems ~ 6 problems Sep 18 Lab session ~ 6 problems Sep 25 Discussion session on graph problems ~ 6 problems Oct.
Mon 29 Sep 2014Lecture 4 1. Running Time Performance analysis Techniques until now: Experimental Cost models counting execution of operations or lines.
Analysis CS 367 – Introduction to Data Structures.
Hello World! CSE442. Course Summary A semester long group project – You will develop software from idea to implementation You have full freedom to choose.
Types of IP Models All-integer linear programs Mixed integer linear programs (MILP) Binary integer linear programs, mixed or all integer: some or all of.
L. Grewe.  An array ◦ stores several elements of the same type ◦ can be thought of as a list of elements: int a[8]
Binary Search From solving a problem to verifying an answer.
CompSci 6 Introduction to Computer Science October 20, 2011 Prof. Rodger.
Lesson Objective: Understand what an algorithm is and be able to use them to solve a simple problem.
ACM today! Nice work to everyone in the qualifiers and evening lab... Today: BS! Next 11/2: guest speaker... On 11/9: final lab session 11/13: regionals.
Logic Our programs will have to make decisions on what to do next –we refer to the decision making aspect as logic Logic goes beyond simple if and if-else.
CSC 211 Data Structures Lecture 13
Solving Problems Quickly UAkron Programming Team January 20, 2012.
Logic Our programs will have to make decisions in terms of what to do next –we refer to the decision making aspect as logic Logic goes beyond simple if.
Logic Our programs will have to make decisions on what to do next –we refer to the decision making aspect as logic Logic goes beyond simple if and if-else.
1 Algorithms CS 202 Epp section ??? Aaron Bloomfield.
Welcome to CS61A Disc. 29/47 :D Dickson Tsai OH: Tu, Th 4-5pm 411 Soda Previous stop: None >>> Today: Working effectively in.
ACM reminders October HMC Mock contest 9: :30 November regional contest This is the next ACM meeting !! Contest-like problems dynamic.
Loops Wrap Up 10/21/13. Topics *Sentinel Loops *Nested Loops *Random Numbers.
Feature Engineering Studio September 30, Quick Note Please me for appointments rather than just showing up at my office – I’m always glad.
CS 121 – Quiz Feb 17 th. Question 2 We want to count how many days there were such that the temperature is at least degrees lower than the.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
CS321 Data Structures Jan Lecture 2 Introduction.
Box Plots March 20, th grade. What is a box plot? Box plots are used to represent data that is measured and divided into four equal parts. These.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
5 Number Summary. Definition (Five-Number Summary) The five-number summary of a set of numbers consists of the five quantities – Minimum – 1st quartile.
Harbin, China 2010 finals ACM today… ! (2009) Knapsack DP for NP! Floyd-Warshall DP for APSP! Max Flow.
Introduction to Programming Python Lab 8: Loops 26 February PythonLab8 lecture slides.ppt Ping Brennan
BINARY SEARCH CS16: Introduction to Data Structures & Algorithms Thursday February 12,
ACM today The Fall competition is getting organized… it's going to be lonely…
CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking Prof. Katherine Gibson Based on slides by Shawn Lupoli and Max Morawski at UMBC.
ACM so far… Sep 6 Welcome! and DP problems ~ 5 problems
Consecutive Number Equations
Analysis and design of algorithm
Jotto! Frosh Sophs Jrs Srs audio 2 audio 1 audio 2 audio 1 graze 2
Algorithms Chapter 3 With Question/Answer Animations
Introduction to Programming
CS005 Introduction to Programming
Loops CIS 40 – Introduction to Programming in Python
Jotto! Sophs Jrs Srs Profs pluot 1 pluot 2 pluot 1 pluot 2 squid 2
Coding Concepts (Basics)
Topic 1: Problem Solving
ACM today… ! DP for NP! DP for APSP! Knapsack Floyd-Warshall
12.4 Box-and-Whisker Plots
COMPUTER PROGRAMMING SKILLS
Algorithms Tutorial 27th Sept, 2019.
Presentation transcript:

Curricularizing the ACM... ? Zach Dodds ~ November 13, 2010

Hard-won lesson #1: at HMC, if you want students to participate in something, curricularize it! Four undergraduate years ≈ 190 students each Every student must pass CS 1 Concrete mascot, Wally Wart

Our one-unit CS 189 class... Tuesdays 4:15-5:30 pm each week...

Our one-unit CS 189 class... Hard-won lesson #2: at HMC, if you want students to participate in something, provide food!

Running total of problems solved weekly problem sets of 4-6 problems... graded via a script that runs diff on our server worth 2 points, if done by 10pm Tuesday; 1 point otherwise week 0week 1week 2week 3 Waterloo et al.!

Short lectures dynamic programming 45 minutes every other Tuesday... Other meetings are lab sessions. No teaching credit for this, but good will credit == at least half the food! graphs geometry Binary Search

This week: cow placement Input Output Number of cow stalls in the barn The locations of stalls Number of cows to put in the stalls 8 The largest minimum spacing possible after placing the cows The barn! how do we best fit 2 cows? 3 cows? 4?

# get (N) # of stalls, (C) cows, and (S), the stalls N = input(); C = input(); S = []; for i in range(N): S += [input()] # list o' stalls S.sort() # sort them! lo = 0 hi = max(S)-min(S)+1 while True: mid = (lo + hi)/2 # does anyone see the bug here? if mid == hi or mid == lo: break if CHECKS_OUT( mid, C, S ): lo = mid # it worked! Look higher (set lo to mid) else: hi = mid # it didn't work Look lower (set hi to mid) print mid # output the result! cows code binary search input BS setup

This bug went undetected in Java's libraries for years...

Our general strategy Give 75% of the code for one problem... Allow use of any language... Keep contest in perspective... If something isn't useful to all CS majors, we don't bother. Everyone gets that problem, at least. Everyone has a good start on the next problems that use binary search!

ACM: a light hat to wear... Thoughts... ? Problems + Food = ACM class Andrew Lilian

ACM today! Nice work to everyone in the qualifiers and evening lab... Today: BS! Next 11/2: guest speaker... On 11/9: final lab session 11/13: regionals On 11/16: wrap-up

ACM this week!?

Next week This talk is optional, but it should be good! In addition, it's 2 problems... It may count as a colloquium, too...

Jotto! SophsJrsSrsProfs pluot 1pluot 2pluot 1pluot 2 squid 2squid 1squid 0squid 1 sophomores remain... fails 2 fails 0fails 2 cache 1cache 2cache 3cache 0 china 1 quail 1 china 2 quail 3 china 3 quail 0 china 0 quail 2 conch 0 conch 1 conch 5 conch 0 laugh ?laugh 5laugh xlaugh 2

Problem D from the 2009 World Finals in Stockholm: Pipe Packing Given a set of four wire diameters: What is the minimum diameter of pipe that can contain all four wires? (Constraint: pipes only come in millimeter sizes)

A lower bound: sum of largest two wire-diameters An upper bound: sum of all four wire-diameters l Binary search between lower bound and upper bound l Given a pipe diameter and four wire diameters, can you pack the wires inside the pipe? l Choose the smallest integer pipe diameter that fits Intuition: Solve this problem by binary search

Binary search in a sorted list... What's next... ? in Python we want to return True or False: is val in S?

This week's problems… palpath city aggr cowset flood2 These three are all examples of problems for which binary search might be a good technique… could be used here, too...

Problem D from the 2009 World Finals in Stockholm: Pipe Packing Given a set of four wire diameters: What is the minimum diameter of pipe that can contain all four wires? (Constraint: pipes only come in millimeter sizes)

A lower bound: sum of largest two wire-diameters An upper bound: sum of all four wire-diameters l Binary search between lower bound and upper bound l Given a pipe diameter and four wire diameters, can you pack the wires inside the pipe? l Choose the smallest integer pipe diameter that fits Intuition: Solve this problem by binary search

Enjoy! Thoughts... ?

Last week: wifi InputOutput The # of access points and the # of houses The # of test cases... Locations of the houses The smallest max distance achievable

This week: city Input Output dist cost of 1 st story # of people to house 194 The minimium cost to house the specified # of people cost per unit distance from (0,0) maximum # of stories per building the central station where everyone works is at (0,0) distances to it are considered to be |x|+|y|-1 0 dist 1 dist 2 dist 1 dist 3 dist

This week: cowset Input Output ID # for 1 st cow # of cows available, up to 34 5 The number of subsets whose IDs sum between min and max minimum ID sum maximum ID sum Farmer Ran is willing to play frisbee with any subset of cows whose IDs sum to any value between the min and max... ID # for 2 nd cow ID # for 3 rd cow Try all subsets...?

This week: cowset Input Output ID # for 1 st cow # of cows available, up to 34 5 The number of subsets whose IDs sum between min and max minimum ID sum maximum ID sum Farmer Ran is willing to play frisbee with any subset of cows whose IDs sum to any value between the min and max... ID # for 2 nd cow ID # for 3 rd cow Takes too long to try all subsets...! How could Bin Search speed it up?

Try this week's problems! Perhaps start with aggr...