Lecture 2: Fundamental Concepts

Slides:



Advertisements
Similar presentations
Formal Models of Computation Part III Computability & Complexity
Advertisements

College of Information Technology & Design
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1 Overview 7.1 Introduction to Arrays 7.2 Arrays in Functions 7.3.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
1 Lecture 4 Topics –Problem solving Subroutine Theme –REC language class The class of solvable problems Closure properties.
1 Module 3: Classifying Problems One of the main themes of this course will be to classify problems in various ways –By solvability Solvable, “half-solvable”,
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Lecture 9 Recursive and r.e. language classes
1 Lecture 14 Language class LFSA –Study limits of what can be done with FSA’s –Closure Properties –Comparing to other language classes.
1 Module 13 Studying the internal structure of REC, the set of solvable problems –Complexity theory overview –Automata theory preview Motivating Problem.
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
CSE115/ENGR160 Discrete Mathematics 02/24/11 Ming-Hsuan Yang UC Merced 1.
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
Module 5 Topics Proof of the existence of unsolvable problems
1 Lecture 1: Course Overview Course: CSE 360 Instructor: Dr. Eric Torng TA: Huamin Chen.
1 Module 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 10 Proving more specific problems are not recursive Reduction technique –Use subroutine theme to show that if one problem is unsolvable, so is.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
CSE 830: Design and Theory of Algorithms
1 Lecture 2 Topics –Importance of this material Fundamental Limitations –Connecting Problems and Languages Problems –Search, function and decision problems.
1 Lecture 7 Halting Problem –Fundamental program behavior problem –A specific unsolvable problem –Diagonalization technique revisited Proof more complex.
1 Lecture 18 Closure Properties of Language class LFSA –Remember ideas used in solvable languages unit –Set complement –Set intersection, union, difference,
Foundations of (Theoretical) Computer Science
Chapter 1 pp 1-14 Properties of Algorithms Pseudocode.
1 Lecture 10 Universal Algorithms –moving beyond one problem at a time –operating system/general purpose computer.
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Module 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
1 Lecture 7 Topics –Problems about program behavior At least problem input is a program/algorithm –Halting Problem Fundamental problem about program behavior.
1 Module 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Turing Machines CS 105: Introduction to Computer Science.
1 Lecture 11 Proving more specific problems are not solvable Input transformation technique –Use subroutine theme to show that if one problem is unsolvable,
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
1 Module 10 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Hardness Results for Problems
1 Lecture 6 Topics –Proof of the existence of unsolvable problems Problems/languages not in REC Proof Technique –There are more problems/languages than.
1 Lecture 11 Studying structure of REC –Complexity theory overview –Automata theory preview Motivating Problem –string searching.
1 Lecture 14 Studying the internal structure of REC, the set of solvable problems –Complexity theory overview –Automata theory preview Motivating Problem.
The Fundamentals: Algorithms, the Integers & Matrices.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Fall 2002CMSC Discrete Structures1 Enough Mathematical Appetizers! Let us look at something more interesting: Algorithms.
Introduction to Data Structures and Algorithms CS 110: Data Structures and Algorithms First Semester,
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Artificial Intelligence: Introduction Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Chapter Algorithms 3.2 The Growth of Functions 3.3 Complexity of Algorithms 3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors.
Section 3.1. Section Summary Properties of Algorithms Algorithms for Searching and Sorting Greedy Algorithms Halting Problem.
1 Algorithms CS 202 Epp section ??? Aaron Bloomfield.
Lecture 11 Data Structures, Algorithms & Complexity Introduction Dr Kevin Casey BSc, MSc, PhD GRIFFITH COLLEGE DUBLIN.
Algorithms 1.Notion of an algorithm 2.Properties of an algorithm 3.The GCD algorithm 4.Correctness of the GCD algorithm 5.Termination of the GCD algorithm.
The Beauty and Joy of Computing Lecture #6 Algorithms I UC Berkeley EECS Sr Lecturer SOE Dan Garcia.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
2IS80 Fundamentals of Informatics Fall 2015 Lecture 6: Sorting and Searching.
In the news: A recently security study suggests that a computer worm that ran rampant several years ago is still running on many machines, including 50%
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
CSE15 Discrete Mathematics 03/06/17
COP 3503 FALL 2012 Shayan Javed Lecture 15
Data Structures and Algorithms
Enough Mathematical Appetizers!
Lecture 2: Introduction to Algorithms
COMS W1004 Introduction to Computer Science and Programming in Java
Algorithms Chapter 3 With Question/Answer Animations
Applied Discrete Mathematics Week 6: Computation
Formal Languages, Automata and Models of Computation
Enough Mathematical Appetizers!
Enough Mathematical Appetizers!
Algorithms.
Presentation transcript:

Lecture 2: Fundamental Concepts Problems Programs Programming languages

Studying the Theme How do we prove something CAN be done by SOME program? We write a specific program which does it. How do we prove something CANNOT be done by ANY program? We have to develop an argument which takes into account EVERY program that could be written.

We view solving problems as the main application for computer programs

Definition A problem is a mapping or function between a set of inputs and a set of outputs Example Problem: Sorting Inputs Outputs (4,2,3,1) (1,2,3,4) (3,1,2,4) (1,5,7) (7,5,1) (1,2,3) (1,2,3)

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

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

Programs solve problems

Purpose Why do we write programs? One answer To solve problems What does it mean to solve a problem? Informal answer: For every legal input, a correct output is produced. Formal answer: To be given later

Programming Language Definition A programming language defines what constitutes a legal program Example: a pseudocode program may not be a legal C++ program which may not be a legal C program A programming language is typically referred to as a “computational model” in a course like this.

C++ Our programming language will be C++ with minor modifications Main procedure will use input parameters in a fashion similar to other procedures no argc/argv Output will be returned type specified by main function type

Maximum Element Problem Input integer n >= 1 List of n integers Output The largest of the n integers

C++ Program which solves the Maximum Element Problem int main(int A[], int n) { int i, max; if (n < 1) return (“Illegal Input”); max = A[0]; for (i = 1; i < n; i++) if (A[i] > max) max = A[i]; return (max); }

Exploring capabilities and limitations of C++ programs Fundamental Theme Exploring capabilities and limitations of C++ programs

Restating the Fundamental Theme We will study the capabilities and limits of C++ programs Specifically, we will try and identify What problems can be solved by C++ programs What problems cannot be solved by C++ programs

Studying the Theme How do we prove a problem CAN be solved by SOME C++ program? We write a specific C++ program which solves it. How do we prove something CANNOT be solved by ANY C++ program? We have to develop an argument which takes into account EVERY C++ program that could be written.

Question Is C++ general enough? Or is it possible that there exists some problem P such that P can be solved by some program P in some other programming language but P cannot be solved by any C++ program?

Church’s Thesis (modified) We have no proof of an answer, but it is commonly accepted that the answer is no. Church’s Thesis (modified) 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

Summary Problems Questions When we talk about what programs can or cannot “DO”, we mean what PROBLEMS can or cannot be solved Questions For any problem, can there be more than one program which solves it? For any program, can it solve more than one problem? Which is harder: proving a problem solvable or unsolvable?