Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS 15-251 Fall 2005 Lecture 15Oct 20, 2005Carnegie.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science.
Advertisements

1 CS101 Introduction to Computing Lecture 17 Algorithms II.
Ancient Wisdom: On Raising A Number To A Power Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 5Sept 13, 2005Carnegie.
Using the Rule Normal Quantile Plots
Polya’s Four Step Problem Solving Process
Proof Points Key ideas when proving mathematical ideas.
Great Theoretical Ideas in Computer Science.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
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.
CIS 260 Mathematical Foundations of Computer Science.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
THE TRANSITION FROM ARITHMETIC TO ALGEBRA: WHAT WE KNOW AND WHAT WE DO NOT KNOW (Some ways of asking questions about this transition)‏
analysis, plug ‘n’ chug, & induction
Test Preparation Strategies
Algebra Problems… Solutions
Induction and recursion
Cantor’s Legacy: Infinity And Diagonalization Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 25Apr 13, 2004Carnegie.
Introduction to the ACT MATH. Content Covered by the ACT Mathematics Test 3 sub-scores are based on 6 areas: pre-algebra, elementary algebra, intermediate.
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 13Feb 24, 2004Carnegie.
Introduction to Algorithms Jiafen Liu Sept
Discrete Mathematics for Computer Science. Bits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class.
Artificial Intelligence Introduction (2). What is Artificial Intelligence ?  making computers that think?  the automation of activities we associate.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
RMIT University; Taylor's College1 Lecture 6  To apply the Principle of Mathematical Induction  To solve the Towers of Hanoi puzzle  To define a recurrence.
The Forward-Backward Method The First Method To Prove If A, Then B.
Great Theoretical Ideas in Computer Science.
Recursion Chapter 7. Chapter Objectives  To understand how to think recursively  To learn how to trace a recursive method  To learn how to write recursive.
Standards for Mathematical Practice
“The study of algorithms is the cornerstone of computer science.” Algorithms Fall 2011.
HAWKES LEARNING Students Count. Success Matters. Copyright © 2015 by Hawkes Learning/Quant Systems, Inc. All rights reserved. Section 1.1 Thinking Mathematically.
SOCIAL STUDIES Unit 1: Thinking Critically. Unit Overview Critical Thinking Perception Thought Patterns Problem Solving Facts Vs. Opinions Propaganda.
Great Theoretical Ideas in Computer Science.
Key Stage 2 Maths What and how do we teach it?. Aims of the meeting tonight To help you to understand more of what we do in maths at Key Stage 2 To help.
COMPSCI 102 Introduction to Discrete Mathematics.
Today’s topics Orders of growth of processes Relating types of procedures to different orders of growth.
Reading and Writing Mathematical Proofs Spring 2015 Lecture 4: Beyond Basic Induction.
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.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Inductive Reasoning Great Theoretical Ideas In Computer Science Victor AdamchikCS Spring 2010 Lecture 2Jan 14, 2010Carnegie Mellon University.
Great Theoretical Ideas in Computer Science.
Solving Linear Equations. Example 1 It’s obvious what the answer is. However, we need to start with the basics and work our way up because we need to.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2005 Lecture 3 Jan 18, 2005 Carnegie Mellon University.
COMPSCI 102 Discrete Mathematics for Computer Science.
1/32 This Lecture Substitution model An example using the substitution model Designing recursive procedures Designing iterative procedures Proving that.
Choose Your Representation! Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2005 Lecture 14 Feb 24, 2005 Carnegie Mellon University.
Section 3 Systems of Professional Learning Module 1 Grades K–5: Focus on Practice Standards.
Introduction: Content And Method Professors Steven Rudich and Bruce Maggs Carnegie Mellon University CS Lecture 1.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
Great Theoretical Ideas in Computer Science.
Scholastic Aptitude Test Developing Critical Reading Skills Doc Holley.
Ancient Wisdom: On Raising A Number To A Power Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 5Sept 12, 2006Carnegie.
Advanced Algorithms Analysis and Design
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
Unary, Binary, and Beyond Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture 2Jan 16, 2003Carnegie Mellon University.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong
Algorithms and Problem Solving
Great Theoretical Ideas in Computer Science
Introduction to Discrete Mathematics
Ancient Wisdom: On Raising A Number To A Power
Ancient Wisdom: On Raising A Number To A Power
4. Computational Problem Solving
Algorithms and Problem Solving
This Lecture Substitution model
Induction: One Step At A Time
Software Development Techniques
Presentation transcript:

Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS Fall 2005 Lecture 15Oct 20, 2005Carnegie Mellon University

A volunteer, please.

Martial Arts 101 The novice makes a huge motionThe novice makes a huge motion The black belt makes a small motionThe black belt makes a small motion The master makes a tiny motionThe master makes a tiny motion

Violin, piano, tennis, magic, programming, singing,... The novice makes a huge motionThe novice makes a huge motion The black belt makes a small motionThe black belt makes a small motion The master makes a tiny motionThe master makes a tiny motion

This is also true in mental activities.

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

Even Geniuses Think in Small Steps Even the smartest people have limited brains that work with simple representations and pictures.

Less is More The root of effective thinking, effective science, effective mathematics, effective engineering is to keep the issues simple.

Keep It Simple The expert represents his/her state as simply as possible.

A volunteer, please.

Relax …….

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

Do You Understand The Question? Four guys want to cross a bridge that can only hold two people ay 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?

You have one minute to solve this problem Four guys want to cross a bridge that can only hold two people ay 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?

So what is the answer? Four guys want to cross a bridge that can only hold two people ay 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 “ = 18, 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”

Vocabularize 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. “ = 18, 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.”

Over This Semester… Develop stock phrases to classify statements. Learn from experience and eliminate ambiguous or misleading phrases like “Even if”.

Keep track of what you actually know – remember what you merely suspect. “ = 18, 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: 2X. Thus, we start with 1,2 go over and 2 comes back….

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

Words To The Wise Keep It Simple Don’t Fool Yourself

CERTAINTY AND COMPOSITION Mathematical statements and inferences are CERTAIN – they compose to make arbitrarily long and completely correct CHAINS of DEDUCTIVE reasoning. Intuitions are fantastic, but don’t necessarily build on each other inductively to make correct statements. INTUITION are ENABLING, but they are only approximate.

Know Yang from Yin

Yang “male” “left” brain Your “what do I really know for sure?” – mathematical, logical, and unambiguous mind Yin “female” “left” brain Your intuitive, associative, narrative, conjectural mind.

Virtue of Yang Yang “male” “left” brain Your “what do I really know for sure?” – mathematical, logical, and unambiguous mind COMPOSITION: Logic composes to make arbitrarily long chains of correct reasoning.

Virtue of Yin A SENSE OF DORECTION Yin provides a framing story in which possible choices and goals can be discovered and evaluated. Yin “female” “left” brain Your intuitive, associative, narrative, conjectural mind.

Yin and Yang Together YIN Frame an intuitive story. YANGify the story so far By giving the right qualifiers Make unambiguous statements Prove Lemmas using previous lemmas. YIN – continue the story using intuitions. YAGify the story…

As you move back and forth from Yin to Yang a river of fruitful creativity will flow from your mind.

Why do you think that they ask such questions, as opposed to asking for a piece of code to do binary search? That really was a Microsoft question.

Content: An up to date grasp of fundamental problems and solutions Method: Principles and techniques to solve the vast array of unfamiliar problems that arise in a rapidly changing field The future belongs to the computer scientist who has

Content: An up to date grasp of fundamental problems and solutions Method: Principles and techniques to solve the vast array of unfamiliar problems that arise in a rapidly changing field

Content, i.e., definitions, formulas, recipes, standard manipulations, I can handle! “Method” is intimidating. What if, the plain and simple truth is that, I am not that smart? Don’t jump to unwarranted conclusions! Clever and resourceful problem solving is a skill that can be taught and refined.

Yeah, but I knows lots of people who don’t need a lecture on problem solving methods. Brilliance just comes to them. So you are not a natural? – What of it? – Some world class tennis players did not start as natural backhanders. They had to be coached and developed.

Bonzo, I don’t pretend to know the nature of your potential, but I am sure that if you study, practice, and refine your problem solving skills, you will become massively better at it than you are now.

I get it! I can’t possibly know the capacities of my brain hardware, until I have appropriately reprogrammed my brain software.

Aha! I know where the “aha!” comes from!

Yin/Yang Representation Induction Modularity Exemplification Improvement Abstraction Toolkit

Representation: Understand the relationship between different representations of the same information or idea 1 2 3

Toolkit: Name abstract objects and ideas, and put them in your toolkit. Know their advantages and limitations.

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

Abstraction: Abstract away the inessential features of a problem =

Induction has many guises. Master their interrelationship. Formal Arguments Loop Invariants Recursion Algorithm Design Recurrences

Modularity: Decompose a complex problem into simpler subproblems

Improvement: The best solution comes from a process of repeatedly refining and improving solutions and proofs.

Bracketing: What are the best lower and upper bounds that I can prove? ≤ f(x) ≤ [ ]

Representation: This whole course is designed to show you the power of different abstract representations and their relationships.

Don’t passively let the representation choose you! Actively choose the representation!

Toolkit: Unary representation Inductive representation Choice tree representation Polynomial representation Problem solving strategies; Vocabularize Self-Proofs

Tool Kit of Representations with associated strengths and weaknesses. Ex. Unary brings out the geometric character of a number. HUGE space cost.

Tool Kit of Representations with associated strengths and weaknesses. Ex. Continued fractions have best rational approximation sequences. Issue: Decimal notation has huge market share.

Exemplification: Party handshaking problems The Hat Talk problem

Abstraction: Raising to power versus addition chains.

Abstraction: Raising to power works for any binary, associative operation.

Induction! Inductive Representation/Proof Modularity Recursion

Modularity: You can build a computer from NAND gates.

Improvement: Pancakes Addition Chains

Bracketing: What are the best lower and upper bounds that I can prove? ≤ f(x) ≤ [ ]

?() ?(? ≤ M Mn 306 ) M(n) = numbers of additions required to make n. ≤ ≤ ≤

FIRST CUT: What brackets can you do off the top of your head? ?() ?(? ≤ M Mn 306 ) ≤ ≤ ≤

SECOND CUT: What brackets can you do in five minutes? ?() ?(? ≤ M Mn 306 ) ≤ ≤ ≤

AHA! Method: New problem encountered. KEEP IT SIMPLE Possible representation? Try it out on small examples. Any familiar tools come to mind? Get rid of inessential details. Do some quick bracketing. Inductive viewpoint? Know Yin from Yang.

The first step is to get the problem right!

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.

Try and remove inessential details. Does the person with the problem still recognize it?

Conjecture Versus Fact Keep your thoughts tagged with their certainty status. YOU ARE YOUR OWN WORST ENEMY!

Getting To Know The Problem Try it out on small examples Articulate a quantity to bracket What brackets can you do in five minutes?

Choose Your Representation Think of your toolkit of representations, do any of them seem like the better choice than the original? Change representations and get to know the problem again (as before)

Choose Your Representation What is your representation for your intermediate results?

AHA! Method: New problem encountered. Possible representation? Try it out on small examples. Any familiar tools come to mind? Get rid of inessential details. Do some quick bracketing. Inductive viewpoint? Know Yin from Yang.

Let a 0, a 1, a 2, … a n, X be input numbers. Goal is to compute : a n X n + a n-1 X n-1 + … + a 1 X + a 0 At any stage we are allowed to ADD or MULTIPLY any two numbers created so far. How do we MINIMIZE, f(n), the number of operations?

Let a 0, a 1, a 2, … a n, X be input numbers. Goal is to compute : a n X n + a n-1 X n-1 + … + a 1 X + a 0 To make any a single expression that is a function of all n+2 inputs will take at least n+1 operations. We can use n-1 to create the powers of X. Then we can use n to multiply each power by its coefficient. We can use n additions to add them up. n+1 ≤ f(n) ≤ 3n -1

Let a 0, a 1, a 2, … a n, X be input numbers. Goal is to compute : a n X n + a n-1 X n-1 + … + a 1 X + a 0 Can I get better brackets on f ? n+1 ≤ f(n) ≤ 3n -1

In polynomial representation I can think of all the intermediate results as polynomials.

P k (X) = a n X k + a n-1 X k-1 + … + a n-k+1 X + a n-k Goal: Compute P n (X) Inductive Goal (Invariant): Compute P 0 (X), P 1 (X), … p n (X) Slick code [Loop invariant P == P i (X)] P := a n ; For i = 1 to n do P:= P*X + a n-i TOTAL: n mults and n additions. f(n) ≤ 2n

Let a 0, a 1, a 2, … a n, X be input numbers. Goal is to compute : a n X n + a n-1 X n-1 + … + a 1 X + a 0 At any stage we are allowed to ADD or MULTIPLY any two numbers created so far. n+1 ≤ f(n) ≤ 2n

Use your powers for good!

References The Heritage of Thales, by W. S. Anglin and F. Lambek The Book Of Numbers, by J. Conway and R. Guy Programming Pearls, by J. Bentley History of Mathematics, Histories of Problems, by The Inter-IREM Commission