2.1 - Elements of computational thinking Flashcards

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

What is computational thinking?

A

Ability to think logically about a problem + apply techniques for solving it.

Related to skill of designing algorithms -> turned into computer program

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

What is abstraction?

A
  • Removing unnecessary details from the problem + focusing on the main part or one part at a specific time.
  • Seperating the logical & physical aspects of a problem.
  • e.g. Physical = Driver for a car, Logical = Mechanic for a car.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What can you create with abstraction?

A
  • Devising a model that represents reality & removing details that don’t contibute to the central characteristics of the problem. E.g. London underground map.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you solve a problem using abstraction?

A
  • Can build a model of a real world object/Phenomenun may be used to help solve a particular problem.
  • Decide what details are relevent to the problem + discard everything else.
  • Algorithms + data structures can be designed to solve the problem.
  • Algorithm is then implemented in program code + executed.
  • e.g. Financial model - calculates likely profit of coffee shop from availible data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an abstract model?

A

A computer program shown by a simple diagram. Details are added until it is transformed into a computer program.

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

What are the 3 parts of a abstract model?

A
  1. Input = information relevent to the problem. e.g. could be passed as parameter to a subroutine.
  2. COMPUTATIONAL PROBELM.
  3. Output = Solution to the problem. e.g. could be passed back from a subroutine.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 2 challenges to creating a solution?

A
  1. Algorithm must be CORRECT - must work for all possible inputs.
  2. Algorithm must be EFFICIENT - Often problems involve lots of data so must find most efficient algorithm.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What should you do with inputs & outputs?

A
  • Document / Identify them so that there is no ambiguity in what must be supplied to the sub-procedure, and what is returned.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Decomposition?

A

Breaking a problem into a number of sub problems, so each sub problem accomplished an identifiable task.

Sub programs can be further divided.

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

What are the 4 features of structured programming?

A
  • It aims to improve the clarity and quality of a program.
  • Modularization for program structure + organisation
  • Structured code for the individual models; code uses basic constructs of sequence, selection & iteration.
  • Recursion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is modularization?

(In the context of structured programming)

A

Breaking the program into subroutines.

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

What is the Top-down model technique?

A
  • Program divided into sub-procedures or modules which are called from the main program.
  • Sub-procedurs can be broken down further into smaller sub tasks (Smallest part can perform a single function).
  • Represented in a heirachy chart to show overall program structure.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is a heirachy chart executed?

A

Left to right until the lowest component. (Will go down the tree back up and then continue along)

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

What are the 8 benefits of Modularization?

A
  • large programs broken down into subtasks/subroutines = easier to program + manage.
  • Each subroutine can be tested individually.
  • Modules become reusable.
  • Frequently used modules can be saved in a library & used by other programs.
  • Several programmers can simultaneously work on different modules, shortening developmentive time.
  • easier to find errors in small modules so program = more reliable + less errors.
  • Programs take less time to test + debug.
  • Programs are easier to maintain.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 2 features of an easy to maintain program?

A
  • Well organised, easy to find and self contained modules.
  • New features added by adding new modules.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 5 features of good programming practice?

A
  • Meaningful identifiers.
  • Define + document inputs/outputs/preconditions for each sub-procedure.
  • Lots of meaningful comments within the program.
  • At bottom level, each sub procedure should perform a single task.
  • Keep each sub-procedure self contained by passing parameters + local variables.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What should you do once you have identified the components of the program?

A

Plan the overall method of the solution; involves writing procedures/functions + passing parameters.
e.g. car dealer wants program to help potential customer select options for a new car.

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

What are the 3 advantages of preconditions?

A
  1. Makes program components reusable.
  2. Cuts out unnecessary checks.
  3. Makes programs easier to debug.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the 5 typical standards for reusable models?

A
  • Inputs + Outputs + preconditions should be documented in standard format. (explaining what the module does who it was written by, date is was)
  • Variable identifiers should conform to standard convention.
  • All variables should be local to the module.
  • Explanations of certain sections of code should be included when necessary.
  • No module should exceed one page of code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Why are the 3 reasons for a program module to be reusable?

A
  • Easier to use for other programmers.
  • Can be added to a library + imported whenever needed.
  • In a large project - saves time in writing + testing functions which have already been written, debugged and tested.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is another aspect of thinking ahead?

A

Anticipating what the user may want to do next.
e.g. impact menu design in software package with several levels of menu.

22
Q

What is caching?

A

A temporary storage of data and instructions.
Last few instructions of a program to be executed, the result of an earlier computation, or data used may be stored in memory so they can be revied quickly.

23
Q

What is web caching?

A

Storing HTML pages + images recently looked at, is often asked.

24
Q

What are the 3 advantages to caching?

A
  • Faster access to cached resources.
  • Saving on costly use of bandwidth.
  • Reduced load on web services in client-server environment.
25
Q

What are the disadvantages of caching?

A
  • slower performance if the resouce isn’t found in cache.
  • Access database to set a list of availble products which is then cached. You make a few other queries then a bit later mjake your original query again. If the query results have been cached, you may see the same availible products but they could have been sold in the meantime.
26
Q

What are the 5 qualities of a good algorithm?

A
  • Clear + precisley stated steps produce correct output for any set of valid inputs.
  • Allow for invalid inputs.
  • Must always terminate at some point.
  • Execute efficiently in as few steps as possible.
  • Designed so other people can understand + modify it if necessary.
27
Q

What is efficiency?

A

Computational costs(time of processing)

28
Q

What are algorithm tools?

A
  • Heirachy chart.
  • Flowcharts.
  • Pseudocode.

(Involve decisions)

29
Q

What is a benefit of a heirachy chart?

A

Useful for identifying major tasks + breaking these down into subtasks.

30
Q

What is a benefit of a flowchart?

A

Useful for getting down initial ideas for individual subroutines.

31
Q

What is a benefit of pseudocode?

A

Translates easily into program code

32
Q

What are the 3 types of decision statements?

A
  • IF + CASE statements.
  • WHILE, FOR + REPEAT loops (Implicitly involve decisions).
  • Boolean conditions.
33
Q

What do boolean conditions determine?

A

Whether control passes back to the begining of the loop or continues to the next statement.

34
Q

What is a common cause of logical errors?

A

Problem in conditional statements or loop condition.

35
Q

What is a dry run algorithm?

A

Going line by line.

36
Q

What are the benefits of hand trailing?

A
  • Figuring out how algorithms work.
  • Finding out why an algroithm isn’t working correctly.
37
Q

What does as trace table do?

A

Writes the contents of each variable during execution.

38
Q

What are validation routines?

A

Check if the user has entered a valid input.

Processing can involve tricky Boolean routines.

39
Q

What is working concurrently?

A

Doing multiple tasks at the same time.

40
Q

What is concurrent processing?

A

Each task is given a slice of procesor time so tasks appear to be completed simultaneously.

Tasks actually being executed sequentially.

41
Q

What is Parallel processing?

A

When multiple processors are used to complete more than one task simultaneously. Tasks are broken down and split amoung multiple processors.

Reduces the amount of time the program takes to run.

42
Q

What is the benefit of having more cores?

A

There is more power.

Multiple processors = faster web browsing than a single core (CPU).

43
Q

What can quad cores be used for on a mobile device?

A
  • Video editing.
  • Image processing.
  • Facial recognition.
  • 3D stereogames + applications.
  • Virus scans
44
Q

When is concurrent processing also used?

A

When several computers are joined in a network.

45
Q

What are the advantages of concurrent processing?

A
  1. Reactive programming.
  2. Availibility of services.
  3. Parallelism.
  4. Controllability.

no. tasks completed in a given time is increased.
Time that would be wasted by processor waiting on a user or another process is reduced.

46
Q

What is reactive programming?

(Concurrent processing)

A

Users are able to interact with applications while other tasks are running.

47
Q

What is the benefit of availability of services?

(Concurrent processing)

A

A long-running task won’t delay short-running ones.

48
Q

What is a positive feature of parallelism?

(Concurrent processing)

A

A complex program can make use of multicore and/or multi processor systems.

49
Q

What is the benefit of controllability?

(Concurrent processing)

A

A task requiring preconditions to proceed can be suspended and easily resumed later.

50
Q

What are the 3 disadvantages of concurrent processing?

A
  • Safety.
  • Liveness.
  • Resource consumption.
51
Q

What is the problem of safety?

(Concurrent processing)

A

Possibility of corrupting the consistent state of a program.

52
Q

What is the problem with liveness?

(Concurrent processing)

A

Tasks can suspend and wait on each other indefinitely, known as deadlock.