machine computing

21
MACHINE COMPUTING the limitations

Upload: others

Post on 30-Nov-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MACHINE COMPUTING

MACHINE COMPUTING

the limitations

Page 2: MACHINE COMPUTING

human computing

• stealing brain cycles of the masses– word recognition: to digitize all printed writing– language education: to translate web content

• games with a purpose– labeling game: labeling images

• basing image search on image content

– word game: common-sense facts– locating objects in images:

• generating a large data base for computer vision algorithms• zooming in on labeled objects

in general, taking a seemingly “difficult” problem,solve it with by-products

of otherwise motivated (human) actions

but what is "difficult"?

Page 3: MACHINE COMPUTING

what is difficult?

• depends on the intelligence (of humans)– human age and health– training (expertise)– motivation

• depends on the degree of smartness (of hardware)– speed of operation (time complexity)– size of background memory (space complexity)– resource support

• depends on viewpoint– any contribution counts (or only the total)– many solutions are ok (or just one)– acceptable answer (or the exact answer) is needed

Page 4: MACHINE COMPUTING

what is difficult for a computer?

• most famous "undecidable" problem : the halting problem– given a piece of code and an input, does processing terminate

• chip library problem

while x is not 1 doif x is even do x:=x/2else do x:=3x+1

Page 5: MACHINE COMPUTING

chip library problem

Page 6: MACHINE COMPUTING

dna self-assembly problems

S

T

Page 7: MACHINE COMPUTING

other undecidable problems• given two groups of indexed strings over the same alphabet

same cardinality, is there a sequence of indices,yielding the same string

• is a given first-order logic statement universally valid?– first order logic includes quantifiers

• equality of two real numbers given a formula on integers– formula may have arithmetic operations,

logarithms and exponential functions

• indefinite integration– does a given function have a anti-derivative?

• is a piece of software a virus?

Page 8: MACHINE COMPUTING

what is a computer?

A pc state x y workspacecombinatorial

circuitM

output

suppose we have a problem of an instance x,some data y

and an algorithm A

this is astate

machine

Page 9: MACHINE COMPUTING

state machine specification

arcs leaving a state must be:1) mutually exclusive: no more than one choice for each input2) collectively exhaustive: a transition for each output

inputscu

rrent

sta

tes

next

state

s

outp

uts

state tables

inputs inputs

curr

ent

sta

tes

next

state

s

outp

uts

mealy state tables

stateoutp

stateoutp

"inp"c n

state transition diagrams

"inp"

"outp"

currstate

nextstate

mealy state transition diagrams

Page 10: MACHINE COMPUTING

concept of the state machine

example: odd parity checker

assert output whenever input bit stream has odd # of 1's

even[0]

odd[1]

reset

0

0

1 1

statetransitiondiagram

present state even even odd odd

input 0 1 0 1

next state even odd odd even

output 0 0 1 1

symbolic state transition table

output 0 0 1 1

next state 0 1 1 0

input 0 1 0 1

present state 0 0 1 1

encoded state transition table

rese

t

Page 11: MACHINE COMPUTING

finite state machines

a finite state machine has

• k states (one is the initial state)• m inputs• n outputs• transition rules for each state and input• output rules for each state

Page 12: MACHINE COMPUTING

can fsm's solve all “common” problems?NO, there exist common problems that cannot be "effectively computed" by finite state machines ! ! !

checking for balanced parenthesis

for example: multiplying two arbitrary binary numbersdoubling a sequence of "1"schecking for palindromes

(()(()())) - okay(()())) - no good!)(()((())) - no good!

problem:for arbitrarily long paren sequences,arbitrarily many states are required

a finite state machine can only keep track of a finite number of objects.

)

( (q10)

(q01 )

( q30

q20

)

q*0

),(

Page 13: MACHINE COMPUTING

unbounded-space computation

during 1920s and 30s, much of the "science" part of computer science was being developed (long before actual electronic computers existed).

many different "models of computation"were proposed, and the classes of "functions" which could be computed by each were analyzed.

one of these models was the turing machine named afterAlan Turing

a "turing machine" is just a finite state machine which receives its inputs from and writes outputs onto a tape with unlimited extendability .....

solving "finiteness" problem of finite state machines.

Page 14: MACHINE COMPUTING

turing machine specification

• a tape

•discrete symbol positions

•that can be extended at both sides (without bound)

• finite alphabet – say {0, 1}

• finite state machine controlinputs:

symbol under the reading headoutputs:

write 0/1move left/right

• initial starting state {SO}

• halt state {Halt}

Page 15: MACHINE COMPUTING

a turing parity counter

0 0 1 1 0 1 1 0 0 1 E 0 0 0 0

evenodd

00

even

00

even

00

odd

00

eveneveneven

00

odd

1

halt

any turing machine can be specified by a table of "quintuples"

the transition diagram

oddR

0

001

1

1 H

E

H

E10

evenR

even right0odd right0

halthalt

stopstop

01

even 0even 1oddodd

oddeven

rightright

00

01

evenodd

EE

currentstate

currentstate

nextstate write directionread

find the parity of the symbolsbetween the head

and the symbol "E", andreplace that symbol by the parity

Page 16: MACHINE COMPUTING

a turing parenthesis checker0 E ( ( ) ) ( ) ( ( ) ) ) ( ( ) E 0 0

q0R

0 E ( ( ) ) ( ) ( ( ) ) ) ( ( ) E 0 0

q0R

0 E ( ( ) ) ( ) ( ( ) ) ) ( ( ) E 0 0

q0R

0 E ( ( X ) ( ) ( ( ) ) ) ( ( ) E 0 0

q1L

0 E ( X X ) ( ) ( ( ) ) ) ( ( ) E 0 0

q0R next sheet

Page 17: MACHINE COMPUTING

a turing parenthesis checker0 E ( X X ) ( ) ( ( ) ) ) ( ( ) E 0 0

q0R

0 E ( X X X ( ) ( ( ) ) ) ( ( ) E 0 0

q1L

0 E ( X X X ( ) ( ( ) ) ) ( ( ) E 0 0

q1L

0 E ( X X X ( ) ( ( ) ) ) ( ( ) E 0 0

q1L

0 E X X X X ( ) ( ( ) ) ) ( ( ) E 0 0

q0R etc., etc.

Page 18: MACHINE COMPUTING

not exactly a moore machine,

but almost ....

a turing parenthesis checker

q1 leftXq0 right(q2 leftE

)(EX

q0q0q0q0

currentstate

nextstate write directionread

q1q1

q1q0

leftright

q0 rightX)X

)(

q1q1q2q2q2q2

haltq1dchalthaltq2

stopleftdc

stopstopleft

0Xdc01X

EX)(EX

Eq0R

q2L E

(q1L

H

1H

0

(,X),X X

H0

X

X

)

(

E

E

remarks:the next state and directionare 1-1in "q2" the situation with ")"will never occur

this shows the superiorityof turing machines overfinite state machines

Page 19: MACHINE COMPUTING

general purpose processors

programmable finite state machines:datapath withdata-dependent control

universal turing machines:can emulate

any turing machine

unlimited tape extendabilitydifficult to realize

solid engineeringavailable for synthesis

the state of affairsfinite state machines:limitations because ofrecurrent states

turing machines:can compute

any computable function

pragmatic compromise:finite state machine with very many states

Page 20: MACHINE COMPUTING

what is difficult for a computer?

• not computable (undecidable)• if computable, what does it take?

– how much time?– how much memory space?– how many processors?

time complexity

space complexity

computer science answer: complexity classes

Page 21: MACHINE COMPUTING

class structures

LogTime

LogSpace

P

co-NP

Pspace

ExpTime

ExpSpace

searching

sortinglinear programming

shortest paths

a decision problem is decidableif there exists a single algorithm that always leads to a correct yes-or-no answer.

decidable