Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Overig

2.1 Elements of Computational Thinking

Beoordeling
-
Verkocht
-
Pagina's
6
Geüpload op
11-09-2024
Geschreven 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.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

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

Geschreven voor

Study Level
Publisher
Subject
Course

Documentinformatie

Geüpload op
11 september 2024
Aantal pagina's
6
Geschreven in
2023/2024
Type
OVERIG
Persoon
Onbekend

Onderwerpen

$4.81
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
maddysunter1
5.0
(1)

Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
maddysunter1
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1
Lid sinds
1 jaar
Aantal volgers
0
Documenten
16
Laatst verkocht
8 maanden geleden

5.0

1 beoordelingen

5
1
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen