Final Exam Review Andrew Speers April 6, 2011 NATS 1930 The - - PowerPoint PPT Presentation

final exam review
SMART_READER_LITE
LIVE PREVIEW

Final Exam Review Andrew Speers April 6, 2011 NATS 1930 The - - PowerPoint PPT Presentation

Final Exam Review Andrew Speers April 6, 2011 NATS 1930 The Science of Computation Week 19 - Analysis of Algorithms and Complexity Computational complexity: attempts to define/bound the worst-case run/computation times of an algorithm


slide-1
SLIDE 1

NATS 1930 The Science of Computation

Final Exam Review

Andrew Speers April 6, 2011

slide-2
SLIDE 2

NATS 1930 The Science of Computation

Week 19 - Analysis of Algorithms and Complexity

Computational complexity: attempts to define/bound the worst-case run/computation times of an algorithm Computationally intractable: algorithms exist to solve the problem but can take extremely long amounts of time to solve

slide-3
SLIDE 3

NATS 1930 The Science of Computation

Week 19 - Analysis of Algorithms and Complexity

Big-Oh notation: specify the growth rate in computation time in terms of input size (n) Linear search = O(n) - search through a list from beginning to end, worst case look at every item once Binary search = O(logn) - every item looked at cuts the possible items to search in half, items must already be sorted

slide-4
SLIDE 4

NATS 1930 The Science of Computation

Week 20 - Building Intelligent Machines.

Chess Jeopardy (Watson) Hexapawn Graphical algorithm to prune acceptable moves Guess the animal (20 Questions) Tree representation, approach to search and add new animals to the program

slide-5
SLIDE 5

NATS 1930 The Science of Computation

Week 22 - Complexity and Fundamental Limits.

Growth rates: constant < logarithmic < linear < polynomial < exponential (for large enough input size) Moore’s law: number of transistors and resistors on a chip doubles every 24 months (i.e. processor speed doubles) Singularity: once machines surpass humans (at building machines) there will be a sudden surge to superintelligence P vs. NP

slide-6
SLIDE 6

NATS 1930 The Science of Computation

Week 23 - Parallelism, Networks and the World-Wide Web.

Flynn’s taxonomy: SISD, SIMD, MISD, MIMD (today’s typical computer) Amdahl’s law: small portion of program that cannot be parallelized (limit the speed-up to some upper bound no matter how many processors you have) Synchronization, race conditions, deadlock and livelock (hint: apply them to the Dining Philosophers problem) Distributed computing: share computational resources

  • ver some network medium (cloud computing, internet,

etc)

slide-7
SLIDE 7

NATS 1930 The Science of Computation

Week 24 - Planning, Searching and Robots.

Bug Algorithms Bug-0 Algorithm (won’t always work) (1) Head toward the goal (2) Follow the obstacle’s boundary (toward the left) until heading toward the goal is possible again (3) Continue toward the goal

slide-8
SLIDE 8

NATS 1930 The Science of Computation

Week 24 - Planning, Searching and Robots.

Bug-1 Algorithm (1) Head toward the goal (2) If contact is made with an obstacle then circumnavigate it, remember the closest point Li to the goal, and return to this point by the shortest wall- following path (3) Continue toward the goal

slide-9
SLIDE 9

NATS 1930 The Science of Computation

Week 24 - Planning, Searching and Robots.

Bug-2 Algorithm (1) Head toward the goal along the goal-line (2) If an obstacle is in the way, follow it until you encounter the goal-line again and closer to the goal (3) Leave the obstacle and continue toward the goal

slide-10
SLIDE 10

NATS 1930 The Science of Computation

Week 24 - Planning, Searching and Robots.

Roadmap Algorithms Graph-based methods Visibility graph (VG) vs probabilistic roadmap (PRM)

slide-11
SLIDE 11

NATS 1930 The Science of Computation

Week 25 - Multiple Robots.

Problems with multiple robots Coordination: how do you coordinate teams of multiple robots Planning: how do you distribute plans among multiple robots Sensing: how do you distribute sensing among multiple robots

slide-12
SLIDE 12

NATS 1930 The Science of Computation

Week 25 - Multiple Robots.

Issues with communication between robots/nodes. Communications not guaranteed. Flocking Leaders in swarms Planning: centralized vs. decentralized

slide-13
SLIDE 13

NATS 1930 The Science of Computation

Week 26 - Special topics in robotics.

Locomotion, Sensing, Communication & Control, Reasoning Aquatic: AUV, ASV Most of our labs research Underwater many things become more difficult Land, Space, Military, etc Sensing application: SLAM

slide-14
SLIDE 14

NATS 1930 The Science of Computation

Labs

14

slide-15
SLIDE 15

NATS 1930 The Science of Computation

Lab 2 - DFA’s, NFA’s and Mealy Machines

slide-16
SLIDE 16

NATS 1930 The Science of Computation

Lab 3 - Eliza.

Eliza programs attempt to carry on realistic conversations but typically will fall into repeatable patterns which give them away as computers Use regular expressions to program responses

slide-17
SLIDE 17

NATS 1930 The Science of Computation

Lab 3 - Eliza.

* more than one word ? one word exactly word numbering for responses start at 0 (e.g. matching “i like *” with response “why do you like 2” results in replacing the 2 in the response with whatever word(s) were matched by the * in the input) pronoun map makes responses sound like they are not just a regurgitation (e.g. from before “i like you” could respond in “why do you like me” if the pronoun map exchanged you for me regular expressions higher up the match list get matched first (unless they match the exact same expression then they are randomly selected)

slide-18
SLIDE 18

NATS 1930 The Science of Computation

Lab 4 - Turing Machines.

slide-19
SLIDE 19

NATS 1930 The Science of Computation

Lab 6 - Logical Structures.

if . . . else . . . while . . .

slide-20
SLIDE 20

NATS 1930 The Science of Computation

Lab 7 - Linear vs. Binary Search.

Understand different search patterns/rules Binary search is faster but needs sorted input O(n) vs. O(logn)

slide-21
SLIDE 21

NATS 1930 The Science of Computation

Lab 8 - Dining Philosophers.

A collection of philosophers sit around a circular table. Between each philosopher there is a utensil (chopstick). In order to eat the food a philosopher requires two

  • utensils. The problem comes in the fact that there arent

enough utensils for everyone to eat at the same time (i.e. they must share). Philosophers either eat or think. After thinking for a bit each philosopher would like to eat.

slide-22
SLIDE 22

NATS 1930 The Science of Computation

Lab 8 - Dining Philosophers.

brings up issues present in modern computer systems in how to deal with shared resources failure modes: deadlock: philosophers try to acquire the resources they need to eat in such a way that the system becomes stuck and cannot become unstuck starvation: some of the philosophers may never get to eat live lock: the system does not get stuck but rather runs through a sequence of states that repeats but is not stuck dead as in dead lock

slide-23
SLIDE 23

NATS 1930 The Science of Computation

Lab 9 - Animal 20 Questions.

understand pattern for search and new-rule insertion understand tree and table structure for the program understand restrictions that a tree places on certain questions/animals given what is above it

slide-24
SLIDE 24

NATS 1930 The Science of Computation

Lab 9 - Animal 20 Questions.

Index Question yes no 1 2 3 4 5 6

Tabular Description

slide-25
SLIDE 25

NATS 1930 The Science of Computation

Lab 10 - Bug Algorithms.

Algorithms described earlier Understand limitations of algorithms (when they get stuck) and consequences for using algorithms (Bug 1 more reliable but slower than Bug 0)

slide-26
SLIDE 26

NATS 1930 The Science of Computation

Questions I’ve been sent

26

slide-27
SLIDE 27

NATS 1930 The Science of Computation

Halting Problem

Explain the Halting Problem . . . Briefly, it’s answering the question “Does a given TM halt when started on a given input?” This problem cannot be solved by any TM

slide-28
SLIDE 28

NATS 1930 The Science of Computation

Keyword Blasting

Undecidability: some problems can’t be solved by any TM (i.e. Halting problem) TM-recognized: a TM recognizes a language consisting of the set of all strings it

  • accepts. if a given language can be recognized by a TM it is called TM-

recognized If a TM M always halts on all inputs, M is a decider and it’s language is called a decidable language TM is always a recognizer of some language Conversely, that language is a TM-recognizable language If the TM always halts for inputs it doesn’t accept the TM is a decider as well Conversely, that language is a decidable language

slide-29
SLIDE 29

NATS 1930 The Science of Computation

Cantor’s Theorem

Attempted to show that the number of languages > number of TM’s = size

  • f the set of natural numbers = number of strings over {a,b} => not

countably infinite Uses Diagonalization to construct a language that is not TM-recogizable =>size of set of all languages is > size of N => not countably infinite

slide-30
SLIDE 30

NATS 1930 The Science of Computation

Cantor’s Theorem

slide-31
SLIDE 31

NATS 1930 The Science of Computation

Universal Turing Machine (U)

Given a TM machine code (M) and an input string (w) on the tape of U, the TM can simulate input w on M => thus making it able to “act” like any conceivable TM Simulation take symbol at tape head and copy over next to current state search through M for transition matching current state and scanned symbol update U’s representation of M’s state, scanned symbol and head position on M’s tape repeat until no transition of M applies (M accepts if it halts and current state is q1) Some cleanup cases (see notes)

slide-32
SLIDE 32

NATS 1930 The Science of Computation

Taxonomy of Computational Models

DFA NFA -> DFA with more than one possible transition out of a given state for some input symbol Mealy Machine -> DFA with some output on a state transition Moore Machine -> DFA with some output when entering a state (regardless

  • f a transition)

Turing Machine -> Mealy Machine with memory (output describes write action of tape head and movement of tape head)