David evans http www cs virginia edu evans
This presentation is the property of its rightful owner.
Sponsored Links
1 / 30

David Evans http://www.cs.virginia.edu/evans PowerPoint PPT Presentation


  • 51 Views
  • Uploaded on
  • Presentation posted in: General

Lecture 2: Modeling Computers. David Evans http://www.cs.virginia.edu/evans. cs302: Theory of Computation University of Virginia Computer Science. Menu. Modeling Computers Course Organization Finite Automata. What can computers do?. What is a “computer”?.

Download Presentation

David Evans http://www.cs.virginia.edu/evans

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


David evans http www cs virginia edu evans

Lecture 2: Modeling Computers

David Evans

http://www.cs.virginia.edu/evans

cs302: Theory of Computation

University of Virginia

Computer Science


David evans cs virginia

Menu

  • Modeling Computers

  • Course Organization

  • Finite Automata


What can computers do

What can computers do?


What is a computer

What is a “computer”?


How should we model a computer

How should we model a Computer?

Colossus (1944)

Cray-1 (1976)

Apollo Guidance Computer (1969)

Turing invented his model in 1936. What “computer” was he modeling?

IBM 5100 (1975)


Computers before wwii

“Computers” before WWII


Mechanical computing

Mechanical Computing


Modeling pencil and paper

Modeling Pencil and Paper

...

...

#

C

S

S

A

7

2

3

How long should the tape be?

“Computing is normally done by writing certain symbols on paper. We may suppose this paper is divided into squares like a child’s arithmetic book.”

Alan Turing, On computable numbers, with an

application to the Entscheidungsproblem, 1936


Modeling brains

Modeling Brains

  • Rules for steps

  • Remember a little

“For the present I shall only say that the justification lies in the fact that the human memory is necessarily limited.”

Alan Turing


Turing s model

Turing’s Model

...

...

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

Input: 0

Write: 1

Move: 

Start

A

B

Input: 0

Write: 1

Move: 

Input: 1

Write: 1

Move: Halt

H

Input: 1

Write: 1

Move: 


What makes a good model

What makes a good model?

Copernicus

F = GM1M2 / R2

Newton

Ptolomy


Questions about computing model

Questions about Computing Model

  • How well does it match “real” computers?

    • Can it do everything they can do?

    • Can they do everything it can do?

  • Does it help us understand and reason about computing?

    • What problems can computers solve?

    • How long will it take?


Universal turing machine

Universal Turing Machine

Input: 2

Write: 1

Move: 

Input: 0

Write: 1

Move: 

Input: 1

Write: 2

Move: 

Start

A

Input: 2

Write: 1

Move: 

B

Input: 1

Write: 2

Move: 

Input: 0

Write: 2

Move: 


Course organization

Course Organization


Assignments

Assignments

  • Reading: mostly from Sipser, some additional readings later

  • Problem Sets (6 – first is due in 1 week)

  • Exams (2 + final)

  • Extra credit:

    • Challenge Problems

    • Communication Efforts


Help available

Help Available

  • David Evans

    • Office hours (Olsson 236A):

      Mondays, 2-3pm

    • Coffee Hours (Wilsdorf):

      Wednesdays, 9:30-10:30am

    • Other times: open office door, or send email to arrange

  • Assistants: Suzanne Collier, Qi Mi, Joe Talbott, Wuttisak Trongsiriwat

    • Problem-Solving Sessions (Olsson 226D)

    • Mondays 5:30-6:30pm, Wednesdays 6-7pm

First coffee hours and problem-solving session tomorrow


Honor code

Honor Code

  • Please don’t cheat!

    • If you’re not sure if what you are about to do is cheating, ask first

  • On most problem sets: “Gilligan’s Island” collaboration policy

    • Encourages discussion in groups, but ensures you understand everything yourself

    • Don’t use found solutions

  • On most exams: work alone, one page of notes allowed


Main question

Main Question

What problems can particular machines solve?

What is a problem?

What is a machine?

What does it mean for a machine to solve a problem?


David evans cs virginia

Uninteresting: can be solved by a lookup machine

Finite

Problems

Problems with a finite number of possible inputs

Except for trick questions, all problems we

are interested in in this class have infinitely many possible inputs.


Outputs

Outputs

  • How many possible outputs do you need for an interesting problem?

2 – “Yes” or “No”

Most problems can be framed as decision problems:

What is 1+1?

vs.

Is 1+1 = 3?


David evans cs virginia

Undecidable Problems

Decidable problems

(problems that can be

solved by some TM)

Tractable problems

(problems that can be solved by some TM in reasonable time)

Regular Languages

(can be recognized by a DFA)

Context-Free Languages

(can be recognized by a PDA)


Finite automata finite state machines

Finite Automata(Finite State Machines)


Informal example

Informal Example

  • Recognize binary strings with an even number of “1”s

What is a language?

What does it mean to recognize a language?


Designing dfas

Designing DFAs

  • Example: design a DFA that recognizes the language of binary strings that are divisible by 3

  • Design tips:

    • Think about what the states represent (e.g., what is the current remainder)

    • Walk through what the machine should do on example inputs


Formal definition

Formal Definition

A finite automaton is a 5-tuple:

Qfinite set (“states”)

  • finite set (“alphabet”)

  • Q x   Q(“transition function”)

    q0  Qstart state

    F  Qset of accepting states


Computation model

Computation Model

  • Define * as the “extended transition function”

    *: Q x *  Q

    Basis: *(q, ε) = q

    Induction:

    w = ax a  , x  *

    *(q, w) = *((q, a), x)

  • w  L(A) iff *(q0, w)  F


Inductive definitions

Inductive Definitions

code example:

State nextState(State q, String w) {

if (w.length() == 0) return q;

else return (nextState (transition (q, w.charAt(0)),

w.substring(1));

}


Regular languages

Regular Languages

  • Definition: A language is a regular language if there is some Finite Automaton that recognizes it.


Complement proof

Complement Proof

  • Prove: the set of regular languages is closed under complement.


Charge

Charge

  • Remember to submit registration survey

  • PS1 is posted on course website: due 1 week (- 73 minutes) from now

  • Coffee hours tomorrow (9:30am)

  • Problem-solving session tomorrow (6pm)


  • Login