Welcome
Download
1 / 72

Welcome - PowerPoint PPT Presentation


  • 136 Views
  • Uploaded on

Thinking about Algorithms Abstractly. Welcome. Jeff Edmonds www.cse.yorku.ca\~jeff\courses\3101 [email protected] CSB 3044, ext. 33295 416-538-7413 . Jeff Edmonds York University. Lecture 1. COSC 3101. Course Material. Videos Of my lectures Fall 2011. Slides. Text.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Welcome' - raine


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Welcome

Thinking about Algorithms Abstractly

Welcome

Jeff Edmonds www.cse.yorku.ca\~jeff\courses\3101

[email protected] 3044, ext. 33295

416-538-7413 

Jeff Edmonds

York University

Lecture1

COSC 3101


Course Material

Videos Of my lectures Fall 2011

Slides

Text

Steps, Assignments, Practice Tests, Unit Tests, Exam

Extra Text: Cormen, Leiserson, Rivest, and Stein  "Introductin to Algorithms",

Good to have, but not needed for this course.


Course Material

www.cse.yorku.ca\~jeff\courses\3101\syllabus


  • Was by far the hardest course ever.

  • I got the worst midterm mark ever.

  • I almost gave up.

  • But opened a door to such an interesting world for me.

  • Learned to see things abstractly and from different angles

  • After working a few years, I realized that 3101 was the most useful course I took.


A contract to learn
A Contract to Learn

It deeply saddens me when a third of the class does not learn the material sufficiently to pass.

I will do everything in my power to help you learn this material.

I request that you do everything in your power.

Everyone can learn it.


Tough love
Tough Love

Last year and this summer, I threatened them every day.

They performed better than ever before!

And my course evaluations were better.


Think about algorithms abstractly
Think about Algorithms Abstractly

This course requires completely changing the way you think about algorithms.

Though I keep warning people,

they tend not to get it until they are

Devastated by the midterm

Change your thinking now.


Study now
Study Now!

You spend 50hrs/week on your programming course.

People do work hard on my assignments.

But they don’t really study the material deeplyuntil they fail the midterm.


Marks
Marks

We will work you HARD:

  • 6 assignments

  • 5 practice tests

  • 5 unit tests

  • Participation

  • An exam

  • Mark =

0%

0%  -4%   

4%*5=20%  11%*5=55%   

2%  10%  

35%  78%  

Σi=1..5 [ 0.04 Ti + 0.07 Max(Ti,E) ] 

+ [ 0.02 P + 0.08 Max(P,E) ] + 0.35 E 


Marks1
Marks

5 unit tests:

  • Each unit test, half the class fails. “Fail early, fail often”

  • Then almost everyone starts to listen and passes the exam.

  • Don’t want to people who fail the midterms to give up

  • Want people to work on the midterms

4%*5=20%  11%*5=55%   

7% max(Ti,E)

4% Ti


Marks2
Marks

Class Participation:

  • Asking/Answering questions in class

  • Attending office hours

  • Talking to me outside of class

  • Submitting a photo *


Marks3
Marks

Σi=1..5 [ 0.04 Ti + 0.07 Max(Ti,E) ] 

+ [ 0.02 P + 0.08 Max(P,E) ] + 0.35 E 


Together

I think it is important for people to not feel isolated with the material.


Together

You’re cool! Are you free sometime this weekend?

Yes!The best way to learn is to teach each other!


Together

Some students feel too intimidated to talk to the professor.

Actually, he is just a guywho has been doing this for a while.


Together

Office hours: Before/after class tend to be the best time.Longer or private questions, when requested, can be taken back to my office, CSB 3044.



Is your goal to be a mundane programmer
Is your goal to be a mundane programmer?




Boss assigns task
Boss assigns task:

  • Given today’s prices of pork, grain, sawdust, …

  • Given constraints on what constitutes a hotdog.

  • Make the cheapest hotdog.

Everyday industry asks these questions.


Your answer
Your answer:

  • Um? Tell me what to code.

With more sophisticated software engineering systems,the demand for mundane programmers will diminish.


Your answer1
Your answer:

  • I learned this great algorithm that will work.

Soon all known algorithms will be available in libraries.


Your answer2
Your answer:

  • I can develop a new algorithm for you.

Great thinkers will always be needed.


Course content
Course Content

  • A list of algorithms.

    • Learn their code.

    • Trace them until you are convinced that they work.

    • Implement them.

    • Worry about details.

class InsertionSortAlgorithm extends SortAlgorithm {

void sort(int a[]) throws Exception {

for (int i = 1; i < a.length; i++) {

int j = i;

int B = a[i];

while ((j > 0) && (a[j-1] > B)) {

a[j] = a[j-1];

j--;}

a[j] = B;

}}


Course content1
Course Content

  • A survey of algorithmic design techniques.

  • Abstract thinking.

  • How to develop new algorithms for any problem that may arise.


Study
Study:

  • Many experienced programmers were asked to code up binary search.


Study1
Study:

  • Many experienced programmers were asked to code up binary search.

80% got it wrong

Good thing is was not for a nuclear power plant.



What did they lack1
What did they lack?

  • Formal proof methods?


What did they lack2
What did they lack?

  • Formal proof methods?

Yes, likely

Industry is starting to realize that formal methods are important.

But even without formal methods …. ?


What did they lack3
What did they lack?

  • Fundamental understanding of the algorithmic design techniques.

  • Abstract thinking.


Course content2
Course Content

Notations, analogies, and abstractions

for developing,

thinking about,

and describing algorithms

so correctness is transparent



Some math

Logic Quantifiers techniques

Logs and Exps

g "b Loves(b,g)"b g Loves(b,g)

2a× 2b = 2a+b2log n = n

Time

Classifying Functions

Time Complexity

f(i) = nQ(n)

t(n) = Q(n2)

Input Size

Adding Made Easy

Recurrence Relations

∑i=1 f(i).

T(n) = a T(n/b) + f(n)

Some Math


Iterative algorithms loop invariants

0 techniques

i-1

i

T+1

i

i

9 km

5 km

Iterative Algorithms Loop Invariants

<preCond>

codeA

loop

<loop-invariant>

exit when <exit Cond>

codeB

codeC

<postCond>

One step at a time

Code

Relay Race


Recursive algorithms

? techniques

?

Recursive Algorithms



Network flows
Network Flows techniques


Greedy algorithms
Greedy Algorithms techniques

NEED A PIC HERE

(NOT POOH)



Dynamic programing
Dynamic Programing techniques


Reduction
Reduction techniques

=

  • Rudich www.discretemath.com


Course Material techniques

www.cse.yorku.ca\~jeff\courses\3101\syllabus


Course Material techniques

Steps:

  • For each unit, I spoon feed you the key ideas from each unit as a set of steps.

  • Learn them! Understand them!

  • With only them, you are on your way to passing. Without them, you are on your way to failing.

  • Lectures consists of many examples of using these steps.

    Assignments: Practice key ideas. Do them!

    Practice Tests: Do them!

    Text “How to Think about Algorithms”: Buy it and read it.


Book Slides Videos techniques

Pros

  • Don’t have to take notes.

  • Lower fear level that you will miss something.

  • Flexible to miss a class or two if working, parenting, sick, …

  • Read/watch ahead to be prepared for a good discussion.

  • Read/watch after to review and as a reference.


Book Slides Videos techniques

Pros

  • REALLY good students might feel they don’t have to come to class (some might be right).

    Cons

  • Cocky students will think they don’t need to come classbut are wrong.

  • Lazy students will use them as an excuse to skip classand then never really get to them.

Test every other week!Cant be delayed.


Useful Learning Techniques techniques

Before reading the solutions to the assignments.

  • Work hard on solving them on your on.

  • Study the text and slides.

  • Get help, but not answers from friends, TA, professor, …


Useful Learning Techniques techniques

After reading the solutions to the assignments.

  • Study the solutions.

  • Understand the solutions.

  • Memorize the solutions.

  • The questions on the tests will be different.

  • But the answers will be surprisingly close.


Useful Learning Techniques techniques

Please interact with me in class.

Help me know what people are not understanding

Slow down the slides

(Though we do have a lot of material to cover)


Useful Learning Techniques techniques

Please ask questions!


Useful Learning Techniques techniques

Please ask questions!

  • To keep the flow going

  • Wiggly hand: relevant to current slide.

  • Stationary hand:question about past material.


Useful Learning Techniques techniques

When I ask a question to the class.

Please don’t shout out answers. So others can think.


Useful Learning Techniques techniques

In every class,there is one studentI don’t like.

The key when talking in class is

Are you trying to help me and the classor win some compitition?


Useful Learning Techniques techniques

Please ask questions!

Winter 06, the average of one section was much higher than the average of the other.  (I taught them both)

My theory was that it was because a student, Gertruda, constantly asked great questions and everyone learned from them.

Ask questions for everyone’s sake.

10% of your mark is class participation!


Two years from now: techniques

May I have a letter of reference for grad school?

I find it awkward to write letters for people that I don’t recognize.

Make yourself KNOWN today to SOME professor.


Two years from now: techniques

May I have a letter of reference for grad school?

I find it awkward to write letters for people that I don’t recognize.

Make yourself KNOWN today to SOME professor.

Sorry email does not help as I don’t remember names


Submit a Photo techniques

  • What:

    • Submit a photo on line

    • Add a photo to your forum account

    • If you would like a better rapport with your emails, please include a photo.

  • Why:

    • I am very bad with names. (Sorry)

    • Emails and tests are effectively anonymous.

    • Needed for 10% participation mark.

    • You can see the class list.

  • How:

    • Submit

  •      - cp photo.jpg Smith_John.jpg 

  • - submit 3101 photos Smith_John.jpg

    • Forum

    • - Upload a photo to your Forum Avatar.


Forum techniques

  • I communicate to you via the Forum.

  • You are also encouraged to talk to each other this way.

  • To be sure that you know when something has been posted, it is important to subscribe to the course forum.

  • Be sure to subscribe to the course forum and not just to one of its topics


End techniques

Math

Iterative Algorithms



Read ahead
Read Ahead techniques

You are expected to read the lecture notesbefore the lecture.

This will facilitate more productive discussionduringclass.

Also please proof readassignments & tests.

Like in an English class


Explaining

We are going to test you on your techniquesability to explain the material.

Hence, the best way of studying is to explain the material over and over again out loud toyourself, to each other, and to your stuffed bear.

Explaining


Day dream

W techniqueshile going along with your day

Day Dream

Mathematics is not all linear thinking.

Allow the essence of the materialto seepinto your subconscious

Pursue ideas that percolate up and flashes of inspiration that appear.


Be creative

Be Creative techniques

Ask questions.

Why is it done this way and not thatway?


Guesses and counter examples
Guesses and Counter Examples techniques

  • Guess at potential algorithms for solving a problem.

  • Look forinput instances for which your algorithm gives the wrong answer.

  • Treat it as a game between these two players.


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

  • Rudich www.discretemath.com


Together techniques

This term we will provide two hours a week of contact hours with the TA.

Ask me anything!

  • Class material

  • Help YOU solve the assignment questions.

  • Material missed from previous courses

  • Your love life


Together techniques

This term we will provide two hours a week of contact hours with the TA.

We can have

  • Practice Tests

  • Lectures

  • One-on-one time

  • Group discussions

Yes!I will be sure to attend.


Together techniques

I will take attendance!This will effect your participation mark!

Yes!I will be sure to attend.


Together techniques

Sorry!I will not have time to mark the assignments.

But we can I read your solution together during the TA hours.

This might be better anyway.


Together techniques

Lets schedule the office hours now.


ad