2. problem solving and theory of computation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

computational thinking

A

the ability to think logically about a problem and apply techniques for solving it

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

pseudo-code

A

a human-readable method of writing the steps of an algorithm without any particular programming language

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

software

A

is the name given to any program written for the computer

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

analysis

A

the requirements and goals of the project must be established, and a data model created. the needs of the end user are considered, and alternative solutions to the problem may be suggested

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

design

A

data structures will be specified, algorithms, user interfaces, screen designs and reports will all be designed

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

implementation

A

the program code is written

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

testing

A

the whole system must be tested for the presence of errors, using selected test data covering normal, boundary and erroneous data

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

evaluation

A

the system is evaluated according to given criteria

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

exhaustive search

A

trying every possible combination of numbers

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

binary search

A
  1. look at the middle item of the list first. if this is the item being sought, stop searching
  2. otherwise, if the middle item is greater than the one being sought, the item you are looking for must be in the first half of the list so you can discard the second half. otherwise discard the first half of the list
  3. repeat with the new list until the item is found
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

the structures programming approach

A

aims to improve the clarity and maintainability of programs

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

sequence

A

one statement following another

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

block-structured langauges

A

e.g. python, pascal, and c#

allow the use of just 3 types of control structure

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

structured programming

A

important aspect - is to keep subroutines independent of the program which calls them, which means that they should not make use of global variables.

any variable declared in the main program should be passed as a parameter to a subroutine if it is needed.

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

top-down design

A

is the technique used of breaking down a problem into the major tasks to be performed; each of these tasks is then further broken down into separate subtasks, and so on until each subtask is sufficiently simple to be written as a self contained module or subroutine.

basically “very useful method of breaking down the problem into small, manageable tasks”

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

advantages of structured (modular) programming

A
  • individual modules can be separately tested
  • modules can be kept in a module library and reused in other programs
  • large programs can be split into modules that are easier to read, debug and maintain
  • several programmers in a team can work on separate modules, thus shortening development time for a large project
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

hierarchy charts

A

is a tool for representing the structure of a program, showing how the modules relate to each other to form the complete solution

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

limitations of hierarchy chart

A
  • does not show the detailed program structure in each module e.g. does not show selection and iteration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

algorithm

A
  • it has clear and precise stated steps that produce the correct output for any set of valid inputs
  • it must always terminate at some point
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

good algorithm properties

A
  • it should only allow for valid inputs
  • it should execute efficiently, in as few steps as possible
  • it should be designed in such a way that other people will be able to understand it and modify it if necessary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

what kinds of problem are solved by algorithms

A
  • internet-related algorithms
  • route-finding algorithms
  • compression algorithms
  • encryption algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

internet-related algorithms

A
23
Q

route-finding algorithms

A
24
Q

compression algorithms

A
25
Q

encryption algorithms

A
26
Q

divide and conquer

A

solving a large problem by breaking the problem into smaller sub-programs.

1/2 the search area ???

27
Q

bubble sort

A
  • go through the array, comparing each item with the one next to it. if it is greater, swap them
  • the last item in the array will be in the correct place after the place after the first past
  • repeat n -1 times, reducing by one on each pass, the number of items to be examined
28
Q

evaluating a problem

A

one a program has been written and tested, you need to be able to:

  • articulate how it works
  • produce test data and results to show that it works correctly
  • get user feedback to show that nothing has been omitted, that is performs all the required tasks and does so efficiently
29
Q

testing disadvantage

A
  • complex
  • time consuming
30
Q

purpose of testing

A

is to try and uncover undetected errors

31
Q

normal data

A

is data in range that you would expect, and the data type (real, integer, string etc) that you would expect.

e.g. if you are expecting an input between 0 and 100, you should test 1 and 99

32
Q

boundary data

A

is data at the ends of the expected range or just either side of it

e.g. -1, 0, 1, 99, 100, 101. test 0 and 100 to make sure that these give the expected results if the valid range is between 0 and 100.

33
Q

erroneous data

A

is data that is either outside an expected range

e.g. -1, 101, or is of the wrong data type e.g. non-numeric characters when you are expecting a number to be input

for each test you should specify the purpose of the test, the expected result and the actual result

34
Q

evaluation criteria

A
  • does it always perform as expected ?
  • is the system reliable or does it crash at intervals?
  • is the system easy to use ?
  • has it been well documented ?
  • will it be easy to maintain ?
  • how cost effective is the system - will it increase income, decrease costs, or both ?
35
Q

procedure

A

the result of abstracting away the actual values used in any particular computation is a computational pattern or method

36
Q

thinking how a problem can be solved involves two basic steps:

A
  • formulate the problem as a computational problem - state it in such a way that it is potentially solvable using an algorithm
  • try to construct an algorithm to solve the problem
37
Q

representational abstraction

A

can be defined as representation arrived at by removing unnecessary details.

38
Q

data abstraction

A

the storage and representation of data in a computer system along with its logical description and interaction with operators. this allows the construction of new compound data objects from existing ones.

39
Q

example of abstraction

A
  • any computer model, say of environment, a new car or a flight stimulator, is an abstraction…
40
Q

procedural abstraction

A

simplifying a problem by breaking it down into a series of procedures or subroutines that are generalised with variable parameters.

or using a procedure to carry out a sequence of steps for achieving some task such as calculating a student’s grade from her marks in three exam papers.

41
Q

functional abstraction

A

simplifying a problem by breaking it down into a series of reusable functions which disregard the particular computational method.

42
Q

information hiding

A

is where data is not directly accessible and can only be accessed through defined procedures/functions.

e.g. in a class where the data or attributes of the class are private and can only be accessed through public functions.

43
Q

decomposition

A

is breaking down a complex problem into a number of sub-programs, each of which performs an identifiable task

44
Q

composition

A

combining small simple procedures to form compound complex procedures

45
Q

problem abstraction

A

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

46
Q

automation

A

the process of creating algorithms and implementing them as data structures and models of real-life situations that run without the significant need for human intervention

47
Q

finite state machine

A

a model of computation used to design computer programs and sequential logic circuits.

48
Q

in a finite machine

A
  • 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; this is called a transition. often this is a switch or a binary sensor
  • the finite state machine (FSM) is defined by a list of its states and the condition for each transition
49
Q

use of finite machines

A

can be used in modelling design of hardware digital systems, compilers and network protocols.

they are also used in the definition of languages, and to decide whether a particular word is allowed in the language.

50
Q

fsm with no output

A

is also known as a finite state autorotation

51
Q

page 61

A

notation symbols

52
Q

alternative representation of fsm

A

state transition table

53
Q
A