Lecture 1: Course Overview - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Lecture 1: Course Overview

Description:

Dough recipe is not a legal computer program. Main constraints. available resources ... Search key S. Output. yes if S is in n1, n2, ..., nk, no otherwise. 16 ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 22
Provided by: Eri770
Learn more at: http://www.cse.msu.edu
Category:

less

Transcript and Presenter's Notes

Title: Lecture 1: Course Overview


1
Lecture 1 Course Overview
  • Course CSE 360
  • Instructor Dr. Eric Torng
  • TA Huamin Chen

2
Topics
  • Course Overview
  • Algorithms
  • Models of Computation
  • Problems
  • Functions or Program Specification
  • What we will be doing in this course

3
What do people do with computers?
  • One answer
  • Run programs on them.

4
What is a program?
  • Algorithm
  • define difference later
  • List of instructions
  • finite
  • definite no ambiguity

5
Examples
  • Dough recipe
  • Maximum program

6
Dough recipe
  • Ingredients
  • 3 cups flour
  • 1 cup water
  • Instructions
  • bring water to boil
  • thoroughly mix flour and boiling water
  • refrigerate overnight

7
Maximum program
  • Variables
  • integer array A100
  • integer max, i
  • Instructions
  • max A0
  • for (i1ilt100i)
  • IF Ai gt max THEN max Ai
  • return max

8
Models of Computation
  • A model of computation is a programming language
  • Defines concept of legal programs
  • Dough recipe is not a legal computer program
  • Main constraints
  • available resources
  • possible operations
  • (also other parameters)

9
Difference between program and algorithm
  • Algorithm
  • high level idea
  • Program
  • implementation of algorithm in a specific
    programming language/computational model
  • Different programs can implement the same high
    level algorithm

10
Initial Model of Computation
  • C programming language
  • Modified Churchs Thesis
  • C is a general model of computation
  • Any algorithm can be expressed as a C program
  • If some algorithm cannot be expressed by a C
    program, it cannot be expressed in any reasonable
    programming language

11
What does an algorithm do?
  • A specific program/algorithm is written to solve
    a specific problem.

12
What is a problem?
  • A problem is a mapping or function between a set
    of inputs and a set of outputs
  • Example
  • Sorting problem
  • Input x 4 2 3 1
  • Output f(x) 1 2 3 4

13
Sorting problem
(4,2,3,1)
(1,2,3,4)
(3,1,2,4)
(7,5,1)
(1,5,7)
(1,2,3)
(1,2,3)
Inputs
Outputs
14
How to specify a problem
  • Input
  • Describe what an input instance looks like
  • Output
  • Describe what task should be performed on the
    input
  • In particular, describe what output should be
    produced

15
Example Problems
  • Sorting Problem
  • Input
  • Integers n1, n2, ..., nk
  • Output
  • n1, n2, ..., nk in nondecreasing order
  • Find element problem
  • Input
  • Integers n1, n2, , nk
  • Search key S
  • Output
  • yes if S is in n1, n2, , nk, no otherwise

16
Observation
  • A problem is a SPECIFICATION for a program
  • In our case, a problem is very cleanly defined
    and thus there should be little ambiguity in what
    is being requested
  • This is not always true in real life

17
What a computer programmer does
  • 1) Client gives a problem description to the
    programmer
  • often unclear
  • ask questions!
  • 2) You design an algorithm/program to solve the
    problem.

18
What do people do with problems?
  • In programming courses
  • Develop programs to solve these problems
  • In this course
  • 1) We will show there exist problems which cannot
    be solved by any C program
  • Churchs Thesis
  • What is it and why is it important in this
    context?
  • Techniques used
  • Diagonalization technique
  • Reduction technique

19
What will we do in this course?
  • 2) We then will study restricted computational
    models
  • Study what can be done
  • Study what cannot be done

20
Quick Review
  • Group work
  • What is a model of computation?
  • What is a problem?
  • How do we specify a problem?
  • What do programming courses teach you to do with
    problems?
  • What is one thing we are going to teach you about
    problems in this course?

21
Key Concepts
  • Algorithms and programs
  • models of computation/programming languages
  • Problems
  • function
  • program specification
  • Unsolvable problems
Write a Comment
User Comments (0)
About PowerShow.com