4.4 Theory of Computation Flashcards

1
Q

Algorithm (definition)

A

A set of step by step instructions to solve a specific problem that always terminates and can be represented by a Turing Machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Representational Abstraction (definition)

A

Removing unnecessary details

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Decomposition (definition)

A

Act of breaking down a problem into a number of more manageable sub problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Finite State Machines can be used to test

A

if a string belongs to a regular language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In Mealy Machines

A

Outputs are associated with transitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A Finite State Machine is described by (5)

A
  • a set of states
  • a start state
  • a set of final/accepted states
  • transition functions
  • input alphabet
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Each Transition Diagram has (3)

A
  • a start state
  • a halting/dead/trap state
  • transitions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Regular Language (definition)

A

A language (set of strings) that can be expressed as a regular expression or finite state machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A Regular Language is comprised of two components:

A
  • alphabet: finite set of symbols
  • syntax rules: how the symbols must be ordered
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

?

A

0 or 1 occurrence of previous character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

*

A

Min 0 occurrences of previous character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

+

A

Min 1 occurrences of previous character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

|

A

or

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Set (definition)

A

An unordered list of elements in which each element occurs at most once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Cardinality =
Empty set:

A

a measure of the number of elements in a set
{} or ∅

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Infinite Sets are either

A
  • Countable (e.g. rational)
  • Non countable (e.g. real, irrational)
17
Q

Subset (definition)

A
  • allowed to be the same as the original set
  • proper subset is not
18
Q

Cartesian Product

A
  • Is found by ‘joining’ two sets together
  • X = {2,5,3} Y = {7,9}
  • X cross Y = {(2,7), (2,9), (5,7), (5,9), (3,7), (3,9)}
19
Q

Backus Naur diagrams

A

Syntax / railroad diagrams

20
Q

Types of Complexity

A
  • Time complexity is a function that describes how long an algorithm takes in terms of quantity of input
  • Memory complexity is a function the describes how much space an algorithm takes in terms of quantity of input
  • Often improving one decreases the other
21
Q

Big O Notation Explanations for:
- Bubble Sort
- Binary Search, Binary Tree Search, Merge Sort

A
  • Bubble Sort:
    • In each pass through the list, n items will be examined
    • There will be at most n passes through the list
    • 2 for loops and so O(n2)
  • Binary Search, Binary Tree Search, Merge Sort:
    • Each comparison halves the size of the list that has to be searched through
    • if the size of the list doubles then the number of comparisons needed only increases by 1
22
Q

Intractable (Definition)

A

The problem is computable but cannot be solved within a polynomial (or less) time

23
Q

Travelling Salesman Problem (Process + 3)

A
  • Select a node to start from
  • Choose the nearest neighbour to that node
  • Continue choosing the nearest neighbour until all the nodes have been visited
  • If not all nodes are visited then choose another starting point and start again
  • Problem: find a route that visits all nodes with the shortest distance
  • Only way to get the best solution is to try all combinations (brute force)
  • Is intractable
24
Q

The Halting Problem (Problem + Importance)

A
  • The Halting Problem determines if a program will halt without running the program given its particular inputs
  • Provides proof that there are problems that are unsolvable/non computable
25
The output of a Turing Machine is
not written on a separate tape, but rather overwritten on the same tape
26
Each Turing Machine has (6)
- an infinite tape (+ a head which can move to read/write from the tape) - a finite alphabet of symbols - a finite number of states (a transition diagram) - a halting state/accepting states - the current state - a set of transition rules
27
The Universal Turing Machine
“The UTM can simulate any other Turing Machine and executes operations on the data precisely as the simulated Turing Machine does"
28
The UTM is considered to be more powerful than any other computer as
it has an infinite amount of memory
29
Constant Time Complexity (definition)
As the size of inputs increases the amount of time taken remains the same
30
Composition
Combining procedures into compound procedures
31
Automation
Models are put into action to solve problems