(4) Computation Flashcards

1
Q

What does the Regular expression ‘a | b ‘ mean?

A

Any string that contains a or b

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

What does the Regular expression ‘abb?’ mean?

A

The ? indicates that there is zero or one of the char right next to ?

E.g. abb or ab

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

What does the Regular expression ‘ a+ ‘ mean?

A

Any string that contains one or more a

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

What does the Regular expression ‘ a* ‘ mean?

A

Any string that consists of zero or more a’s

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

What does the Regular expression ‘ ab ‘ mean?

A

Any string that contains an ‘a’ followed by ‘b’

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

What does the Regular expression ‘ a ‘ mean?

A

Any string that contains a single ‘a’

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

What are the two measures of efficiency?

A
  • Time required to solve the problem

- Memory space required to solve the problem

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

What does the following Big O notations mean and rank them from best to worst?: O(n) ,O(1) , O(2^n) , O(n^2), O(log n)

A
O(1): Constant complexity - BEST
O(log n): Logarithm complexity - GOOD
O(n): Linear complexity - DECENT
O(n^2) : Quadratic complexity - POOR
O(2^n): Exponential complexity - WORST
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Regular Expression?

A

A notation that determines when a string is valid without listing all valid strings

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

What is a Set?

A

-An unordered collection of values where each value occurs once.

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

What is Universal Turing Machine?

A

A Turing machine that can execute the behaviour of any other Turing
machine // can compute any computable sequence

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

What is an algorithm?

A

A step-by-step description of how to complete a task for solving a problem

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

What is information hiding?

A

The process of hiding the complexities of a program from the end user

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

Why can the turning machine model can be used to recognise a greater range of languages then an FSA?

A

Because the turning machine has unlimited memory

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

Why is the Turning Machine more powerful than the Finite State Automation (FSA)

A

Can be used to recognise a greater range of languages as it has unlimited memory

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

What is a tractable problem?

A

A problem that is solvable within a reasonable amount of time on a computer

17
Q

What is a intractable problem?

A

A problem that is solvable but takes an unreasonable amount of time

18
Q

What can a programmer do to ‘solve’ an intractable problem?

A

An algorithm could make an educated guess based on previous data

19
Q

How can a Universal Turning machine be considered as a interpreter?

A

It reads instructions one at a time and executes the instructions

20
Q

What is representational abstraction?

A

Removing (unnecessary) details;

21
Q

What is abstraction by generalisation?

A

Grouping by common characteristics // a hierarchical / ‘kind-of’ relationship;

22
Q

Explain the circumstances when it would be more appropriate to use an adjacency
matrix instead of an adjacency list.

A

Adjacency matrix appropriate when there are many edges between vertices

When graph/matrix is not sparse;
When edges frequently changed;
When presence/absence of specific edges needs to be tested frequently;

23
Q

What is BNF (Backus-Naur Form)?

A

A formal mathematical way of defining syntax unambiguously

24
Q

Describe the relationship between regular expressions and FSMs.

A

Regular language can be defined as any language that a FSM will accept