Programming: Theory Of Computation Flashcards

1
Q

With FSMs, what is the name given to a FSM with an output determined by its current state and inputs?

A

A mealy machine

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

What does Backus Naur Form consist of?

A

-A set of production rules
-A set of non-terminal symbols
-A set of terminal symbols

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

define representational abstraction

A

a representation where unnecessary details are removed

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

describe abstraction by generalisation

A

elements are grouped by common characteristics to produce a hierarchical relationship

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

describe information hiding

A

information about objects that don’t contribute to its essential characteristics are hidden

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

describe procedural abstraction

A

breaking down problems into a series of reusable procedures

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

describe data abstraction

A

details about how data is represented is abstracted

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

define problem abstraction

A

removing details about a problem being solved, until it is solvable. Often an abstracted problem has already been solved before.

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

describe decomposition

A

a problem is broken down into a series of sub problems that can be solved individually

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

describe composition

A

combining procedures to create a larger system

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

describe automation

A

abstracting real world phenomena and putting them in action to solve problems (modelling)

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

what are the symbols for empty sets?

A

{} and Ø

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

what is the cardinality of a set?

A

the number of values in a set

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

what is the symbol for a subset?

A

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

describe the concept of proper subsets

A

if a set is equal to another set, they are subsets of each other, but not proper subsets. symbol = ⊂

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

define countable sets

A

a set that has the same cardinality as some subset of natural numbers

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

how are non terminals identified?

A

angle brackets < >
sometimes called meta-components or syntactic variables

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

describe the meaning of a non terminal

A

text that represents another set of terminals or non terminals. terminals cannot be broken down any further

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

how are terminal values identified?

A

text without angled brackets (< >)

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

how can recursion occur with backus naur form?

A

a non-terminal can be used to describe itself, in combination with other terminals or non terminals

21
Q

what is the correct syntax for defining the set of digits in backus naur form?

A

<Digit> : := 0|1|2|3|4|5|6|7|8|9
</Digit>

22
Q

define a syntax diagram

A

a visual representation of a regular language

23
Q

why can more values be represented by backus naur form than regular expressions?

A

regex cannot support recursion, where backus naur form can

24
Q

define big o notation

A

a method of expressing the time complexity of an algorithm. the worst case scenario is always assumed.

25
Q

how would a constant time complexity be represented in big O notation?

A

O(C)

26
Q

how can logarithmic time complexity be represented using big o notation? give an example of an algorithm

A

O(log(n)) binary search

27
Q

how can linear time complexity be represented in big o notation? give an example of an algorithm

A

O(n), linear search

28
Q

how can a linear logarithmic time complexity be represented using big o notation? give an example algorithm

A

O(nlog(n)) merge sort

29
Q

how can a polynomial time complexity be represented in big o notation? give an example algorithm

A

O(n^2) bubble sort or O(n^3)

30
Q

how can an exponential time complexity be represented in big o notation?

A

O(2^n), intractable problems

31
Q

how can a factorial complexity be represented in big o notation? describe how it can be recognised

A

O(n!), an intractable problem

32
Q

describe the meaning of a tractable problem

A

a problem that can be solved within a useful period of time, a polynomial or less time complexity

33
Q

describe an intractable problem

A

a problem that can theoretically be solved but not within a useful time period

34
Q

what are used to solve intractable problems?

A

heuristic methods

35
Q

define a heuristic method

A

a method of generating an approximate solution to an intractable problem, not necessarily the optimal solution

36
Q

describe the halting problem

A

it is impossible to write an algorithm that determines if an algorithm will terminate given a specific input- some problems cannot be solved by computers.

37
Q

describe a turing machine

A

a formal model of computation consisting of a finite state machine, a read write head and infinitely long tape.

38
Q

what three things does a turing machine consist of?

A

a finite state machine, a read write head and infintely long tape in one direction, a pointer??

39
Q

what is contained on the infinitely long tape of a turing machine?

A

cells containing a symbol or a blank space.

40
Q

why is a turing machine more powerful than finite state machines?

A

they can utilise a greater range of languages due to the infinitely long tape.

41
Q

how are the rules of a turing machine laid out?

A

transition functions

42
Q

what form are transition functions written in?

A

delta(current state, symbol read) = (new state, written symbol, move (L/R))

43
Q

how are turing machines limited?

A

they can only follow one finite state machine for the specific problem being solved.

44
Q

how are universal turing machines (UTM) different to turing machines?

A

a universal turing machine is capable of representing any finite state machine meaning any computable problem can be solved using a UTM.

45
Q

how do UTMs process using finite state machines?

A

a description of the FSM is read from the same infinite tape as the input data.

46
Q

how do UTMs act as interpreters?

A

they read instructions of the FSM sequentially before executing operations with the input data.

47
Q

why are turing machines important?

A

anything that is computable can be processed with a turing machine. therefore, turing machines can be used to prove that some problems can’t be solved by computers.

48
Q
A