15-251 Great Theoretical Ideas in Computer Science.

Slides:



Advertisements
Similar presentations
How to Succeed in Mathematics WOU Mathematics Department
Advertisements

TEST-TAKING STRATEGIES FOR THE OHIO ACHIEVEMENT READING ASSESSMENT
Test Taking Strategies
Great Theoretical Ideas in Computer Science.
Are You Right-Brained or Left-Brained? Your learning style is influenced by whether you are right-brained or left- brained.
Lesson 10: Dealing with Criticism
Copyright © Cengage Learning. All rights reserved.
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.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Proof Points Key ideas when proving mathematical ideas.
CSC1016 Coursework Clarification Derek Mortimer March 2010.
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
INFINITE SEQUENCES AND SERIES
CSE115/ENGR160 Discrete Mathematics 02/07/12
Bits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class Acknowledgement: the original author for some of.
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
CIS 260 Mathematical Foundations of Computer Science.
Debugging CMSC 201. Announcements Hw2, Hw3 grades returned if something doesn’t seem right, ask Midterm next Thurs (Oct 23) we’ll review on Tues no hw.
1 Topic Mathematical Proofs. 2 Topic Mathematical Proofs California Standards: 24.2 Students identify the hypothesis and conclusion in logical.
Test Preparation Strategies
Lesson 4: Percentage of Amounts.
Spelling Lists. Unit 1 Spelling List write family there yet would draw become grow try really ago almost always course less than words study then learned.
Understanding the art of Persuasion
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 13Feb 24, 2004Carnegie.
1 What NOT to do I get sooooo Frustrated! Marking the SAME wrong answer hundreds of times! I will give a list of mistakes which I particularly hate marking.
Discrete Mathematics for Computer Science. Bits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class.
The Node Voltage Method
7 Graph 7.1 Even and Odd Degrees.
Great Theoretical Ideas in Computer Science.
Supporting the Transition from Arithmetic to Algebra Virginia Bastable, Susan Jo Russell, Deborah Schifter Teaching and Learning Algebra, MSRI, May 2008.
College Algebra Fifth Edition James Stewart Lothar Redlin Saleem Watson.
The importance of sequences and infinite series in calculus stems from Newton’s idea of representing functions as sums of infinite series.  For instance,
Great Theoretical Ideas in Computer Science.
Cornell Notes Key Ideas Main Points Titles of Powerpoint Slides Vocabulary Words Detailed information Definitions of Words Example problems This is YOUR.
Errors And How to Handle Them. GIGO There is a saying in computer science: “Garbage in, garbage out.” Is this true, or is it just an excuse for bad programming?
Section 3.1: Proof Strategy Now that we have a fair amount of experience with proofs, we will start to prove more difficult theorems. Our experience so.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
PET for Schools. Paper 3: Speaking What’s in the Speaking Test? Part 1: You answer the examiner’s questions about yourself and give your opinions. Part.
Extending the Definition of Exponents © Math As A Second Language All Rights Reserved next #10 Taking the Fear out of Math 2 -8.
HELLO THERE !.... It's great to see you ! And by the way, did you know about the previous expression ?
Test Taking Tips Test Prep  Preparation for your first test should begin on the first day of class; this includes paying attention.
1 Put your name if you want your attendance credit. Please put your as well. CSC 320 is done at 11:30 so I did NOT fill in the box for 11:30 for.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
English Composition Jonathan Watts. Welcome back to class! I hope you had a wonderful weekend! Today we will talk about Essay Development –Pg
COMPSCI 102 Introduction to Discrete Mathematics.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Section 10.1 Confidence Intervals
Studying for Tests Before the Test Be sure to find out ahead of time. –what material the test will cover –what type of test it will be (multiple choice,
Cornell System of Note-Taking The Cornell Method of note making is a 3 part system of making notes. Making notes, as distinguished from taking notes, is.
previous next 12/1/2015 There’s only one kind of question on a reading test, right? Book Style Questions Brain Style Questions Definition Types of Questions.
Great Theoretical Ideas in Computer Science.
CSCE 1030 Computer Science 1 First Day. Course Dr. Ryan Garlick Office: Research Park F201 B –Inside the Computer Science department.
Lecture Coursework 2 AGAIN. Rectangle Game Look at proof of matchsticks A rectangular board is divided into m columns by n rows. The area of the board.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
© 2015 albert-learning.com How to talk to your boss How to talk to your boss!!
Great Theoretical Ideas in Computer Science.
This assignment is required for credit in Ms. Benton’s class. Speeches begin Friday, May 23. DO NOT PRINT IT OUT WITHOUT PERMISSION. We are low on ink.
Dana Nau: CMSC 722, AI Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
MATH & SCIENCE.  Pre-Algebra  Elementary algebra  Intermediate algebra  Coordinate geometry  Plane geometry  Trigonometry.
The Ontological Argument
Conditional Statements and Deductive Reasoning 2-1 – 2-3.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
The problem you have samples for has been edited to reduce the amount of reading for the students. We gave the original late in the year. As we were working.
Introduction to Discrete Mathematics
CSCE 489- Problem Solving Programming Strategies Spring 2018
PHYS 202 Intro Physics II Catalog description: A continuation of PHYS 201 covering the topics of electricity and magnetism, light, and modern physics.
Software Development Techniques
Presentation transcript:

Great Theoretical Ideas in Computer Science

Great Theoretical Ideas in Computer Science for Some

Course Staff Instructor Luis von Ahn TAs Anton Bachin Jeremiah Blocki Matt Bonakdarpour Severin Hacker Daniel Schafer Jonah Sherman Ben Wolf

Homework 40% Final 25% In-Class Quizzes 5% 3 In-Recitation Tests 25% Participation 5% If Suzie gets 60,90,80 in her tests, how many total test points will she have in her final grade? (0.05)(60) + (0.10)(90) + (0.10)(80) = 20 Lowest homework grade is dropped Lowest test grade is worth half Grading

Weekly Homework Ten points per day late penalty No homework will be accepted more than three days late Homework will go out every Tuesday and is due the Tuesday after Homework MUST be typeset

Collaboration + Cheating You may NOT share written work You may NOT use Google, or solutions to previous years’ homework You MUST sign the class honor code

Textbook There is NO textbook for this class We have class notes in wiki format You too can edit the wiki!!!

((( ))) Feel free to ask questions

Bits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class Lecture 1 (January 15, 2008)

What did our brains evolve to do? What were our brains “intelligently designed” to do? What kind of meat did the Flying Spaghetti Monster put in our heads?

Our brains did NOT evolve to do math! Over the last 30,000 years, our brains have essentially stayed the same!

The human mind was designed by evolution to deal with foraging in small bands on the African Savannah... faulting our minds for succumbing to games of chance is like complaining that our wrists are poorly designed for getting out of handcuffs Steven Pinker “How the Mind Works”

Our brains can perform simple, concrete tasks very well And that’s how math should be approached! Draw simple pictures Try out small examples of the problem: What happens for n=1? n=2? Substitute concrete values for the variables: x=0, x=100, …

Terry Tao (Fields Medalist, considered to be the best problem solver in the world) “I don’t have any magical ability…I look at the problem, and it looks like one I’ve already done. When nothing’s working out, then I think of a small trick that makes it a little better. I play with the problem, and after a while, I figure out what’s going on.”

Expert Novice

The better the problem solver, the less brain activity is evident. The real masters show almost no brain activity! Simple and to the point

Use a lot of paper, or a board!!!

Quick Test... Count the green squares (you will have three seconds)

How many were there?

Hats with Consecutive Numbers A B AliceBob Alice starts: … | A - B | = 1

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I don’t know what my number is (round 1)

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I don’t know what my number is (round 2)

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I don’t know what my number is (round 3)

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I don’t know what my number is (round 4)

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I know what my number is!!!!!!!! (round 251)

Hats with Consecutive Numbers AliceBob Alice starts: … | A - B | = 1 and A, B > 0 A B I know what my number is!!!!!!!! (round 252)

Question: What are Alice and Bob’s numbers?

Imagine Alice Knew Right Away AliceBob A B I know what my number is!!!!!!!! Then A = 2 and B = 1 | A - B | = 1 and A, B > 0 (round 1)

1,2N,Y 2,1Y 2,3N,Y 3,2N,N,Y 3,4N,N,N,Y 4,3N,N,Y 4,5N,N,N,Y A B

Inductive Claim Claim: After 2k NOs, Alice knows that her number is at least 2k+1. After 2k+1 NOs, Bob knows that his number is at least 2k+2. Hence, after 250 NOs, Alice knows her number is at least 251. If she says YES, her number is at most 252. If Bob’s number is 250, her number must be 251. If his number is 251, her number must be 252.

Exemplification: Try out a problem or solution on small examples. Look for the patterns.

A volunteer, please

Relax I am just going to ask you a Microsoft interview question

Four guys want to cross a bridge that can only hold two people at one time. It is pitch dark and they only have one flashlight, so people must cross either alone or in pairs (bringing the flashlight). Their walking speeds allow them to cross in 1, 2, 5, and 10 minutes, respectively. Is it possible for them to all cross in 17 minutes?

Get The Problem Right! Given any context you should double check that you read/heard it correctly! You should be able to repeat the problem back to the source and have them agree that you understand the issue

Four guys want to cross a bridge that can only hold two people at one time. It is pitch dark and they only have one flashlight, so people must cross either alone or in pairs (bringing the flashlight). Their walking speeds allow them to cross in 1, 2, 5, and 10 minutes, respectively. Is it possible for them to all cross in 17 minutes?

Intuitive, But False “ = 19, so the four guys just can’t cross in 17 minutes” “Even if the fastest guy is the one to shuttle the others back and forth – you use at least > 17 minutes”

Vocabulary Self-Proofing As you talk to yourself, make sure to tag assertions with phrases that denote degrees of conviction

Keep track of what you actually know – remember what you merely suspect “ = 19, so it would be weird if the four guys could cross in 17 minutes” “even if we use the fastest guy to shuttle the others, they take too long.”

If it is possible, there must be more than one guy doing the return trips: it must be that someone gets deposited on one side and comes back for the return trip later!

Suppose we leave 1 for a return trip later We start with 1 and X and then X returns Total time: Thus, we start with 1,2 go over and 2 comes back…. 2X

5 and 10 “Load Balancing”: Handle our hardest work loads in parallel! Work backwards by assuming 5 and 10 walk together

In this course you will have to write a lot of proofs!

MINESWEEPER Mines Left: 10

3

MINESWEEPER Mines Left: 7 3  

3  2 

3  20  31

3  200  311

3  

MINESWEEPER Mines Left: 6 3    211

3   

MINESWEEPER Mines Left: 5 3    2110 

3    

MINESWEEPER Mines Left: 4 3    2110  22 

MINESWEEPER Mines Left: 3 3    2110  2  22 

3    2110  2  22   1  1 

3    2110  2  22   1  1 

“Dad, it’s INDIAN-PENDANT like you said.” Isaac Rudich 3    2110  2  22  ??1??1??

Think of Yourself as a (Logical) Lawyer Your arguments should have no holes, because the opposing lawyer will expose them

ProverVerifier Statement 1 Statement 2 Statement n … There is no sound reason to go from Statament 1 to Statement 2

Verifier The verifier is very thorough, (he can catch all your mistakes), but he will not supply missing details of a proof A valid complaint on his part is: I don’t understand The verifier is similar to a computer running a program that you wrote!

Undefined term Syntax error Writing Proofs Is A Lot Like Writing Programs You have to write the correct sequence of statements to satisfy the verifier Infinite Loop Output is not quite what was needed Errors than can occur with a program and with a proof!

Good code is well-commented and written in a way that is easy for other humans (and yourself) to understand Similarly, good proofs should be easy to understand. Although the formal proof does not require certain explanatory sentences (e.g., “the idea of this proof is basically X”), good proofs usually do

The proof verifier will not accept a proof unless every step is justified! Writing Proofs is Even Harder than Writing Programs It’s as if a compiler required your programs to have every line commented (using a special syntax) as to why you wrote that line

ProverVerifier A successful mathematician plays both roles in their head when writing a proof

Gratuitous Induction Proof = k(k+1)/2 + (k+1) (by I.H.) Thus S k+1 = (k + 1)(k+2)/2 S n = “sum of first n integers = n(n+1)/2” Want to prove: S n is true for all n > 0 Base case: S 1 = “1 = 1(1+1)/2” I.H. Suppose S k is true for some k > 0 Induction step: …. + k + (k+1)

Gratuitous Induction Proof = n(n+1)/2 + (n+1) (by I.H.) Thus S k+1 = (n + 1)(n+2)/2 S n = “sum of first n integers = n(n+1)/2” Want to prove: S n is true for all n > 0 Base case: S 1 = “1 = 1(1+1)/2” I.H. Suppose S k is true for some k > 0 Induction step: …. + n + (n+1) wrong variable

Proof by Throwing in the Kitchen Sink The author writes down every theorem or result known to mankind and then adds a few more just for good measure When questioned later, the author correctly observes that the proof contains all the key facts needed to actually prove the result Very popular strategy on 251 exams Believed to result in partial credit with sufficient whining 10

Proof by Throwing in the Kitchen Sink The author writes down every theorem or result known to mankind and then adds a few more just for good measure When questioned later, the author correctly observes that the proof contains all the key facts needed to actually prove the result Very popular strategy on 251 exams Believed to result in extra credit with sufficient whining 10 Like writing a program with functions that do most everything you’d ever want to do (e.g. sorting integers, calculating derivatives), which in the end simply prints “hello world”

Proof by Example The author gives only the case n = 2 and suggests that it contains most of the ideas of the general proof. 9 Like writing a program that only works for a few inputs

Proof by Cumbersome Notation Best done with access to at least four alphabets and special symbols. Helps to speak several foreign languages. 8 Like writing a program that’s really hard to read because the variable names are screwy

Proof by Lengthiness An issue or two of a journal devoted to your proof is useful. Works well in combination with Proof strategy #10 (throwing in the kitchen sink) and Proof strategy #8 (cumbersome notation). 7 Like writing 10,000 lines of code to simply print “hello world”

Proof by Switcharoo Concluding that p is true when both p  q and q are true 6 If (PRINT “X is prime”) { PRIME(X); } Makes as much sense as:

Switcharoo Example Hence blah blah, S k is true = (k + 1)(k+2)/2 S n = “sum of first n integers = n(n+1)/2” Want to prove: S n is true for all n > 0 Base case: S 1 = “1 = 1(1+1)/2” I.H. Suppose S k is true for some k > 0 Induction step: by S k …. + k + (k+1)

Proof by “It is Clear That…” “It is clear that that the worst case is this:” 5 Like a program that calls a function that you never wrote

Proof by Assuming The Result Assume X is true Therefore, X is true! 4 … RECURSIVE(X) {: return RECURSIVE(X); } Like a program with this code:

“Assuming the Result” Example = k(k+1)/2 + (k+1) (by I.H.) Thus S k+1 = (k + 1)(k+2)/2 S n = “sum of first n integers = n(n+1)/2” Want to prove: S n is true for all n > 0 Base case: S 1 = “1 = 1(1+1)/2” I.H. Suppose S k is true for all k > 0 Induction step: …. + k + (k+1)

Not Covering All Cases Usual mistake in inductive proofs: A proof is given for N = 1 (base case), and another proof is given that, for any N > 2, if it is true for N, then it is true for N+1 3 RECURSIVE(X) { if (X > 2) { return 2*RECURSIVE(X-1); } if (X = 1) { return 1; } } Like a program with this function:

“Not Covering All Cases” Example = k(k+1)/2 + (k+1) (by I.H.) Thus S k+1 = (k + 1)(k+2)/2 S n = “sum of first n integers = n(n+1)/2” Want to prove: S n is true for all n > 0 Base case: S 0 = “0 = 0(0+1)/2” I.H. Suppose S k is true for some k > 0 Induction step: …. + k + (k+1)

Incorrectly Using “By Definition” “By definition, { a n b n | n > 0 } is not a regular language” 2 Like a program that assumes a procedure does something other than what it actually does

Proof by OMGWTFBBQ 1/20 1

Here’s What You Need to Know… Solving Problems Always try small examples! Use enough paper Writing Proofs Writing proofs is sort of like writing programs, except every step in a proof has to be justified Be careful; search for your own errors