1 / 21

Programming Practicum

Programming Practicum. Day 1: Introduction and Problem Solving Aaron Tan NUS School of Computing. Contents. Why are You here? What is Computer Science? What is Problem Solving? What is Algorithmic Problem Solving?. Why are You here?. What are your objectives?

Télécharger la présentation

Programming Practicum

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. Programming Practicum Day 1: Introduction and Problem Solving Aaron Tan NUS School of Computing

  2. Contents • Why are You here? • What is Computer Science? • What is Problem Solving? • What is Algorithmic Problem Solving? [Programming Practicum, December 2009]

  3. Why are You here? What are your objectives? What is your level of programming skills? What you think programming is about? [Programming Practicum, December 2009] 3

  4. What is Computer Science? (1/2) Computing Curricula 2001 (Computer Science) Report identifies 14 knowledge focus groups Applications within and outside of Computing • Discrete Structures (DS) • Programming Fundamentals (PF) • Algorithms and Complexity (AL) • Architecture and Organization (AR) • Operating Systems (OS) • Net-Centric Computing (NC) • Programming Languages (PL) • Human-Computer Interaction (HC) • Graphics and Visual Computing (GV) • Intelligent Systems (IS) • Information Management (IM) • Social and Professional Issues (SP) • Software Engineering (SE) • Computational Science (CN) [Programming Practicum, December 2009] 4

  5. What is Computer Science? (2/2) Some recommended readings How to Think about AlgorithmsJeff Edmonds, Cambridge, 2008 Algorithmics: The Spirit of ComputingDavid Harel, 2nded, Addison-Wesley (3rd ed. available) Introduction to AlgorithmsT.H. Cormen, C.E. Leiserson, R.L. Rivest, C. Stein, 2nded, MIT Press The New Turing Omnibus: 66 Excursions in Computer ScienceA.K. Dewdney, Holt [Programming Practicum, December 2009] 5

  6. Problem Solving Process (1/5) • Analysis • Design • Implementation • Testing • Determine the inputs, outputs, and other components of the problem. • Description should be sufficiently specific to allow you to solve the problem. [Programming Practicum, December 2009]

  7. Problem Solving Process (2/5) • Analysis • Design • Implementation • Testing • Describe the components and associated processes for solving the problem. • Straightforward and flexible • Method – process • Object – component and associated methods [Programming Practicum, December 2009]

  8. Problem Solving Process (3/5) • Analysis • Design • Implementation • Testing • Develop solutions for the components and use those components to produce an overall solution. • Straightforward and flexible [Programming Practicum, December 2009]

  9. Problem Solving Process (4/5) • Analysis • Design • Implementation • Testing Test the components individually and collectively. [Programming Practicum, December 2009]

  10. Problem Solving Process (5/5) [Programming Practicum, December 2009]

  11. Problem Solving Exercises • The exercises in the next few slides are of varied nature, chosen to illustrate the extent of general problem solving. • Different kinds of questions require different domain knowledge and strategies. • Apply your problem solving skills and creativity here! [Programming Practicum, December 2009]

  12. Exercise #1: Bear • A bear, starting from the point P, walked one mile due south. Then he changed direction and walked one mile due east. Then he turned again to the left and walked one mile due north, and arrived at the point P he started from. What was the colour of the bear? [Programming Practicum, December 2009]

  13. Exercise #2: Silver chain • A traveller arrives at an inn and intends to stay for a week. He has no money but only a silver chain consisting of 7 links. He uses one link to pay for each day spent at the inn, but the innkeeper agrees to accept no more than one broken link. How should the traveller cut up the chain in order to settle accounts with the innkeeper on a daily basis? [Programming Practicum, December 2009]

  14. Exercise #3: Glasses of milk • Six glasses are in a row, the first three full of milk, the second three empty. By moving only one glass, can you arrange them so that empty and full glasses alternate? [Programming Practicum, December 2009]

  15. Exercise #4: Puzzles • What am I? • You can catch me but not throw me. • I go all around the world but stay in the corner. • You throw away the outside and eat the inside. Then you eat the outside and throw away the inside. [Programming Practicum, December 2009]

  16. Exercise #5: Mad scientist • A mad scientist wishes to make a chain out of plutonium and lead pieces. There is a problem, however. If the scientist places two pieces of plutonium next to each other, BOOM!!! The question is, in how many ways can the scientist safely construct a chain of length n? [Programming Practicum, December 2009]

  17. Exercise #6: Dominoes • Figure 1 below shows a domino and Figure 2 shows a 44 board with the two squares at opposite corners removed. How do you show that it is not possible to cover this board completely with dominoes? All dominoes should lay flat on the board, without overlapping one another, and should not cover area outside the board. Figure 1. A domino. Figure 2. A 44 board with 2 corner squares removed. • General case: How do you show the same for an nn board with the two squares at opposite corners removed, where n is even? • Special case: How do you show the same for an nn board with the two squares at opposite corners removed, where n is odd? [Programming Practicum, December 2009]

  18. Exercise #7: Triominoes • Figure 3 below shows a triomino and Figure 4 shows a 4  4 board with a defect (hole) in one square. • How do you show that the board can be covered with triominoes? Figure 3. A triomino. Figure 4. A 44 board with a hole. • General case: How do you show that a 2n 2n board (where n 1) with a hole in one square (anywhere on the board) can be covered with triominoes? [Programming Practicum, December 2009]

  19. Algorithm Input Output Algorithmic Problem Solving • An algorithm is a well-defined computational procedure consisting of a set of instructions, that takes some value or set of values, as input, and produces some value or set of values, as output. [Programming Practicum, December 2009]

  20. Task 3: NE-Paths To find the number of north-east paths between any two points. North-east (NE) path: you may only move northward or eastward. How many NE-paths between A and C? C A A A A [Programming Practicum, December 2009] 20

  21. THE END

More Related