CSC151 2010S, Class 01: An Introduction to Algorithms Overview: * Introduction: What is CS? * Exercise: An everyday algorithm. Admin: * Welcome to 151. * The Course Web site will be in a bit of flux for the first few days. * I will take attendance for the first few days, but I will probably take a month to attach names to faces and perhaps longer to learn to pronounce names correctly. * Two assignments for Tuesday: (sorry about the incorrect date) (1) Take the introductory survey; (2) Read "Grinnell's Linux Environment" (available online). What is Computer Science? * Understanding the language of computers * Further question: What's a computer? * The language may be inscrutable and involve lots of brackets and weird acronyms * A computer is a device that takes input * Some of that input is instructions * The computer uses those instructions to process that input * It usually then outputs the result of that processing * A computer is something that computes * Flaws to that definition: * Doesn't really describe the hardware of the computer * Is a definition of something in terms of what it does a reasonable definition? Yes. * Okay, we know what a computer is. What is *computer science*? * Study of methods of computation * Because "science" means "study" * Scientific method is fun and systematic way to study the world * Observe or read literature, make hypotheses, experiment (repeatable), analyze, conclude, (and refine hypothesis) Possible hypothesis: I can use my computer to do X if I do Y. * Refined: A set of instructions (an "algorithm") will accomplish a particular task * Of course, mathematicians would suggest that you analyze the instructions differently: proof A lot of what computer scientists do is work with algorithms and data structures (ways of organizing data) * Design them * Write them in a particular language * Study the algorithms we or others have written * For correctness * For efficiency * (For elegance) * Consider the effects This is a class about writing algorithms! * So let's write one Debriefing today and tomorrow * What did you learn from this exercise? * You may need to explain everything! * It helps to have some knowledge of what the computer knows and how the computer processes * The first algorithm is rarely perfect. Be prepared to correct flaws * And try to predict errors * Details are helpful * It's helpful to try each part as you go and to correct * You can only use the particular inputs the computer recognizes * IT'S REALLY FUNNY WHEN THINGS GO WRONG!