Flashcards
Topic 4 | Theory of Computation

Cards in this deck (36)
- 1What is the definition of a "State Machine"?• A State Machine is any device that stores the status of something at a given time, and can operate on input to change the status and/or cause to take place for any given change
- 2What is the different between a State Machine and a Mealy Machine?• State Machines rely only on input, mealy machines (finite-state) rely on both state and input
- 3Give an example of a Mealy Machine.• Vending machine
• Traffic lights
• Lifts - 4What is a FSM (Finite State Machine) that does not have an output called?• A FSM without an output is called a Finite State Automation (FSA)
- 5What does the regular expression a* represent?• Zero or more of the preceding element (a)
- 6What does the regular expression a+ represent?• One or more of the preceding element (a)
- 7What does the regular expression b? represent?• Zero or one of the preceding element (b)
- 8What does the regular expression a|b represent?• a or b
- 9What will the output be if you input 110001011010110001011010 -> 010111100100

- 10What is the importance of the "Turing Machine"?• The Turing Machine was one of the first theoretical models for computer (1936), and a lot of theoretical comp. sci. has been developed with Turing Machines in mind
It consists of regular expressions and finite state machines - 11What does the following Big O notations represent? O(1) O(nLogN) O(n) O(n^2) O(2^n)• O(1) constant time complexity
• O(nlogN) logarithmic time complexity
• O(n) linear time complexity
• O(n^2) polynomial time complexity
• O(2^n) exponential time complexity - 12What is the "Halting Problem"?• The Halting Problem is an unsolvable problem of determining whether any program will stop if given a particular input
- 13What does the term "tractable" and "intractable" mean?• Tractable -> polynomial time complexity or less
• Intractable -> exponential time complexity or more - 14What are "Heuristic Methods" and when are they used in comp. sci.?• The basis of Turing's idea is straightforward: is it possible to come up with a method that, given a program and its inputs, but without running the program, can tell if the program will halt (i.e. run to completion)?
• Heuristic methods are often used when tacking intractable problems - 15Give an application of Breadth-First and Depth-First search algorithms.• Breadth-First: shortest path for an unweighted graph
• Depth-First: navigating a maze - 16What are the uses of: -> Pre-Order graph traversal -> In-Order graph traversal -> Post-Order graph traversal• Pre-Order: copying a tree
• In-Order: binary search tree
• Post-Order: Infix to RPN - 17Give a use of dijkstra's algorithm?• Core IP routers (core routing of traffic on the internet)
- 18Why is Reverse Polish Notation used?• Eliminates the need for brackets in sub-expressions
• Expressions in a form suitable for evaluation using a stack
• Used in interpreters based on a stack, e.g. postscript and bytecode - 19What time complexity is a Bubble Sort?• Bubble Sort has a time complexity of O(n^2)
- 20What is the time complexity of a Merge Sort?• Merge Sort has a time complexity of O(nLogN)
- 21What is "Diijstra's Algorithm"?• Diijkstra's Algorithm finds the shortest path from a starting node to every other
node in a network - 22What does the term "Algorithm" mean?• A sequence of steps that can be followed to
complete a task and that always terminates. - 23• What is "Composition"?• Combining procedures to form compound procedures
- 24What does the set A = {0^n 1^n| n ≥ 1} represent?• This set contains all strings with an equal number of 0 s and 1s
- 25What does the set A = {x | x ∈ ℕ ∧ x ≥ 1 } represent?• A is the set consisting of those objects x
such that x ∈ ℕ and x ≥ 1 is true - 26What does the term "Cardinality of a Finite State" mean?• The number of elements in a set or group
- 27Give an example of an infinite set.• Set of natural numbers
• Set of real numbers - 28Give an example of a finite set.• Set of the 10 digits
- 29Find the Cartesian Product of the following two sets: a = {A, B} b = {C, D, E} What does the x represent in b x a• b x a = { (A,C), (A,D), (A,E), (B,C), (B,D), (B,E) }
• x represents cross, "b cross a" - 30What does ⊂ mean in set notation?• ⊂, A is the Proper subset of B
e.g. {1, 2} ⊂ N
(N contains all of {1,2}) - 31What does ∈ and ∉ mean in set notation• ∈, x is an element of set A
• ∉, x is not an element of set A - 32What is a "Meta Language"?• ML is the programming language that you use to describe the theory
- 33What is BNF and what does it stand for?• BNF is a formal mathematical way of defining syntax unambiguously
• Backus–Naur Form - 34What does the BNF notation of the following mean? ::= <> | {} (rarely used) ',' (rarely used)• ::= means is defined by/consists of
• <> means the syntactic item
• | means OR
• {} means optional
• ',' means AND - 35What is the process of working out a given statement is valid according to a given BNF production called?• Parsing
- 36In BNF, what are the terminals and non-terminals in the following expression: ::=0|1|2|3|4|5|6|7|8|9• non-terminal
• 0|1|2|3|4|5|6|7|8|9 terminal
Information
- Description
- Graphs, BFS, DFS RPN BNF of Syntax Diagrams Finite State Machines Turing Machines Big O notation Regular Expressions
- Created by
- Joel Baxter
- Views
- 5
- Rating
More on Automata and Computability