Introduction: Content And Method Professors Steven Rudich and Bruce Maggs Carnegie Mellon University CS 15-251 Lecture 1.

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

Types of Algorithms.
Ancient Wisdom: On Raising A Number To A Power Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 5Sept 13, 2005Carnegie.
Introduction to Analysis of Algorithms
June 13, Introduction to CS II Data Structures Hongwei Xi Comp. Sci. Dept. Boston University.
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.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2004 Lecture 1 Jan 13, 2004 Carnegie Mellon University.
Analysis of Algorithms 7/2/2015CS202 - Fundamentals of Computer Science II1.
Chapter 1 Program Design
Information Theory and Security
Coursenotes CS3114: Data Structures and Algorithms Clifford A. Shaffer Yang Cao Department of Computer Science Virginia Tech Copyright ©
Unit 1. Sorting and Divide and Conquer. Lecture 1 Introduction to Algorithm and Sorting.
Introduction - The Need for Data Structures Data structures organize data –This gives more efficient programs. More powerful computers encourage more complex.
Search Lesson CS1313 Spring Search Lesson Outline 1.Searching Lesson Outline 2.How to Find a Value in an Array? 3.Linear Search 4.Linear Search.
Analysis of Algorithms Spring 2015CS202 - Fundamentals of Computer Science II1.
CSCE 3110 Data Structures and Algorithm Analysis.
Group practice in problem design and problem solving
Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2004 Lecture 13Feb 24, 2004Carnegie.
CSE 3101E Design and Analysis of Algorithms Prof. J. Elder.
Discrete Mathematics for Computer Science. Bits of Wisdom on Solving Problems, Writing Proofs, and Enjoying the Pain: How to Succeed in This Class.
Teaching Teaching Discrete Mathematics and Algorithms & Data Structures Online G.MirkowskaPJIIT.
Classroom learning skills Professor Eiad Al-faris.
MATH 224 – Discrete Mathematics
CS Algorithm Analysis1 Algorithm Analysis - CS 312 Professor Tony Martinez.
The Non-Designer’s Design Book
May 19-22,  Become familiar with the Fostering Algebraic Thinking materials.  Examine activities that may be challenging to facilitate. 
Purpose of study A high-quality computing education equips pupils to use computational thinking and creativity to understand and change the world. Computing.
Welcome to CSE Applied Algorithms Anna R. Karlin Office Hours: Wed 9: :00 pm and by appointment TA: Ashish Sabharwal
Mathematics Review and Asymptotic Notation
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
Protocols for Mathematics Performance Tasks PD Protocol: Preparing for the Performance Task Classroom Protocol: Scaffolding Performance Tasks PD Protocol:
Great Theoretical Ideas in Computer Science.
Complexity of algorithms Algorithms can be classified by the amount of time they need to complete compared to their input size. There is a wide variety:
Problem Solving: Where does the “aha!” come from? Great Theoretical Ideas In Computer Science Steven RudichCS Fall 2005 Lecture 15Oct 20, 2005Carnegie.
“The study of algorithms is the cornerstone of computer science.” Algorithms Fall 2011.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
COMPSCI 102 Introduction to Discrete Mathematics.
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
1 CSC 221: Computer Programming I Spring 2008 course overview  What did we set out to learn?  What did you actually learn?  Where do you go from here?
Great Theoretical Ideas in Computer Science.
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.
Algorithms CS280 – 10/20/05. Announcement  Part 1 of project 2 due.  Read chapters 10, 7 for this unit  Tuesday we will also be in the classroom We.
Abstract Representation: Your Ancient Heritage Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2003 Lecture.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Efficiently Solving Computer Programming Problems Doncho Minkov Telerik Corporation Technical Trainer.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Great Theoretical Ideas in Computer Science.
Ancient Wisdom: On Raising A Number To A Power Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 5Sept 12, 2006Carnegie.
Analysis of Algorithms Spring 2016CS202 - Fundamentals of Computer Science II1.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Algorithms and Problem Solving
Analysis of Algorithms
COMP108 Algorithmic Foundations Algorithm efficiency
Analysis of Algorithms
Unit 1. Sorting and Divide and Conquer
UNIT 3 – LESSON 5 Creating Functions.
Maths Workshop October 2017
Objective of This Course
Analysis of Algorithms
4. Computational Problem Solving
Algorithms and Problem Solving
Analysis of Algorithms
Presentation transcript:

Introduction: Content And Method Professors Steven Rudich and Bruce Maggs Carnegie Mellon University CS Lecture 1

Moral: BE PUNCTUAL! Or else you will miss the magic tricks that happen at 3:00pm sharp. Sit close-up: some of the tricks are hard to see from the back.

Course Staff Steven Rudich Bruce Maggs A: Cory Williams B: Pat Riley C: Jason Crawford D: Dominic Mazzoni *: Ke Yang

A volunteer, please.

Putting You On The Spot Four guys want to cross a bridge in the dark of night. They have one flashlight and the bridge can hold only two people at once. 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 in such a way that no one walks in the dark?

You have one minute to solve this problem Four guys want to cross a bridge in the dark of night. They have one flashlight and the bridge can hold only two people at once. 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 in such a way that no one walks in the dark?

That was a Microsoft interview question.

Why do you think that they ask such questions, as opposed to asking for a piece of code to do binary search? That was a Microsoft interview 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

Course Content A survey of fundamental theoretical ideas in Computer Science as they occur in a variety of important applications An introduction to discrete mathematics Effective problem solving, learning, and communication techniques

Please feel free to ask questions!

Course Document Let’s examine it together:

Should I Take The Course? PROS Challenging Cutting Edge Syllabus – No Text Like It Important – Good For Your Future Fun CONS Very Hard No Text -- Impairs Learning For Some Students Lowers GPA – Bad For Your Future “Like Hitting Myself In The Head With A Brick”

Course Content A survey of fundamental theoretical ideas in Computer Science as they occur in a variety of important applications An introduction to discrete mathematics Effective problem solving, learning, and communication techniques

A survey of fundamental theoretical ideas in Computer Science as they occur in a variety of important applications For example...

Growth Rates Input Size Time

Recursion ? ?

Randomization

Hashing

Self Reference

Reduction =

Parallel Versus Sequential Work

Dating

Private Communication

Factoring / Multiplication p, q pq

An introduction to discrete mathematics

Count without counting: Estimate, Calculate, Analyze

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

Map Coloring

Effective problem solving, learning, and communication techniques

Exemplification: Try out a problem or solution on small examples.

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

Modularity: Decompose a complex problem into simpler subproblems

Abstraction: Abstract away the inessential features of a problem =

Refinement: The best solution comes from a process of repeatedly refining and inventing alternative solutions

Build your toolbox of abstract structures and concepts. Know the capacities and limits of each tool.

Similarity: A significant form of intellectual progress is to be able to classify and manipulate distinct objects with regard to a sense in which they are similar. = 13 = 21 (modulo 2)

Please feel free to ask questions!

((( ))) Stationary HandWiggling Hand You have a question or comment of any nature spoken now You have something relevant to say to what is being spoken now

How many yellow dots on this page?

Gauss

n-1+n=S n+n-1+n =S (n+1) + (n+1) + (n+1) (n+1) + (n+1) = 2S n (n+1) = 2S

n-1+n=S n+n-1+n =S (n+1) + (n+1) + (n+1) (n+1) + (n+1) = 2S n (n+1) = 2S

n-1+n=S n+n-1+n =S (n+1) + (n+1) + (n+1) (n+1) + (n+1) = 2S n (n+1) = 2S

n-1+n=S n+n-1+n =S (n+1) + (n+1) + (n+1) (n+1) + (n+1) = 2S n (n+1) = 2S

Let’s restate this argument using a geometric representation Algebraic argument

n = number of white dots.

n = number of white dots = number of yellow dots n

n+1 n+1 n+1 n+1 n+1 = number of white dots = number of yellow dots n n n n n n There are n(n+1) dots in the grid

n+1 n+1 n+1 n+1 n+1 = number of white dots = number of yellow dots n n n n n n

Gauss A first glance, these problems appeared unrelated, but a representational change revealed a correspondence. An extension of the similarity principle is that when we come to understand that seemingly unrelated things are related, we are making intellectual progress.

Appreciate Alternative Solutions To The Same Problem The expert student takes the opportunity to think through the similarities and differences between the approaches When presented with multiple solutions many students remember only the one that they find easiest to understand. The expert student takes the opportunity to think through the similarities and differences between the approaches. Such meditations lay the foundations for effective learning and problem solving.

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

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

Aside to college students It is natural to think that you are really getting your money’s worth when the professor says very complicated things, but the real value is when the professor makes complex things simple. Value Simplicity

Aside to college students A good martial arts student will attentively repeat each fundamental technique many times. In contrast, many college students tune out when a concept (e.g., depth first search) is taught more than once. The better students listen carefully in order to refine and develop their understanding. Repetition Is An Opportunity

If you value simplicity, listen actively to repeated points, and work through the correspondences between different solutions, you are on your way to a lifetime of effective learning and thinking. With diligence, you may someday reduce your brain activity to zero!

The Master Programmer The master seeks an algorithm that will use as small an amount of computer resources (e.g., time, space, communication) as possible. Most “expert” programmers (black belts) will miss the best program because they did not have the patience to refine their solutions further.

A case study. Anagram Programming Task. You are given a 70,000 word dictionary. Write an anagram utility that given a word as input returns all anagrams of that word appearing in the dictionary.

Examples Input: CAT Output: ACT, CAT, TAC Input: SUBESSENTIAL Output: SUITABLENESS

Impatient Hacker (Novice Level Solution) Loop through all possible ways of rearranging the input word Loop through all possible ways of rearranging the input word –Use binary search to look up resulting word in dictionary. –If found, output it

Performance Analysis: Counting Without Executing

“Expert” Hacker (Black Belt Level) Subroutine ANAGRAM(X,Y) returns TRUE exactly when X and Y are anagrams. It works by sorting the letters in X and Y Input X Loop through all dictionary words Y –If ANAGRAM(X,Y) output Y

Comparing an input word with each of 70,000 dictionary entries takes about 15 seconds. The hacker is satisfied and reflects no further

The master keeps trying to refine the solution. The master’s program runs in less than 1/1000 seconds.

Master Solution Don’t keep the dictionary in sorted order! Rearranging the dictionary into anagram classes will make the original problem simple.

Suppose the dictionary was the list below. ASP DOG LURE GOD NICE RULE SPA

After each word, write its “signature” (sort its letters) ASPAPS DOGDGO LUREELRU GODDGO NICECEIN RULEELRU SPAAPS

Sort by the signatures ASPAPS SPAAPS NICECEIN DOGDGO GODDGO LUREELRU RULEELRU

Master Program Input word W X := signature of W Use binary search to find the anagram class of W and output it.

Of course, it takes about 30 seconds to create the dictionary, but it is perfectly fair to think of this as programming time. The building of the dictionary is a one-time cost that is part of writing the program.

Neat! I wish I had thought of that.

Learning Advice Whenever you see something you wish you had thought of, try and formulate the minimal and most general lesson that will insure that you will not miss the same thing the next time. Name the lesson to make it easy to remember.

NAME: Preprocessing It is sometimes possible to pay a reasonable, one-time preprocessing cost to reorganize your data in such a way as to use it more efficiently later. The extra time required to preprocess can be thought of as additional programming effort.

Content and Method