1 Chapter 1 Basic Computer Concept 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: EB 212 TEL: 05-5342601 ext. 4337

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

CS107: Introduction to Computer Science Lecture 2 Jan 29th.
Computer Science 101 Survey of Computer Science What is computer science?
CSci 107 Introduction to Computer Science Lecture 1.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
1 CS1000 Introduction to Computer Science Instructor Soufiane Noureddine Lectures Tu/Th: 12:15-13:30 (B650) Office Hours Tu/Th: 11:00-12:00 (C520)
Computer Science 101 Overview of Algorithms. Example: Make Pancakes Prepare batter Beat 2 eggs Add 1 tablespoon of brown sugar Add 1 cup of milk Add 2.
Csci 107 Introduction to Computer Science. Administrativia See class webpage for –Office hours –Grading policy –Syllabus –Lab assignments –Readings.
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.
ITEC113 Algorithms and Programming Techniques
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, Java Version, Third Edition.
Computer Software & Software Development H&K Chapter 1 Instructor – Gokcen Cilingir Cpt S 121 (June 20, 2011) Washington State University.
CS107 Introduction to Computer Science Lecture 1 Introduction.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, C++ Version, Third Edition.
What is an algorithm? Informally: An Algorithm is a step by step method for solving a problem. It’s purpose is to break a larger task down so that each.
Chapter 2: Algorithm Discovery and Design
CMPUT101 Introduction to Computing(c) Yngvi Bjornsson1 An Introduction to Computer Science Chapter 1 Topics: The Definition of Computer Science Algorithms.
CSci 107 Introduction to Computer Science Lecture 1.
Programming Concepts (Part A) Ping Hsu. What is a program? WHITE CAKE RECIPE 1.Preheat oven to 350 degrees F (175 degrees C). 2.Grease and flour a 9x9.
Chapter 2: Algorithm Discovery and Design
COMS W1004 Introduction to Computer Science May 28, 2008.
Chapter 2 The Algorithmic Foundations of Computer Science
Chapter 1: An Introduction to Computer Science
CS10051 Section 601 Introduction to Computer Science Fall 08 Dr. Angela Guercio Dr. C. David Hunter.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, C++ Version, Fourth Edition --slides rearranged by Shannon Steinfadt for.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, C++ Version, Third Edition Several Slides added to by Shannon Steinfadt,
Chapter 2: Algorithm Discovery and Design
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.
Chapter 1 An Introduction to Computer Science
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, Java Version, Third Edition.
CSCI-100 Introduction to Computing Algorithms Part I.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
The Algorithmic Model. What is Computer Science What is Programming Algorithms –Definition –Properties of Good Algorithms –Describing Algorithms –Examples.
CSE 102 Introduction to Computer Engineering What is an Algorithm?
1 Invitation to Computer Science 6 th Edition Chapter 1 An Introduction to Computer Science.
Introduction to Algorithms. What is Computer Science? Computer Science is the study of computers (??) This leaves aside the theoretical work in CS, which.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
CPSC 171 Introduction to Computer Science More Algorithm Discovery and Design.
Computer Science 101 Introduction.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation Dale Roberts, Lecturer Computer Science,
CSCI-100 Introduction to Computing
Chapter 10 Algorithmic Thinking. Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Invitation to Computer Science 5 th Edition Chapter 2 The Algorithmic Foundations of Computer Science.
Lecture 3: Developing Procedural Thinking (How to think like a programmer) B Burlingame 16 Feb 2016.
Opportunities and Challenges Unique aspect of CS How to succeed in CS study? IITG Team Contributors: S. Zhang. A. Hoskey.
Computer Systems Architecture Edited by Original lecture by Ian Sunley Areas: Computer users Basic topics What is a computer?
Low-Level Programming Languages, Pseudocode and Testing Chapter 6.
Data Structures and Algorithms
Lecture 2: Introduction to Algorithms
COMS W1004 Introduction to Computer Science and Programming in Java
Foundations of Computer Science
Lecture 2 Introduction to Computer Science (continued)
CSci 107 Introduction to Computer Science
Algorithm Discovery and Design
Computer Science Core Concepts
Computer Science 101 Survey of Computer Science
Presentation transcript:

1 Chapter 1 Basic Computer Concept 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: EB 212 TEL: ext

2 Textbook G. Michael Schneider & Judith L. Gersting, “ Invitation to Computer Science C++ Version ”, 3rd Edition, 2004, ISBN: 台灣代理商:滄海書局 Tel : Fax :

3 A few Common Misconceptions about Computer Science Misconception 1:  Computer science is the study of computers. Many researchers investigate problems not with actual computers but rather with formal models of computation, which are easier to study and analyze mathematically. Misconception 2:  Computer science is the study of how to write computer programs. Programming is so primarily as a tool by which researchers can study new ideas and build and test new solutions. Misconception 3:  Computer science is the study of the uses and applications of computers and software. The computer scientist is responsible for specifying, designing, building, and testing software packages as well as the computer systems on which they run.

4 The Definition of Computer Science The central concept in computer science is the algorithm. [Gibbs and Tucker, 1986] Computer science is the study of algorithms, including:  1. Their formal and mathematical properties  2. Their hardware realizations  3. Their linguistic realizations  4. Their applications

5 The Definition of Computer Science (cont.) Based on the definition, the tasks of the computer scientist are  Study the behavior of algorithms to determine whether they are correct and efficient.  Designing and building computer systems that are able to execute algorithms  Designing programming languages and translating algorithms into these languages so that they can be executed by the hardware.  Identifying important problems and designing correct and efficient software packages to solve these problems.

6 The Definition the word Algorithm Algorithm:  A procedure for solving a mathematical problem in a finite number of steps that frequently involves repetition of an operation; broadly: a step-by-step method for accomplishing some task.  An algorithm is an ordered sequence of instructions that is guaranteed to solve a specific problem. It looks like: Step 1 Do something Step 2 Do something Step 3 Do something : : Step N Stop, you are finished

7 Three categories of operations The operations used to construct algorithms can be categorized as  Sequential operations : carries out a single well-defined task, usually expressed as simple declarative sentences.  Conditional operations : “ question-asking ” instructions of an algorithm  Iterative operations : “ looping ” instructions of an algorithm.

8 Example: Algorithm for Programming the VCR Step1 :  If the clock calendar are not correctly set, then go to page 9 of the instruction manual and follow the instructions there before proceeding. Step2 :  Place a blank tape into the VCR tape slot. Step3 :  Repeat step 4 through 7 for each program that you wish to record, up to maximum of 10 shows. Step4 :  Enter the channel number that you wish to record, and press the button labeled CHAN.

9 Algorithm for Programming the VCR (cont.) Step5 :  Enter the time that you wish recording to start, and then press the button labeled TIME-START. Step6 :  Enter the time that you wish recording to stop, and then press the button labeled TIME-FINISH. Step7 :  This completes the programming of one show. If you do not wish to record anything else press the button labeled END-PROG. Step8 :  Press the button labeled TIMER. Your VCR is now ready to record.

10 Example: Algorithm for Adding Two m-digit Numbers Given m >=1 and two positive numbers each containing m digits: a m-1 a m-2 …… a 0 and b m-1 b m-2 ……b 0 Wanted: c m-1 c m-2 …c 0 where c m-1 c m-2 …c 0 = (a m-1 a m-2 …… a 0 )+ (b m-1 b m-2 ……b 0 )

11 Example: Algorithm for Adding Two m-digit Numbers Step 1:  Set the value of carry to 0 Step 2:  Set the value of i equal to the value 0 Step 3:  Repeat the instructions in steps 4 through 6 until the value of i is greater than m-1 Step 4:  Add the two digits a i and b i to the current value of carry to get c i Step 5:  if c i >= 10, reset c i to (c i -10) and reset the value of carry to 1; otherwise, set the new value of carry to 0 Step 6:  Add 1 to i, effectively moving one column to the left

12 Algorithm for Adding Two m-digit Numbers (cont.) Step 7:  set c m to the value of carry Step 8:  print out the final answer, c m c m-1 c m-2 … … … c 0 Step 9:  Stop

13 Analyzing the algorithm Steps 1,2,4,6,7,8,9: sequential operations Step 5: conditional operations Step 3: iterative operations

14 Why formalizing the steps? Why are formal algorithms so important in computer science ?  If we can specify an algorithm to solve a problem, then we can automate its solution.  The machine, robot, person, or thing carrying out the steps of the algorithm is called a computing agent. Computer science can be viewed as “ the science of algorithmic problem solving ”. Computability: is it true that every problem can be solved algorithmically?  Unsolvable problem  To specify an algorithm, but it would take a computing agent so long to execute that the solution is useless. Ex. Chessboard: brute force algorithm 假設在每一狀態有 40 個合法的移動,每盤棋約 30 步,則決定下第一步可有 40x40x40x…x40=40 30 =10 48 假設每秒可評估 步,則須花 3x10 25 年才能下哪一步。  We do not yet know how to solve algorithmically. Ex. intelligence

15 The Formal definition of an Algorithm The formal definition of an algorithm  A well-ordered collection of unambiguous and effectively computable operations that, when, executed, produces a result and halts in a finite amount of time.

16 Examples of algorithms shampooing instructions Step 1Wet hair Step 2Lather Step 3Rinse Step 4Repeat

17 Examples of algorithms making a cherry pie Step 1:Make the crust 1.1Take one and one-third cups flour 1.2Sift the flour 1.3Mix the sifted flour with one-half cup butter and one- fourth cup water. 1.4Roll into two 9-inch pie crusts. Step 2:Make the cherry filling 2.1Open a 16-oz can of cherry pie filling and pour into bowl 2.2Add a dash of cinnamom and nutmeg, and stir. Step 3:Pour the filling into the crust Step 4:Bake at 350F for 45 minutes.

18 Unambiguous  An unambiguous operation is one that can be understood and carried out directly by the computing agent without needing to be further simplified or explained.  An operation is unambiguous, we call it a primitive operation  It is not enough for an operation to be understandable. It must also be doable by the computing agent.  Doable means there exists a computational process that allows the computing agent to complete that operation successfully. Effectively computable.

19 Examples of algorithms prime number Step 1: Generate a list L of all the prime numbers: L 1, L 2, L 3,… Step 2: Sort the list L into ascending order. Step 3:Print out the 100th element in the list L 100. Step 4:Stop Not doable

20 Some examples of operations that may not be effectively computable:  Write out the exact decimal value .  Set average to sum/number  Set the value of result to (N) 1/2  Add 1 to the current value of x

21 … halts in a finite amount of time.  The result must be produced after the execution of a finite number of operations.  We must guarantee that the algorithm eventually reaches a statement that says “Stop, you are done”

22 A correct solution to the Shampooing problem (1) Step 1:Wet your hair. Step 2:Set the value of WashCount to 0 Step 3:Repeat step 4 through 6 until the value of WashCount equals 2. Step 4:Lather your hair Step 5:Rinse your hair Step 6:Add 1 to the value of WashCount Step 7:Stop, you have finished shampooing your hair.

23 A correct solution to the Shampooing problem (2) Step 1:Wet your hair Step 2:Lather your hair Step 3:Rinse your hair Step 4:Lather your hair Step 5:Rinse your hair Step 6:Stop, you have finished shampooing your hair.