Computer Science 101 Survey of Computer Science

Slides:



Advertisements
Similar presentations
Lecture 2: Developing Procedural Thinking (How to think like a programmer) BJ Furman 06FEB2012.
Advertisements

CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
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.
1 Algorithms Algorithm A set of unambiguous instructions for solving a problem or subproblem in a finite amount of time using a finite amount of data Why.
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.
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.
ITEC113 Algorithms and Programming Techniques
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.
Lecture 14 Go over midterm results Algorithms Efficiency More on prime numbers.
CSci 107 Introduction to Computer Science Lecture 1.
Chapter 2 The Algorithmic Foundations of Computer Science
CHAPTER 2 CS
1 Computing Functions with Turing Machines. 2 A function Domain: Result Region: has:
Agent Portal Status Report The following is a collection of screen prints and brief notes about the agent portal. (January 2008)
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Algorithm. An algorithm is a procedure for solving a problem in terms of the actions to be executed and the order in which those actions are to be executed.
Problem Solving Through Coding Names. PROBLEM SOLVING PROCESS UNDERSTAND THE PROBLEM: READ OR LISTEN TO THE PROBLEM. MAKE A PLAN TO SOVLE THE PROBLEM-
1 Chapter 1 Basic Computer Concept 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: EB 212 TEL: ext. 4337
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 陆嘉恒 中国人民大学 信息学院
Lecture 5: Developing Procedural Thinking (How to think like a programmer) B Burlingame 30 Sept 2015.
CPSC 171 Introduction to Computer Science Algorithm Discovery and Design.
CPSC 171 Introduction to Computer Science More Algorithm Discovery and Design.
Computer Science 101 Introduction.
CSCI-100 Introduction to Computing
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Lecture 3: Developing Procedural Thinking (How to think like a programmer) B Burlingame 16 Feb 2016.
Chapter 6 Programming l Problem solving l Debugging.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Lives and Scoring Games Programming in Scratch. Games Programming in Scratch L2 Lives and Scoring Learning Objectives Define a variable Understand the.
Low-Level Programming Languages, Pseudocode and Testing Chapter 6.
1 Computing Functions with Turing Machines. 2 A function Domain Result Region has:
PROGRAMMING: What’s It All About?
Introduction to Computing Science and Programming I
Topic: Introduction to Computing Science and Programming + Algorithm
Topic: Introduction to Computing Science and Programming + Algorithm
CSIS 104 –Intro. To Computer Science
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Data Structures and Algorithms
Lecture 2 Introduction to Programming
ALGORITHMS & FLOWCHARTING II
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Introduction to Computer Programming
Algorithm and Ambiguity
Lecture 2: Introduction to Algorithms
COMS W1004 Introduction to Computer Science and Programming in Java
Lecture 2 Introduction to Computer Science (continued)
CSci 107 Introduction to Computer Science
Algorithm Discovery and Design
Computing Functions with Turing Machines
Adding 2-Digit Numbers Name: ___________________________
Algorithm Discovery and Design
Algorithms Algorithm. [webster.com] A procedure for solving a mathematical problem (as of finding the greatest common divisor) in a finite number of steps.
Discovery and Design of Algorithms
CMPT 120 Lecture 2 - Introduction to Computing Science – Problem Solving, Algorithm and Programming.
Computer Science 101 A Survey of Computer Science
CPSC 171 Introduction to Computer Science
Presentation transcript:

Computer Science 101 Survey of Computer Science What is computer science?

Course Goals Provide broad view of the field of computer science for purposes of general education. further study of computer science.

Computer Science - NOT JUST The study of computers. The study of computer programming. The study of computer applications.

Algorithm (informal) Algorithm: A step by step procedure for solving a general class of problems. Algorithm: What Bill Clinton plays on his saxophone.

Programming VCR Step 1. If the clock and calendar are not correctly set, then go to page 9 of the owner's manual and follow instructions there. Step 2. Place a blank tape in the VCR tape slot. Step 3. Repeat steps 4-7 for each program, up to 10 times Step 4. Enter the channel number and press CHAN Step 5. Enter time to start and press TIME-START Step 6. Enter time to stop and press TIME-FINISH Step 7. If no more programs, press END-PROG Step 8. Press TIMER

Adding m-digit numbers 478 a2 a1 a0 + 614 +b2 b1 b0 1092 c3 c2 c1 c0

Adding m-digit numbers Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i < m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm c(m-1) … c0 Step 10. Stop

Adding m-digit numbers Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop a2 a1 a0 4 7 8 b2 b1 b0 6 1 4 c3 c2 c1 c0 i Output: 3 m carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 12 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 12 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 2 3 m i Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 2 3 m i Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 1 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 1 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 10 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 10 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 0 9 2 3 m i 2 Output: carry

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 0 9 2 3 m i 2 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 0 9 2 3 m i 3 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 0 9 2 3 m i 3 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 0 9 2 3 m i 3 Output: carry 1

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 1 0 9 2 3 m i 3 Output: carry 1 1 9 2

Adding m-digit numbers a2 a1 a0 4 7 8 Step 1. Set carry to 0 Step 2. Set i to 0 Step 3. While i<m do Step 4. Set ci to ai + bi + carry Step 5. If ci ≥ 10 then Set ci to ci - 10 Set carry to 1 else Set carry to 0 Step 6. Set i to i + 1 Step 7. End-of-loop Step 8. Set cm to carry Step 9. Print cm … c0 Step 10. Stop b2 b1 b0 6 1 4 c3 c2 c1 c0 1 0 9 2 i 3 Output: 1 9 2 3 m carry 1

Algorithm (formal) A well-ordered collection of unambiguous and effectively computable operations that when executed produces a result and halts in a finite amount of time.

Algorithm Well-ordered: There is a clear order in which to do the operations. Unambiguous: Each operation is clearly understood by all intended computing agents. Effectively computable: The computing agent has ability to carry out each operation. Finite time: Each operation takes finite time and there will be a finite number of steps.

Computer Science

They might look like cowboys but they're not cowboys!