4 - Theory of Computation Flashcards

1
Q

What does the term algorithm mean?

A

An algorithm is a sequence of steps that can be followed to complete a task and that can be completed in finite time.

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

What does a double circle indicate in a FSA?

A

Accepting state.

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

Explain the functionality of the * metacharacter when it is used in a regular expression.

A

Zero or more of the preceding value.

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

Explain the functionality of the ? metacharacter when it is used in a regular expression.

A

Zero or one of the preceding value.

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

Describe the significance of the Halting problem for commutation.

A

The Halting problem demonstrates that there are some problems that cannot be solved by a computer.

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

What is the question posed by the by the Halting problem?

A

Is it possible in general to write a program that can tell, given any program and its inputs, and without running the program, whether the given program with its given inputs will halt?

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

Why is it not possible to create a Turing machine that solves the Halting problem?

A

The Halting problem is non-computable

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

What is a finite state machine?

A

It is a model of computation

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

What is a Turing machine

A

A hypothetical machine capable of solving any problem that can be represented algorithmically

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

What does a Turing machine define

A

defines the limits of computers

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

What are the components of a Turing machine. (5)

A

An infinitely long tape divided into squares/ finite alphabet of symbols/ A read/write head/ finite set of states and a set of transition rules

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

What does “|” mean in a finite state machine

A

Acts as a break point to show input on the left out put on the right

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

What is the Universal Turning Machine

A

A Turing machine that can execute other Turing machines by stimulating their behavior.

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

What are the two parts of the Turing machine instruction

A

Data and standard description

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

What is the standard description of a turing machine

A

describes the turing machine that is being inputted allowing the UTM to accurately interpret the turing machine

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

what is a regular expression?

A

A compact notation that can describe a set of strings that make up a regular language.

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

What is the significance of a Universal Turing machine to the theory of computation?

A

it is possible for a single machine to compute anything that is computable.

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

What 2 ways can we measure complexity

A

time complexity/ space complecity

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

Why is time complexity important

A

allows us to measure efficiency of algorithm runtime.

20
Q

Why is space complexity important

A

allows us to measure the usage of resources by the computer by any given algorithm.

21
Q

What is meant by the worst case

A

The maximum amount of time that an algorithm can run for before reaching its answer

22
Q

What is meant by the best case

A

Time taken for only one iteration of the algorithm to execute.

23
Q

What is meant by the average case

A

mean number of computational time taken.

24
Q

What is Big O notation?

A

a formal expression of an algorithm’s complexity in relation to growth of the input size

25
Q

What is the classification for this Big O expression: O(1)

A

Constant time

26
Q

What is the classification for this Big O expression: O(log n)

A

Logarithmic time

27
Q

What is the classification for this Big O expression: O(n)

A

Linear Time

28
Q

What is the classification for this Big O expression: O(n^2)

A

Polynomial time

29
Q

What is the classification for this Big O expression: O(2^n)

A

Exponential time

30
Q

What is the classification for this Big O expression: O(n!)

A

Factorial time

31
Q

What is the basic operation of an algorithm

A

operation contributing most to the total running time/ most executed line of code

32
Q

What is the dominant term

A

part of the time complexity of a problem will dominate over the other parts

33
Q

What is a permutation

A

a set of objects is the number of different ways to arrange them when order matters.

34
Q

What is a tractable problem

A

A problem with a polynomial-time solution

35
Q

What is an intractable problem

A

A problem that can be solved, but does not have a polynomial-time solution

36
Q

What is a heuristic algorithm

A

they return solutions that are are not entirely accurate/ optimal/ or complete/ but are fit for purpose and achievable in a reasonable time frame.

37
Q

What is the halting problem

A

‘Is it possible to write a program that can tell given any program and its inputs and without executing the program/ whether it will halt?’

38
Q

Why is the halting problem significant?

A

It proves that there are problems that cannot be solved computationally.

39
Q

In regular expressions what does this mean: a*

A

zero or more “a”s

40
Q

In regular expressions what does this mean: a?b?

A

0 or 1 “a”s followed by 0 or 1 “b”s

41
Q

In regular expressions what does this mean: a+[ba]*

A

1 or more “a”s followed by zero or more of either “b” or “a”

42
Q

In regular expressions what does this mean: \d

A

matches any digit [0-9]

43
Q

In regular expressions what does this mean: \D

A

matches any digit that is not [0-9]

44
Q

In regular expressions what does this mean: \w

A

matches any word

45
Q

In regular expressions what does this mean:\W

A

Matches any non words

46
Q

What is a regular language

A

A language that can be represented by a regular expression and will be accepted by a FSM