welcome n.
Download
Skip this Video
Download Presentation
Welcome

Loading in 2 Seconds...

play fullscreen
1 / 72

Welcome - PowerPoint PPT Presentation


  • 136 Views
  • Uploaded on

Thinking about Algorithms Abstractly. Welcome. Jeff Edmonds www.cse.yorku.ca\~jeff\courses\3101 jeff@cse.yorku.ca 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


Download Now 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

jeff@cse.yorku.caCSB 3044, ext. 33295

416-538-7413 

Jeff Edmonds

York University

Lecture1

COSC 3101

slide2

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.

slide3

Course Material

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

slide4

What do you think about 3101?

  • 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 

slide13

Together

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

slide14

Together

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

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

slide15

Together

Some students feel too intimidated to talk to the professor.

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

slide16

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.

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

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

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

greedy algorithms
Greedy Algorithms

NEED A PIC HERE

(NOT POOH)

reduction
Reduction

=

  • Rudich www.discretemath.com
slide44

Course Material

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

slide45

Course Material

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.

slide46

Book Slides Videos

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.
slide47

Book Slides Videos

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.

slide48

Useful Learning 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, …
slide49

Useful Learning 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.
slide50

Useful Learning 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)

slide51

Useful Learning Techniques

Please ask questions!

slide52

Useful Learning Techniques

Please ask questions!

  • To keep the flow going
  • Wiggly hand: relevant to current slide.
  • Stationary hand:question about past material.
slide53

Useful Learning Techniques

When I ask a question to the class.

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

slide54

Useful Learning 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?

slide55

Useful Learning 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!

slide56

Two years from now:

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.

slide57

Two years from now:

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

slide58

Submit a Photo

  • 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.
slide59

Forum

  • 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
slide60

End

Math

Iterative Algorithms

read ahead
Read Ahead

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 yourability 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

While 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

Ask questions.

Why is it done this way and not thatway?

guesses and counter examples
Guesses and Counter Examples
  • 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.
slide67
Refinement:The best solution comes from a process of repeatedly refining and inventing alternative solutions
  • Rudich www.discretemath.com
slide68

Together

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
slide69

Together

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.

slide70

Together

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

Yes!I will be sure to attend.

slide71

Together

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.

slide72

Together

Lets schedule the office hours now.