Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Algorithmic Thinking What’s the Plan? lawrence snyder c h a p t e r 10.
COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
Chapter 1 - An Introduction to Computers and Problem Solving
Reference :Understanding Computers
Computer Algorithms. Fact: computers are dumb machines Basic property of a computer (a machine): Computers do what we tell them to do Unfortunately, computer.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the five essential properties of an algorithm.
Chapter 10 Algorithmic Thinking. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives List the five essential.
Chapter 10 What's The Plan?: Algorithmic Thinking.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Introduction to Computers CS Dr. Zhizhang Shen Chapter 10: How to.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
CS /29/2004 (Recitation Objectives) and Computer Science and Objects and Algorithms.
1. By the end of this lecture you should be able … To describe in general terms how computers function To describe the fetch-execute cycle To explain.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
Chapter 2: Algorithm Discovery and Design
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CSCI-100 Introduction to Computing Algorithms Part I.
Lecture # 8 ALGORITHMS AND FLOWCHARTS. Algorithms The central concept underlying all computation is that of the algorithm ◦ An algorithm is a step-by-step.
Simple Program Design Third Edition A Step-by-Step Approach
Algorithms Algorithms are a familiar idea. Our goal is to learn to specify them right so someone or something else does the work.
Invitation to Computer Science, Java Version, Second Edition.
Fundamentals of Algorithms MCS - 2 Lecture # 1
The Algorithmic Model. What is Computer Science What is Programming Algorithms –Definition –Properties of Good Algorithms –Describing Algorithms –Examples.
The Development Process Problem Solving. Problem Solving - Dr. Struble 2 What Is Asked of Computer Programmers? Input Transformation Output Write a computer.
Algorithms CS139 – Aug 30, Problem Solving Your roommate, who is taking CS139, is in a panic. He is worried that he might lose his financial aid.
Lecture 6 Problem Solving: Algorithm Design & Analysis.
Algorithms Algorithms are a familiar idea. Our goal is to learn to specify them right so someone or something else does the work.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
What's The Plan? Algorithmic Thinking Step-by-step directions for whatever someone, or the computer, needs to do © 2004 Lawrence Snyder.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Submitted To: Rutvi sarang Submitted By: Kushal Bhagat.
ALGORITHMS.
Chapter 10 Algorithmic Thinking. Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the.
Algorithms CS280 – 10/20/05. Announcement  Part 1 of project 2 due.  Read chapters 10, 7 for this unit  Tuesday we will also be in the classroom We.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
PROBLEM SOLVING. What is a Problem? A problem is a situation that needs to be resolved.
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Comp1004: Programming in Java II Computational Thinking.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Lecture # 2 Algorithms and Programs. Today Questions: From Homework #1 1.Introduce: What is an Algorithm? 2.Explain: Algorithm defined 3.Demo: Examples.
Algorithms Sept 4, Tuesday’s Lab You developed an algorithm Input – an 8 ½ x 11 inch piece of paper Audience – Fellow classmates Process – Instructions.
Topic: Introduction to Computing Science and Programming + Algorithm
Algorithms, Part 1 of 3 The First step in the programming process
Topic: Introduction to Computing Science and Programming + Algorithm
Introduction to Computer Programming
Algorithm and Ambiguity
PROBLEM SOLVING SKILLS
Computational Thinking for KS3
CSCI 1250 Information Technologies
Algorithm and Ambiguity
Chapter 10: Algorithm TECH Prof. Jeff Cheng.
What's The Plan?: Algorithmic Thinking
Computer Algorithms.
An Introduction to Programming with C++ Fifth Edition
Algorithms vs. Programming
What's The Plan?: Algorithmic Thinking
What's The Plan?: Algorithmic Thinking
Algorithms vs. Programming
Presentation transcript:

Some quotes…. I really hate this damned machine I wish that they would sell it. It never does quite what I want But only what I tell it. ~Anon These machines have no common sense; they have not yet learned to think, and they do exactly as they are told, no more and no less. This fact is the hardest concept to grasp when one first tries to use a computer. ~Donald Knuth 10/14/2015D.A. Clements, UW Information School1

Announcements Ian King returns on Friday History of Computing, Part 2 10/14/ D.A. Clements, UW Information School

What's The Plan? Algorithmic Thinking Step-by-step directions for whatever someone, or the computer, needs to do © 2004 Lawrence Snyder 10/14/ D.A. Clements, UW Information School

10-4 Algorithm A precise, systematic method for producing a specified result In real life we do this all the time: 10/14/2015D.A. Clements, UW Information School

Video Algorithms 10/14/ D.A. Clements, UW Information School

What is an algorithm? Algorithm is a procedure and sequence of actions to accomplish some task. The concept of an algorithm is often illustrated by the example of a recipe, although many algorithms are much more complex; algorithms often have steps that repeat (iterate) or require decisions (such as logic or comparison). In most higher level programs, algorithms act in complex patterns, each using smaller and smaller sub-methods which are built up to the program as a whole. Source: Computer User's online dictionaryComputer User's online dictionary 10/14/ D.A. Clements, UW Information School

Algorithms in our everyday lives Directions to our home, workplace, or the shopping mall to meet friends Recipes Patterns For sewing clothes or soft furnishings For knitting or crochet Plans for building furniture Owners’ manuals 10/14/2015D.A. Clements, UW Information School 7

Algorithms in our everyday lives Each algorithm Solves a problem Can be repeated over and over With the same results 10/14/2015D.A. Clements, UW Information School 8

Video Algorithm example 10/14/ D.A. Clements, UW Information School

Clicker questions 10/14/ D.A. Clements, UW Information School

Algorithms in our everyday lives Always consider the audience Is your friend familiar with North Seattle? How much experience with baking does your friend have? If you’re going to add RAM to your laptop yourself, you’re probably fairly technically competent 10/14/2015D.A. Clements, UW Information School 11

Language in Algorithms Natural language For people, we use a natural language like English Ambiguity is common in natural language Programming Language Formal languages designed to express algorithms Precisely defined; no ambiguity 10/14/2015D.A. Clements, UW Information School12

D.A. Clements, UW Information School10/14/2015 How are algorithms organized? Title 13

D.A. Clements, UW Information School10/14/2015 How are algorithms organized? Title Ingredients 14

D.A. Clements, UW Information School10/14/2015 How are algorithms organized? Title Ingredients Steps 15

D.A. Clements, UW Information School10/14/2015 How are algorithms organized? Title Ingredients Steps Servings 16

Title Ingredients Steps Exceptions Servings 10/14/2015D.A. Clements, UW Information School 17 How are algorithms organized?

Title Ingredients Steps Exceptions When to stop Servings 10/14/2015D.A. Clements, UW Information School 18 How are algorithms organized?

The Five Essential Properties of Algorithms 1. Input specified Data to be transformed during the computation to produce the output Must specify type, amount, and form of data 2. Output specified Data resulting from the computation—intended result It is possible to have no output 10/14/2015D.A. Clements, UW Information School19

Five Essential Properties (cont'd) 3.Definiteness Specify the sequence of events Details of each step, including how to handle errors 4.Effectiveness The operations are do-able 5.Finiteness Must eventually stop 10/14/2015D.A. Clements, UW Information School20

Clicker questions 10/14/2015D.A. Clements, UW Information School 21

Context matters—sorting names Program can fulfill five properties of an algorithm, be unambiguous, and still not work right because it is executed in the wrong context e.g., last name in Western countries means family name; in Asian countries it may mean given name 10/14/2015D.A. Clements, UW Information School22

Context matters—driving instructions Driving instructions "From 45 th go to University Avenue and turn right." Assumes you are traveling in a specific direction. If you are not, the directions will fail. Diagram of approaching a street (the Ave) from different directions, giving the "turn right" instruction different meanings 10/14/2015D.A. Clements, UW Information School23

Baking bread…. The final baking step depends on the type of oven Source: 10/14/2015D.A. Clements, UW Information School 24 Context matters—bread ovens

Context Matters—electric ovens 10/14/2015D.A. Clements, UW Information School 25

Context Matters—brick ovens 10/14/2015D.A. Clements, UW Information School 26

Context matters—bread machine 10/14/2015D.A. Clements, UW Information School 27

Program vs. Algorithm A program is an algorithm that has been customized to solve a specific task under a specific set of circumstances using a specific language Algorithm is general Program is specific 10/14/2015D.A. Clements, UW Information School28

A practice algorithm… Grab a piece of paper In the next few slides, I’ll name the property of an algorithm and you can fill in the blanks for making a salad. 10/14/2015D.A. Clements, UW Information School 29

Algorithm: Input specified Algorithm for preparing a salad 1. Input specified 10/14/2015D.A. Clements, UW Information School 30

Algorithm—Output specified 10/14/2015D.A. Clements, UW Information School 31 Algorithm for preparing a salad 2. Output specified

Algorithm— Definiteness & Effectiveness Algorithm for a preparing salad 10/14/2015D.A. Clements, UW Information School 32 Algorithm for preparing a salad 3. Definiteness 4. Effectiveness

Algorithms--Finiteness 10/14/2015D.A. Clements, UW Information School 33 Algorithm for preparing a salad 5. Finiteness

Clicker questions 10/14/2015D.A. Clements, UW Information School 34

CD or DVD sorting in a rack Exchange sort algorithm 10/14/ D.A. Clements, UW Information School

10-36 Exchange Sort Algorithm The Alphabetize CDs example illustrates the standard Exchange Sort algorithm The idea of comparing pairs of items chosen in a particular way, exchanging them if they are out of order, and continuing to sweep through the items We could use the same algorithm to sort on a different principle 10/14/2015D.A. Clements, UW Information School

Friday Learn the vocabulary on GoPost 10/14/2015D.A. Clements, UW Information School 37