paper 1 more qs Flashcards

1
Q

What is a regular language

A

A language that can be described by a regular expression or recognised by a finite state machine (FSM).

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

Why can BNF represent some languages that regular expressions cannot?

A

Because BNF allows recursive definitions, making it capable of representing nested or recursive structures like matching brackets.

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

Why are some problems considered non-computable?

A

Because no algorithm exists that can solve them, no matter how much time or resources are available.

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

List three key components of a Turing machine and their roles.

A

Tape: Infinite memory for storing and modifying symbols.

Read/write head: Reads from and writes to the tape, moving left or right.

Transition rules: Define how the machine changes state based on the current symbol

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

Give two differences between a Finite State Machine (FSM) and a Turing Machine.

A

A Turing Machine has infinite memory (tape); FSM does not.

A Turing Machine can modify the tape by writing; FSM cannot modify input.

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

What is procedural abstraction?

A

Hiding the specific values used and focusing on the steps (the procedure) of the computation

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

What is functional abstraction?

A

Hiding the method used to achieve a result; only the input-output behaviour matters.

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

What is the difference between procedural and functional abstraction?

A

Procedural abstraction hides steps; functional abstraction hides how the result is achieved.

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

What is data abstraction

A

Hiding the internal details of how data is stored; for a stack, you just use “push” and “pop” without knowing it’s implemented using an array and a pointer.

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

What is composition in abstraction

A

Combining simple procedures into more complex ones.

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

What are the three standard constructs in algorithms?

A

Sequence: steps executed one after another.

Selection: decision-making using IF/ELSE.

Iteration: repeating steps using loops like FOR or WHILE.

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

meaning of correctness and efficiency

A

Correctness: Produces the right result for all valid inputs.

Efficiency: Uses resources (time, memory) optimally.

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

What is information hiding?

A

Concealing internal details of an object, showing only what is necessary.

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