Computer Science Unit 4.4: Theory of Computation

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/57

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

58 Terms

1
New cards

What is computational thinking?

Working out how to work things out

2
New cards

What are the methods of problem solving?

  • Simulation

  • Enumeration

  • Trial and Error

  • Theoretical approach

  • Creative solution

3
New cards

What does decrease and conquer mean?

Involves finding a solution to a sequence of smaller, related problems until the problem is small enough to be solved directly. 

4
New cards

What’s an example of decrease and conquer?

The binary search algorithm

5
New cards

What does iteration mean?

Repetition

6
New cards

Why is structured programming possible?

The structures are built into the programming languages

7
New cards

What does structured programming use to write a computer program?

  • Top-down analysis for problem-solving. 

  • Modularisation for program structure and organisation. 

  • Structured code for individual modules. 

8
New cards

What kind of format does structured programming use?

Top-down design format

9
New cards

What is the program divided down into in a top down design?

Modules

10
New cards

Where are modules called from?

The main program

11
New cards

What can modules be broken down into?

Subtasks

12
New cards

What do the smallest of modules perform?

A single function

13
New cards

What is a hierarchy used to show?

The overall program structure

14
New cards
15
New cards

What are the benefits of structured programming?

  • Programs are more easily and quickly written

  • Programs are more reliable and have fewer errors

  • Programs take less time to test and debug

  • Programs are easier to maintain

16
New cards

What are 3 qualities of good coding practice?

  • Use meaningful names for variables and subroutines. 

  • Add lots of comments to explain each module. 

  • Each module should perform a single task.  

17
New cards

What is modular programming most useful for?

Large and complex programs

18
New cards

What is an algorithm?

A sequence of steps that can be followed to complete a task and always terminates

19
New cards
20
New cards

What is an example of a problem solved by algorithms?

Sorting large amounts of data

21
New cards

What are 3 properties of a good algorithm?

  • Has clear and precisely stated steps that produce a correct output for any set of valid inputs. 

  • Should allow for invalid inputs. 

  • Must always terminate at some point. 

22
New cards

What is the purpose of testing software?

The purpose of testing software is to reveal errors

23
New cards

What are the stages of testing?

  1. Module testing

  2. Program testing

  3. System testing

24
New cards

What does module testing do?

Makes sure each subroutine works correctly

25
New cards

What does program testing do?

Makes sure each program in the system works correctly

26
New cards

What does system testing do?

Makes sure the whole system works as expected, and does what the original specification required

27
New cards

What are the 3 types of test data?

  • Normal (typical) data

  • Boundary data

  • Erroneous (unexpected) data

28
New cards

What are hand-tracing algorithms useful for?

  • Figuring out how an algorithm works

  • Finding out why an algorithm isn’t working properly

29
New cards

What is a trace table used for?

Used to write down the contents of each variable as it changes during execution

30
New cards

What is representational abstraction?

Removing unnecessary details to concentrate on what is necessary to solve the problem

31
New cards

What is an example of information hiding?

The London Underground Map

32
New cards

What is abstraction by generalisation?

Grouping common characteristics to achieve a hierarchal structure

33
New cards

What is an example of abstraction by generalisation?

The bridges of Konigsberg

34
New cards

What is problem abstraction?

Removing details until the problem is possible to solve, as it reduces to one which has already been solved

35
New cards

What is an example of problem abstraction?

The Four Knights Problem

36
New cards

What are the 4 steps of automation?

  • Building models of real world objects

  • Decide what details are relevant to the program and discard everything else.

  • Design algorithms to solve the problem. 

  • Algorithm is then implemented in program code and executed. 

37
New cards

What is an example of automation?

A financial model which calculates the likely profit from a coffee shop, based on the available data. 

38
New cards

What is decomposition?

Breaking a problem into sub-problems, so that each sub-problem accomplishes an identifiable task

39
New cards

What is composition?

Combining procedures to form a compound procedure and combining data objects to form compound data objects

40
New cards

What is procedural abstraction?

Where you separate the values used in order to keep the actual values used in a computation separate from the overall design

41
New cards

What is an example of procedural abstraction?

drawTriangle("Blue",7.8,4.2)

42
New cards

What is functional abstraction?

When you call a function to calculate a square root, or generate a random number

43
New cards

What is an example of functional abstraction?

x = sqrt(17)

44
New cards

What is data abstraction?

The data relevant to solving any problem may be in the form of an abstract data structure

45
New cards

What is an example of data abstraction?

A stack

46
New cards

What is a finite state machine (FSM)?

An abstract representation of how something changes from one state to another in response to a condition or event. 

47
New cards

What are some facts about FSMs?

  • The machine can only be in one state at a time. 

  • It can change from one state to another in response to an event or condition. 

  • Is defined by a list of its states and the conditions for each transition. 

48
New cards

What is an example of a FSM?

A turnstile

<p>A turnstile</p>
49
New cards

What are 2 examples of the uses of FSMs?

  • Robotics 

  • Video games industry 

50
New cards

What is Finite State Automation?

  • A FSM which has no output

  • It has a start state and a set of end or accept states. 

  • If the automation can reach a final state, it is said to accept the input

51
New cards
<p>What do the symbols of a FSM mean?</p>

What do the symbols of a FSM mean?

knowt flashcard image
52
New cards
term image

Accepted: aaac, adadbd, ac, bd

Rejected: badc, bdaacS

53
New cards
term image

Accepted: a, bbaa, bababaa

Rejected: abba, baaa

54
New cards
term image

Accepted: 10000

Rejected: 1011, 100011

55
New cards

What are the advantages of structured programming?

  • Easier to understand

  • Quicker to write

  • Less likely to contain errors

56
New cards

What are the disadvantages of structured programming?

  • Takes time to convert into machine code as it’s machine-independent

  • The converted machine code is not the same as assembly language

57
New cards

What is linear search?

An algorithm that searches through an array and returns the index of the value it searches for

58
New cards

What is binary search?

An algorithm that searches for the presence of an item stored within an array and requires all items to be in order.