100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

2.1 Elements of Computational Thinking

Rating
-
Sold
-
Pages
6
Uploaded on
11-09-2024
Written in
2023/2024

This is the topic: 2.1 Elements of Computational Thinking for the OCR Computer Science (H446) course. I got 4 A*s in my A-Levels (Computer Science, Physics, Maths, Further Maths) , so they are very detailed and cover all of the specification for this topic.

Show more Read less
Institution
OCR









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
September 11, 2024
Number of pages
6
Written in
2023/2024
Type
Other
Person
Unknown

Content preview

2.1 Elements of Computational Thinking


2.1.1 Thinking Abstractly

Abstraction:

Abstraction = The process of removing unnecessary details from a problem to focus on the relevant
and important features to implement in a solution. It involves:

 Separating ideas from reality
 Hiding detail and only using relevant detail
 Using symbols to represent elements of the problem
 It is a representation of reality

Advantages:

 Saves programming time and money as only the core features are implemented.
 Saves memory as the program won’t be as large.
 Simplifies the problem.
 Less computation.

Disadvantages:

 Models will not be as accurate.

Compared to reality:

 Abstraction is a simplified representation of reality.
 Entities are represented as computational structures (e.g. tables, databases).
 Real-world values can be stored as variables and constants.
 Objects in OOP are an abstraction of real-world entities. Attributes represent its
characteristics, and methods represent the actions it can perform.

E.g. A simulator such as a car or flight simulator, a representation of a building/house in a
program/game, a map of a bus or train route in a city.

 In a city map, greenspace and buildings are usually unnecessary. Only roads and junctions,
and places represented by icons/symbols can be included.
 In order to provide a usable map to a computer (to process routes) the map must be
abstracted. All junctions can be represented by graph nodes and each road as an edge
between each junction. Elements such as no left turnings can be represented by directed
edges. The distance between each junction can be an appropriate weight on each edge.

Other examples of abstraction are saving files (users don’t need to know how memory is managed),
sending an email (users don’t need to know which protocols are being used and how data is
formatted) and downloading content (user doesn’t need to know what security checks are made).

Programming languages are an abstraction of other languages. Assembly language uses mnemonics
to represent groups of binary digits. This is quicker, easier and less error prone than using binary (the
implementation of 0s and 1s was abstracted from the developer). However, each processor has its
own version of assembly language that can only run on a particular family of processors, and
programs had to be rewritten to run on other instruction set machines.

High level languages abstract long, complicated sequences of instructions into shorter instructions,
allowing developers to ignore how data is stored in memory. This allows them to focus on creating



1

, more complex programs quicker and easier. Therefore, a programmer doesn’t need to know all the
underlying technical complexity to create complex programs and can focus on solving the problem.

Data can also be abstracted, as programmers don’t need to know how data types are stored and
represented on a computer. High level languages allow programmers to create abstracted data
types to represent logical structures, such as modelling a queue of a restaurant, without needing to
know how queues are implemented in memory.

2.1.2 Thinking Ahead

Preconditions:

Thinking ahead is identifying the preconditions of a system: inputs, outputs and reusable
components.

Input = Any piece of data that an algorithm requires in order to run, sometimes passes as a
parameter to a subroutine.

Output = Any piece of data provided to an output device or returned to the calling subroutine.

When designing an algorithm, the inputs and outputs must be explicitly defined, including their type,
size, and format. If not defined explicitly, creating an algorithm becomes more difficult and can
cause errors and problems later on when unexpected events occur.

Preconditions = Conditions that must be true for an algorithm to complete successfully without
errors or crashing (e.g. a binary search must be supplied with an ordered list). Examples include: the
parameter list can’t be empty (index out of bounds errors will occur if not), data must be all the
same data type, the target data must be the same datatype as the list, a bubble sort may require a
list size limit to prevent it taking too long.

Advantages of specifying preconditions in a subroutine:

 If the preconditions are provided in documentation, the developer is aware of what checks
are required before calling the subroutine.
 If no preconditions are specified then the program itself will carry out any validation checks,
so the developer doesn’t have to write additional code. This reduces the length and
complexity of the program, and saves time spent on debugging and maintenance.
 Defining preconditions and inputs and outputs allows the subroutine to be reusable and put
into a library and called on at any time.

Caching:

Caching:

Cache is the tiny storage on a processor used to temporarily store frequently used data and
instructions while a program is running. Caching is the act of storing data and instructions. This is
usually performed automatically by an OS. Web caching is where HTML pages and images most
recently viewed are stored, allowing for faster access, and saving bandwidth by not requiring them
to be redownloaded each time.

Advantages:

 Saves time of retrieving instructions or values from secondary storage again.



2
£2.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
maddysunter1
5.0
(1)

Also available in package deal

Thumbnail
Package deal
OCR Computer Science A-Level - Full Notes Paper 1 & 2 (H446)
-
7 2024
£ 20.93 More info

Get to know the seller

Seller avatar
maddysunter1
View profile
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
1 year
Number of followers
0
Documents
16
Last sold
3 months ago

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions