Importance of this material - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Importance of this material

Description:

1. Lecture 2. Topics. Importance of this material. Fundamental Limitations ... Physics. Study of fundamental physical laws and phenomenon like gravity and electricity ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 30
Provided by: Eri770
Category:

less

Transcript and Presenter's Notes

Title: Importance of this material


1
Lecture 2
  • Topics
  • Importance of this material
  • Fundamental Limitations
  • Connecting Problems and Languages
  • Problems
  • Search, function and decision problems
  • Languages
  • Encodings of Problems
  • Encode input instances of problem as strings
  • Language Recognition Problem
  • Is an input string in the language?

2
Importance Philosophy
  • Phil. of life
  • What is the purpose of life?
  • What is achievable in life?
  • What is NOT achievable in life?
  • Phil. of computing
  • What is the purpose of programming?
  • What is solvable through programming?
  • What is NOT solvable through programming?

3
Importance Science
  • Physics
  • Study of fundamental physical laws and phenomenon
    like gravity and electricity
  • Engineering
  • Governed by physical laws
  • Our material
  • Study of fundamental computational laws and
    phenomenon like undecidability and universal
    computers
  • Programming
  • Governed by computational laws

4
Problem Types
  • We classify problems based on
  • range (output set) size
  • infinite
  • binary
  • mapping type
  • function
  • unique output per input
  • relation
  • more than one output per input

5
I) Search Problems
  • (countably) infinite range
  • the mapping may be a relation

6
Examples
  • Divisor
  • Input Integer n
  • Output An integral divisor of n

9
7
II) Function Problems
  • (countably) infinite range
  • mapping is a function
  • unique solution per input

8
Examples
  • Sorting
  • Multiplication Problem
  • Input 2 integers x and y
  • Output xy

2,5
9
Examples
  • Maximum divisor problem
  • Input Integer n
  • Output size of maximum divisor of n smaller than
    n

9
10
III) Decision Problems
  • Output is yes or no
  • range Yes, No
  • unique solution
  • only one of Yes/No is correct

11
Examples
  • Decision sorting
  • Input list of numbers
  • Yes/No question Is list in nondecreasing order?

12
Examples
  • Decision multiplication
  • Input Three numbers x,y, z
  • Yes/No question Is xy z?

13
Examples
  • Decision Divisor Problem
  • Input Two numbers x and y
  • Yes/No question Is y a divisor of x?

14
What about finite domain problems?
  • Note all problems described above have infinite
    domains (input set)
  • size of range varies from 2 to countably infinite
  • What happens if we had a problem with only a
    finite domain?
  • Table lookup

15
Table Lookup Program
  • string x
  • cin gtgt x
  • switch x
  • case Kona cout ltlt 3 break
  • case Eric cout ltlt 31 break
  • case Cliff cout ltlt 36 break
  • default cout ltlt Illegal input\n

16
Generality of Decision Problems
  • We now show that we can focus only on decision
    problems
  • Having yes/no outputs is not limiting.
  • If we can solve a decision version of a problem,
    we can typically solve the function and search
    versions of the same problem as well

17
Example
  • Decision divisor problem
  • Input Integers x and y
  • Yes/No Question Is y a divisor of x?
  • Assumption Alg. A solves this problem
  • Function divisor problem
  • Input Integer x
  • Output Largest divisor of x that is not x
  • Goal Construct alg. A to solve this problem

18
Program A
  • integer x, max, j
  • cin gtgt x
  • max 1
  • for (j2 jltx j)
  • if (A(x,j)) // using A as a procedure
  • max j
  • return max

19
Connecting Problems and Languages
  • Start with any problem P
  • Convert P to equivalent decision problem P
  • Convert P to equiv set membership problem SP
  • Reinterpret P
  • Convert SP to language recognition problem L
  • Encoding scheme

20
Set Membership Problem
  • Setting
  • Universe U
  • set S subset of U
  • Input
  • Element x in U
  • Yes/No Question
  • Is x in S?

21
Decision Problems to Set Membership Problems
  • Reformulate/interpret a decision problem as a set
    membership problem
  • Universe U set of all input instances
  • Set S either set of all YES or all NO input
    instances

22
Example
  • Decision divisor problem
  • Input Integers x and y
  • Yes/No Question Is y a divisor of x?
  • Set membership problem
  • Universe U (x,y) x and y are integers
  • Set S (x,y) y divides x

23
Sets to Languages
  • How do we represent an input instance of a set
    membership problem?
  • We use an encoding scheme
  • Each input instance is mapped to a unique string
    over some finite alphabet ?.
  • Think ASCII
  • Corresponding language L the set of strings
    corresponding to yes instances

24
Decision multiplication problem
  • Alphabet S1 0,1,2,3,4,5,6,7,8,9,
  • 71025 NO instance
  • 3412 YES instance
  • Binary Alphabet S2 0,1
  • Encode alphabet S1
  • 11 characters in S1
  • 4 bits per character of S1
  • Encoding of 3412
  • 001110110100101100010010

25
Decision divisor problem
  • Fill in

26
Language recognition problem (LRP)
  • Input Instance Description
  • Finite length string x in ? (why finite?)
  • Yes/No Question
  • Is input string x in language L?
  • How does the language recognition problem for L
    relate to corresponding set membership problem?

27
Decision Addition Problem
S
113
11113
112
751
347
1111111
Yes
No
  • Illegal strings easily recognized
  • Thus two problems essentially identical

28
Every decision problem can be formulated as an LRP
  • First convert to set membership problem
  • Then convert to language recognition problem
    using an encoding scheme
  • Illegal strings easily recognized

29
Key Concepts
  • Different types of problems
  • always countably infinite domain
  • Decision problems
  • binary range YES, NO
  • still general despite limited range
  • Set membership problem
  • Language recognition problem
  • encoding scheme
Write a Comment
User Comments (0)
About PowerShow.com