paper 1 more qs Flashcards

(17 cards)

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.

To get a function
requires yet another abstraction, which
disregards the particular computation method.
This is functional abstraction.

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

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
14
Q

Give one reason why abstract data types are important in programming.

A

they provide a logical description of data handling operations, allowing programmers to focus on what operations are performed rather than how they are implemented.

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

Describe the difference between a one-dimensional and a two-dimensional array.

Explain how a two-dimensional array could be used to store a timetable.

A

Q: What is the difference between a 1D and 2D array?
A: A 1D array stores data in a single row/column (like a list), while a 2D array stores data in rows and columns (like a table or grid).

Q: How can a 2D array be used to store a timetable?
A: Each row could represent a day, and each column a period. The elements store subjects or activities.

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

Problem abstraction/reduction

A

details are removed until the problem
is represented in a way that is possible to solve
because the problem reduces to one that has
already been solved

17
Q

Automation

A

automation requires putting
models (abstraction of real world objects/
phenomena) into action to solve problems. This
is achieved by:
* creating algorithms
* implementing the algorithms in program
code (instructions)
* implementing the models in data
structures
* executing the code.