Great Theoretical Ideas in Computer Science 15-251.

Slides:



Advertisements
Similar presentations
CISC Data Structures Ben Perry University of Delaware Summer 2011.
Advertisements

Greedy Algorithms CS 6030 by Savitha Parur Venkitachalam.
CSEE W4140 Networking Laboratory Opening Lecture Jong Yul Kim
Today’s Agenda  Syllabus CS2336: Computer Science II.
Cooking for Computer Scientists. I understand that making pancakes can be a dangerous activity and that, by doing so, I am taking a risk that I.
5/19/2015CS 2011 CS 201 – Data Structures and Discrete Mathematics I Syllabus Spring 2014.
COMP171 Data Structures and Algorithms Spring 2009.
Bioinformatics Chromosome rearrangements Chromosome and genome comparison versus gene comparison Permutations and breakpoint graphs Transforming Men into.
Welcome to MAT 170. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Wednesday and Friday 10:40 am – 11:30 am and by appointment.
Introduction to Bioinformatics Algorithms Greedy Algorithms And Genome Rearrangements.
Discrete Structures & Algorithms EECE 320 : UBC : Spring 2009 Matei Ripeanu 1.
Welcome to MAT 170. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Tuesday and Thursday 8 am – 8:30 am Tuesday and Thursday.
CS – 600 Discrete Structures for Computer Science Prof. Angela Guercio Spring 2008.
Genome Rearrangements CSCI : Computational Genomics Debra Goldberg
COMP171 Data Structures and Algorithm Huamin Qu Lecture 1 (Sept. 1, 2005)
COMP171 Data Structures and Algorithm Qiang Yang Lecture 1 ( Fall 2006)
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2004 Lecture 1 Jan 13, 2004 Carnegie Mellon University.
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
Using MyMathLab Features You must already be registered or enrolled in a current MyMathLab class in order to use MyMathLab. If you are not registered or.
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
COMP 14 – 02: Introduction to Programming Andrew Leaver-Fay August 31, 2005 Monday/Wednesday 3-4:15 pm Peabody 217 Friday 3-3:50pm Peabody 217.
Pancakes With A Problem Steven Rudich The chef at our place is sloppy, and when he prepares a stack of pancakes they come out all different sizes.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Vince Conitzer COMPSCI 102 Fall 2007 Lecture 1 August 27, 2007 Duke University.
Cooking for Computer Scientists. I understand that making pancakes can be a dangerous activity and that, by doing so, I am taking a risk that I.
Spring 2012 MATH 250: Calculus III. Course Topics Review: Parametric Equations and Polar Coordinates Vectors and Three-Dimensional Analytic Geometry.
COMP 151: Computer Programming II Spring Course Topics Review of Java and basics of software engineering (3 classes. Chapters 1 and 2) Recursion.
CHEMISTRY 10123/10125 Spring 2007 Instructor: Professor Tracy Hanna Phone: Office: SWR 418
MATH 310, FALL 2003 (Combinatorial Problem Solving) MoWeFr 1:20 McGregory 214.
MAT 331 Mathematical solving problem with computers.
CompSci 102 Spring 2012 Prof. Rodger January 11, 2012.
Welcome to CS 3260 Dennis A. Fairclough. Overview Course Canvas Web Site Course Materials Lab Assignments Homework Grading Exams Withdrawing from Class.
COMP Introduction to Programming Yi Hong May 13, 2015.
CS 103 Discrete Structures Lecture 01 Introduction to the Course
MGS 351 Introduction to Management Information Systems
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Anupam Gupta CS Fall 2O05 Lecture 1 Aug 29 th, 2OO5 Aug 29 th, 2OO5 Carnegie.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Anupam Gupta CS Fall 2006 Lecture 1 Aug 29 th, 2OO6 Aug 29 th, 2OO6 Carnegie.
Great Theoretical Ideas in Computer Science.
Course Introduction Software Engineering
Data Structures, Algorithms, and Generic Programming Breno de Medeiros COP 4530 / CGS 5425 (Fall 2006)
Greedy Algorithms And Genome Rearrangements An Introduction to Bioinformatics Algorithms (Jones and Pevzner)
Genome Rearrangements [1] Ch Types of Rearrangements Reversal Translocation
Greedy Algorithms And Genome Rearrangements
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Andrew’s Leap 2011 Pancakes With A Problem Steven Rudich.
1 How Do I Do Well In 8.02? A >= 95 = 90 = 85 B = 80 = 76 =72 C = 69 = 66 = 63 D = 59 F < 59 THIS COURSE IS NOT CURVED We want you to help your.
1 Daily Announcements CS 202, Spring 2007 Aaron Bloomfield.
Using MyMathLab Features of MyMathLab You must already be registered or enrolled in a current MyMathLab class in order to use MyMathLab. If you are not.
1 1.Log in to the computer in front of you –Temp account: 231class / 2.Update your in Cascadia's system –If I need to you I'll use.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2005 Lecture 3 Jan 18, 2005 Carnegie Mellon University.
1 CS 101 Today’s class will begin about 5 minutes late We will discuss the lab scheduling problems once class starts.
Financial Markets Finance 300. § Financial Markets Final Exam Mid Term Exam Equity Project Bond Project Stew #1 Stew #2 Stew #3 … … … Weekly Homework.
Introduction to Bioinformatics Algorithms Chapter 5 Greedy Algorithms and Genome Rearrangements By: Hasnaa Imad.
ICS 151 Digital Logic Design Spring 2004 Administrative Issues.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
Spring 2008 Mark Fontenot CSE 1341 – Honors Principles of Computer Science I Note Set 1 1.
Computer Science 20 Discrete Mathematics for Computer Science 1 All the Math you need for your Computer Science courses that you won’t learn in your Math.
Networking CS 3470, Section 1 Sarah Diesburg
All important information will be posted on Blackboard
Networking CS 3470, Section 1 Sarah Diesburg
COMP 283 Discrete Structures
Pancakes With A Problem!
September 27 – Course introductions; Adts; Stacks and Queues
Pancakes With A Problem!
Cooking for Computer Scientists.
Tonga Institute of Higher Education IT 141: Information Systems
David Kauchak cs161 Summer 2009
Tonga Institute of Higher Education IT 141: Information Systems
Bounds for Sorting by Prefix Reversal -- Pancake Problem
Presentation transcript:

Great Theoretical Ideas in Computer Science

Administrative details

Course Staff Prof. Danny Sleator Prof. Ryan O’Donnell TAs A: JD Nir B: Tim Wilson C: Mark Kai D: Adam Blank E: Sang Tian F: Jasmine Peterson G:Andrew Audibert Shashank Singh Office hours start Wednesday.

Web Sites = Announcements, Calendar, Notes, Homeworks, … Bulletin Board: Questions, Comments, Announcements, …

Textbook There is no textbook. Slides will be posted on the website. Some supplementary notes will also be posted.

Grading 28%Homework (12, lowest one dropped) 5% Quizzes (12, lowest two dropped) 2%Participation 35%Midterms (3, lowest one counts half) 30%Final

Homework Homeworks out/due each Thursday at 11:59pm. They are hard. Must be typeset in LaTeX, submitted online. 5 “late days” for the semester, ≤ 3 per HW. Turned in any time Friday: costs 1 late day Turned in any time Saturday: costs 2 late days Turned in any time Sunday:costs 3 late days After Sunday: grade of 0.

Collaboration On each HW, you may work in a group of ≤ 4 people. You must report who you worked with. You must think about the problems yourself for ≥ 1 hour before discussing them with others. You must write up all solutions by yourself.

Cheating Handled in accordance with university policy: You MAY NOT: You MAY: You MUST: sign and return the Honor Code today. Share written work. (Erase all whiteboards.) Get help from anyone besides your HW collaborators, staff. Refer to solutions/materials from earlier versions of 251. Search the web/books for specific homework problems. Get help from others/books/web on ‘general topics’ (“induction”, “random variable”, “diagonalization”) Use tools like Mathematica/Maple/Wolfram Alpha.

Quizzes Every Tuesday (a few exceptions), beginning of class The quiz is DUE AT 3:07pm. Therefore, do NOT be late to class. Tested on material from the prior week. These are designed to be easy, assuming you are keeping up with the lectures.

Midterms Designed to be doable in 1 hour. You will have 3 hours. “Semi-cumulative.” Held Wednesdays, 6pm – 9pm at locations TBD. February 15, March 21, April 18 Mark these dates on your calendar now!

Automatic A There are 4 “Automatic A” problems on website. Solve one, get an A in the course. (Actually +2 letter grades.) All standard homework rules apply (except groups can submit jointly written solution). At most one submission per person/group per semester. They are super-hard… but some easier versions may appear on homeworks or tests…

15-251: Great Theoretical Ideas in Computer Science Pancakes With A Problem Lecture 1

Feel free to ask questions

He does this by grabbing several from the top and flipping them over, repeating this (varying the number he flips) as many times as necessary. The chef in our place is sloppy; when she prepares pancakes they come out all different sizes. When the waiter delivers them to a customer, he rearranges them (so that the smallest is on top, and so on, down to the largest at the bottom).

How do we sort this stack? How many flips do we need?

2 flips sufficient 2 flips necessary

How do we sort this stack? How many flips do we need?

Developing Notation: Turning pancakes into numbers

How do we sort this stack? How many flips do we need?

4 flips are sufficient

Best way to sort this stack? Let X be the smallest number of flips that can sort this specific stack. ? ≤ X ≤ ? Upper Bound Lower Bound

Is 4 a lower bound? What would it take it show that? ? ≤ X ≤ ? Upper Bound Lower Bound 4 A convincing argument that every way of sorting the stack uses at least 4 flips

Four Flips Are Necessary Second flip has to bring 4 to the top, because… First flip has to put 5 on bottom, because… If we could do it in three flips:

Best way to sort? Let X be the smallest number of flips that can sort this specific stack. ? ≤ X ≤ ? Upper Bound Lower Bound X = 4

Matching upper and lower bounds! ? ≤ X ≤ ? Upper Bound Lower Bound 44 X = 4

?????????? P5P5

5 th Pancake Number Number of flips required to sort when your worst enemy gives you a stack of 5 pancakes P 5 = MAX over all 5-stacks S of MIN # of flips to sort S P 5 =

? ≤ P 5 ≤ ? Upper Bound Lower Bound 4 5 th Pancake Number Fact: P 5 = 5 1. Show a specific 5-stack. 2. Argue that every way of sorting this stack uses at least 5 flips. Give a way of sorting every 5-stack using at most 5 flips. To show P 5 ≥ 5 ?To show P 5 ≤ 5 ?

What is P n for small n? Can you do n = 0, 1, 2, 3 ?

Initial Values of P n n3012 PnPn 0013

P 3 = 3 Biggest one to bottom using ≤ 2 flips. Smallest one to top using ≤ 1 flip. 1. Show a specific 3-stack. 2. Argue that every way of sorting this stack uses at least 3 flips. To show P 3 ≥ 3 ? Give a way of sorting every 3-stack using at most 3 flips. To show P 3 ≤ 3 ?

? ≤ P n ≤ ? Lower Bound n th Pancake Number Upper Bound “What is the best upper bound and lower bound I can prove?”

? ≤ P n ≤ ? n th Pancake Number Upper Bound Let’s start by thinking about an upper bound.

???????????????????? n Upper Bound on P n Fix the biggest pancake.

???????????????????? Upper Bound on P n n ???????????????????? n ???????????????????? n n−1 Fix the biggest pancake.

???????????????????? Upper Bound on P n Fix pancake #n ≤ 2 flips n ???????????????????? n ???????????????????? n Fix pancake #n−1 ≤ 2 flips n-1 Fix pancake #n−2 ≤ 2 flips n-2 Fix pancake #2 ≤ 2 flips n-3 3 Fix pancake #3 ≤ 2 flips 2 1 ≤ 2n−2

???????????????????? Upper Bound on P n Fix pancake #n ≤ 2 flips n ???????????????????? n ???????????????????? n Fix pancake #n−1 ≤ 2 flips n-1 Fix pancake #n−2 ≤ 2 flips n-2 Fix pancake #2 ≤ 1 flip n-3 3 Fix pancake #3 ≤ 2 flips ? ? ≤ 2n−3

Upper Bound on P n Fix pancake #n ≤ 2 flips Fix pancake #n−1 ≤ 2 flips Fix pancake #n−2 ≤ 2 flips Fix pancake #2 ≤ 1 flip Fix pancake #3 ≤ 2 flips ≤ 2n−3 Bring-To-Top Method shows P n ≤ 2n−3 assuming n ≥ 2.

?  P n  2n−3 Let’s think about a lower bound for P n 1. Show a specific n-stack. 2. Argue that every way of sorting this stack uses a lot of flips.

This stack seems pretty painful! Lower Bound on P n

Breaking-Apart Argument Suppose the stack has an adjacent pair which should not be adjacent in the end. Spatula must go between them at least once. (“Adjacent pair” includes bottom pancake and the plate.) Each flip can achieve at most 1 “break-apart”.

Proof of P n ≥ n n n S S contains n adjacent pairs which need to be broken apart, each necessitating at least one flip. Case 1: n is even. Detail: Assuming n >

Proof of P n ≥ n n n S S contains n adjacent pairs which need to be broken apart, each necessitating at least one flip. Case 2: n is odd. Detail: Assuming n >

Upper and lower bounds are within a factor of 2. Upper Bound Lower Bound n  P n  2n−3 (for n > 4)

From any n-stack to sorted n-stack in ≤ P n Slight Digression From sorted n-stack to any n-stack in ≤ P n ? Reverse the sequence of flips used to sort! Hence: any n-stack to any n-stack in ≤ 2P n Is there a better way?

Any Stack S to Any Stack T in ≤ P n S: 4,3,5,1,2T: 5,1,4,3,2 3,4,1,2,5 1,2,3,4,5 Rename the pancakes in T to be 1,2,3,…,n Rewrite S using the new naming scheme In ≤ P n flips can sort “new S”. The same sequence of flips also brings S to T. “new S”

The Known Pancake Numbers n PnPn

P 20 is unknown ⋅⋅⋅ 21 = 20! possible 20-stacks 20! = 2.43 × (2.43 exa-pancakes) Brute-force analysis is impossible! It is either 23 or 24, we don’t know which.

Is This Really Computer Science?

Posed in Amer. Math. Monthly 82(1), 1975, by “Harry Dweighter” (haha). AKA Jacob Goodman, a computational geometer.

In 1977, the observations we have made so far were published by Mike Garey, David Johnson, & Shen Lin

(17/16)n ≤ P n ≤ (5/3)n+5/3 Discrete Mathematics 27(1), 1979 Bounds For Sorting By Prefix Reversal by: William H. Gates (Microsoft, Albuquerque NM) Christos Papadimitriou (UC Berkeley) upper bound also by Győri & Turán

(15/14)n ≤ P n ≤ (5/3)n+5/3 “On the Diameter of the Pancake Network” Journal of Algorithms 25(1), 1997 by Hossain Heydari and Hal Sudborough

(15/14)n ≤ P n ≤ (18/11)n “An (18/11)n Upper Bound For Sorting By Prefix Reversals” Theoretical Computer Science 410(36), 2009 by B. Chitturi, W. Fahle, Z. Meng, L. Morales, C.O. Shields, I.H. Sudborough, W. UT Dallas

(3/2)n−1 ≤ B P n ≤ 2n+3 Burnt Pancakes

(3/2)n ≤ B P n ≤ 2n−2 Burnt Pancakes “On The Problem Of Sorting Burnt Pancakes” Discrete Applied Math. 61(2), 1995 by David S. Cohen and Manuel Blum X.

Worst Case: There is an algorithm using ≤ (18/11)n flips, even when your worst enemy gives you stack of n pancakes Average Case: There is an algorithm using ≤ (17/12)n flips on average when given a random stack of n pancakes (Josef Cibulka, 2009)

Applications

“The Pancake Network” on n! nodes Nodes are named after the n! different stacks of n pancakes Put a link between two nodes if you can go between them with one flip

Pancake Network, n =

Pancake Network, n = 4

PnPn Pancake Network: Message Routing Delay What is the maximum distance between two nodes in the pancake network?

If up to n−2 nodes get hit by lightning, the network remains connected, even though each node is connected to only n−1 others The Pancake Network is optimally reliable for its number of nodes and links Pancake Network: Reliability

Computational Biology Transforming Cabbage Into Turnip: polynomial algorithm for sorting signed permutations by reversal by S. Hannenhalli & P. Pevzner Of Mice And Men: algorithms for evolutionary distances between genomes with translocation by J. Kececioglu and R. Ravi

One “Simple” Puzzle A host of problems and applications at the frontiers of science

High Level Point Computer Science is not merely about computers and programming — it is about mathematically modeling our world, and about finding better and better ways to solve problems. Today’s lecture is a microcosm of this.

Definitions of: n th pancake number upper bound lower bound Proof of: Bring-To-Top Breaking-Apart ANY to ANY in ≤ P n Study Guide

Homework 1: Puzzle Hunt. Begins now. Turn in your signed Honor Code. Go to HW1 on the course web site. Special homework rules exceptions: 1. Work in randomly pre-selected teams of 4 2. May use the Internet as much as you want