Theory of Computation Flashcards

(47 cards)

1
Q

What is an algorithm?

A

A sequence of steps that can be followed to complete a task that always terminates.

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

What are the 4 constructs of algorithms?

A

1) Iteration
2) Selection
3) Variable assignment
4) Sequence

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

What must we consider when evaluating different algorithms?

A

Efficiency, how many cases does it work, and error handling

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

What are the 4 main techniques of computational thinking?

A

1) Abstraction
2) Decomposition
3) Pattern recognition
4) Algorithmic thinking

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

What is abstraction?

A

Removal of detail from a a problem to focus on what is necessary to solve

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

What is decomposition?

A

Breaking a problem down into smaller problems, each of which is easier to solve

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

What is pattern recognition?

A

Comparing a problem to similar problems that are already solved and applying the same or similar solution

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

What is algorithmic thinking?

A

Writing a solution to a problem using algorithmic constructs (iteration, sequence, assignment, selection)

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

What are the different forms of abstraction?

A

1) Procedural abstraction
2) Functional abstraction
3) Data abstraction
4) Problem abstraction / reduction

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

What is representational abstraction?

A

The representation arrived at by removing unnecessary details from the problem.

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

What is an example of representational abstraction?

A

Maps

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

What is information hiding?

A

The process of hiding all details of an object that do not contribute to its essential characteristics

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

What is abstraction by generalisation?

A

Grouping common characteristics to arrive at a hierarchical relationship of the inheritance type

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

What is procedural abstraction?

A

Abstracting values used in a computation to leave a single computational method (procedure)

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

What is functional abstraction?

A

Abstracting the method of computation and the resultant function only focuses on inputs and outputs (functions)

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

What is data abstraction?

A

Isolating how a compound data structure is used from how it is constructed

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

What is problem abstraction (reduction)?

A

Removal of detail until it is possible to solve because it reduces to one that has already been solved

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

What is decomposition?

A

The process of breaking down a complex problem into smaller sub-problems. Each sub-problem accomplishes a specific task that is easier to solve. These can be further subdivided until a problem is solvable.

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

What is composition?

A

Form of abstraction which combines procedures to form compound procedures to solve a complex problem

20
Q

What is automation?

A

The process of using abstractions of real world phenomena (models) to solve problems

21
Q

How is automation done?

A

Create algorithms, implement in code, making models in data structures and executing code on data structures

22
Q

What are the components of a finite state machine?

A
  • Finite set of input symbols (alphabet)
  • Finite set of states
  • Initial state (S0<\sub>)
  • State transition functions
  • One or more accepting states
23
Q

What is a finite state machine?

A

A model to show how a machine changes from one state to another based on external input.

24
Q

How can we represent a finite state machine?

A

1) State transition diagram
2) State transition table

25
What is the initial state symbol in state transition diagrams?
26
What is the accepting state symbol in state transition diagrams?
27
What is the transition symbol in state transition diagrams?
28
What is transition symbol **with output** in state transition diagrams?
29
What are the columns in a state transition table?
Current state, input, output, next state
30
What are the uses of FSM's?
- digital (hardware) systems - software compilers - syntax parsing - network protocols
31
What does it mean for a finite state machine to be deterministic?
The next state is only dependent on the current state and input and hence **requires no memory**.
32
What do you call a finite state machine that doesn't produce an output?
Finite State Automata
33
Which set is the subset of any set?
The empty set
34
What is a set?
An **unordered** collection of values where each value **occurs at most once**.
35
How to denote set where each element is dependent on certain predicates?
*S = { e | p }* where e is the **expression** and p is the **predicates**
36
How to show AND and OR in set notation?
- ∧ is AND - upside down ∧ for OR
37
What datatype is compact representation used for?
Strings
38
How to show a compact representation of a string with equal numbers of 1s and 0s?
{ 0n1n | n >= 1} where n must be a **countable** number
39
What is a finite set?
A set whose elements can be counted off by **natural numbers** (at which point the set stops). The number of items in the set is referred to as its cardinality.
40
What is an infinite set?
A set with an infinite number of items.
41
What is the difference between a countably infinite set and a non-countable infinite set?
A countably infinite set is an infinite set where the items can be counted off by the natural numbers. R is non-countable infinite set.
42
How to do the cartesian product of sets?
A x B is the set of all ordered pairs (a,b) where a is an element of A and b is an element of B.
43
What is a subset?
A subset (X) of the set S is a set whose values are all members of S. denoted as X ⊆ S
44
What is a proper subset?
A subset that does not contain **all** of the elements of the original set. denoted as X ⊂ S
45
What are the different operations that you can do on sets and what do they do?
- Union - ∪ - all elements in either set or both - Intersection - ∩ - elements shared by both sets - Difference - / - A/B is all the elements in A but not in B (also written as A-B)
46
What is a tractable problem?
If a problem can be solved in polynomial time, it is described as **tractable**.
47
What are heuristics?
A heuristic approach employs a method of finding a solution that might not be the best. (reducing problem space or changing constraints)