CSC151 2010S, Class 02: An Introduction to CSC151 Overview: * Lessons from day one. * Common parts of an algorithm. * About the course. * Some administrative details (maybe). * Getting started with Linux. Admin: * I have not started reading through your answers to the introductory survey. Expect answers to questions Friday. * To read for tomorrow's class: The GNU Image Manipulation Program. * Are there questions on yesterday's class? * What's the most fun you've had misinterpreting instructions on PBJ? "Broad face" * Are there questions on getting access to the stuff I type on the overhead? Lessons from PB&J * Yesterday's claims * 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 useful 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! * Additional observations * It's valuable when things go wrong because it helps you fix it next time * Um ... The Universal Machine is useful * Sam is a bozo * You need to worry about special cases (e.g., you can have jars of preserves that have pull caps instead of twist caps) * Define every thing * If we're going to have to restrict ourselves to what the computer knows, we should have a list of what the computer knows (actions, objects) * Once we've written a set of instructions, we may want to substitute in other objects in those instructions * That can also lead to problems * It's useful to break the large problem up into smaller chunks * For elegance * It's easier to test smaller pieces * We can learn from other people * From their solutions * From working in groups * This stuff takes a lot of time, it's important to allocate enough time to writing a solution * Sam needs to learn this lesson * Some dialog is useful * Reflects back on the "try a little at a time" * Things might be faster if we used multiple computers * Computers don't learn from their mistakes. They only do what you tell them. * If you write specific enough instructions, the computer will *probably* do what you want Let's talk about what goes into an algorithm * We'll need to learn how to express these in the langauge of the computer over the course of the semester * Thing one: We name values: Variables * Thing two: We sequence operations * Thing three: We make choices: Conditionals * Thing four: We repeat operations: Repetition, Loops * Sometimes: Until a condition holds * Sometimes: A fixed number of times * Thing five: We like to group together smaller parts of an algorithm and reuse them * Called: subroutines or procedures or functions * We sometimes parameterize subroutines: Choose different inputs * Thing six: Algorithms typically take inputs and produce outputs We'll learn how to do all of this in a particular language, called Scheme. (We'll talk about Scheme on Friday) Learned about Sam: "Extensive documentation online" Learned about course: * A course in writing and thinking about algorithms * Using a particular domain of pretty pictures * A different way of thinking * We'll do our best to get you through it * You'll do a lot of work in "workshop style" education * We hope you'll learn a lot