1 / 9

Lecture 1 Introduction

Lecture 1 Introduction. Algorithmic Problem Solving John Woodward. Aim of course. Aim: to help you solve problems, using example driven approach .

uri
Télécharger la présentation

Lecture 1 Introduction

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 1 Introduction Algorithmic Problem Solving John Woodward

  2. Aim of course • Aim: to help you solve problems, using example driven approach. • The problems are not technical, do not require any prior knowledge, and can be understood by anyone. You may have your own problems like this please bring them to seminars. We are not interested in trick questions, even thought they may be entertaining • Problems = puzzles, brainteasers, games. • Problem <- solution <- solution method. • We are not interested in the solution, but how the solution was obtained. • This course is not a list of problems and solutions, but hopefully a list of strategies, ideas and insights into problem solving. • Review what you have done – it confirms to your brain that you have understood. • ENJOY THE COURSE.

  3. Help each other! • If you explain to each other, you are more likely to be able to explain your solutions in the exam. • 'What are the differences between Heaven and Hell?', a young Zen monk asked an aged Buddhist priest who was renowned for his wisdom. • 'There are no material differences,' replied the old monk. • 'None at all?' asked the puzzled young monk. • 'That's right. Both Heaven and Hell have a spacious hall with a big pot in the centre in which noodles are boiled, giving off a delicious scent,' said the old priest. 'The size of the huge pan, the number of people sitting around the pot and the bowl of sauce placed in front of each diner are the same in both places.' • 'The odd thing is that each diner is given a pair of meter-long chopsticks and must use them to eat the noodles.' • 'To eat the noodles, you must hold the chopsticks properly at their ends,' the old monk told the young Zen monk. • 'In the case of Hell's kitchen, people are always hungry because no matter how hard they try, they can't get the noodles into their mouths,' said the old priest. • 'But isn't it the same case for the people in Heaven?' the junior monk inquired. • 'No. They can eat because they each feed the person sitting opposite them at the table. That's the difference between Heaven and Hell,' explained the old monk.

  4. Algorithms • Algorithms = a method, an effective procedure, a sequence of well defined instructions, • Specification – what does the algorithm do • Abstract Implementation – how does it do it (i.e. pseudo code – not in a specific language – maybe a flow diagram) • Concrete implementation – where does it work e.g. in java, in C++ • Proof of correctness – why does it work • Time complexity – when does it work

  5. Definition – Wolfram (Mathworld) • A specific set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point. Specific algorithms sometimes also go by the name method, procedure, or technique. The word "algorithm" is a distortion of al-Khwarizmi, a Persian mathematician who wrote an influential treatise about algebraic methods. The process of applying an algorithm to an input to obtain an output is called a computation.

  6. Flow diagram - Baking

  7. Examples of Algorithms • Euclid's Algorithm – greatest common divisor • How to add two numbers given you only know how to add the numbers 0 to 10. • How to multiply and divide two numbers. • Sorting, finding the maximum.

  8. Review • Lots of examples • You will learn by doing the problems • Algorithms -> well defined procedure for completing some task.

  9. Next lecture • Invariants • As the state of a problem changes – the relationship between variables of the problems may not change • E.g. ??????

More Related