0% found this document useful (0 votes)
418 views52 pages

AQA Comp Sci WB2 Answers Ms

ccczsczsczsczzzccczc

Uploaded by

ksshubhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
418 views52 pages

AQA Comp Sci WB2 Answers Ms

ccczsczsczsczzzccczc

Uploaded by

ksshubhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 52

WORKBOOK ANSWERS

AQA AS/A-level
Computer Science 2
Fundamentals of data
representation
Number systems, number bases and units of
information
1 a i 7 or 0 (1)

ii –3 (1) (ℤ is the set of integers, ℕ is the set of natural numbers)

iii 6.3 (1) (ℚ is the set of rational numbers)

iv 3 or π (1)

v –3 (1) (ℝ is the set of real numbers, including all natural numbers, integers, rational
numbers and irrational numbers)

b A number that can be represented as a fraction. (1)

c Any integer divided by 1 is equal to itself OR By example, e.g. . (1)

2 a (1 mark for each correct value)

Binary Denary Hexadecimal


1011 11 B
0101 1010 90 5A
0011 0111 55 37
1100 1101 205 CD
b Any one from: (1)

More compact to display.


Fundamentals of data representation

Easier to understand/remember.

Less likely to make typing errors.

Saves time to write/type.

NB: Don’t allow 'takes up less space' – not clear that this refers to display space, hexadecimal
does not save storage space.

3 a 8 (1)

b 16 (1) (1 nibble = 4 bits)

c 256 (1)

4 a 1 byte (1)

b 1000 bytes (1)

c 1024 bytes (1)

d 5 300 000 bytes OR 5.3 million bytes OR 5.3  109 bytes (1)

Binary number system


5

Denary number Positive binary Negative binary


37 0010 0101 1101 1011
73 0100 1001 1011 0111
124 0111 1100 1000 0100
100 0110 0100 1001 1100
1 mark per correct answer

a 0 1 0 1

1 0 1 0 +

1 1 1 1 (1)

b 1 0 1 1 0 1 0 1

0 1 1 1 1 1 0 1 +

01 01 11 11 01 0 11 0 (1 mark per correct nibble – ignore a ninth ‘1’ on the far left)

c Overflow OR an overflow error (1)

7 0 0 1 0 0 1 1 0 *

0 0 0 0 0 0 1 1
Fundamentals of data representation

0 1 0 0 1 1 0 0 + (1 mark for shifting left once)

0 0 1 0 0 1 1 0 (1 mark for not shifting)

0 1 1 1 0 0 1 0 (1 mark for correctly adding)

8 (1 mark per correct answer)

Binary representation Denary representation


0101 . 1000 5.5

1001 . 0110
9.375 OR 9 + 0.25 + 0.125 OR

1011 0111 . 1111


183.9375 OR 183 + 0.5 + 0.25 + 0.125 + 0.0625 OR

1011 . 1100 11.75

1001 . 1010 9.625

1001 0011 . 0101 147.3125

9 a Shift by 5 OR 0001 1111 . 01 (1)

Conversion to denary: 31.25 OR (1)

b Shift by 7 OR 1100 1101 (1)

Use of two's complement: 0011 0011 (no marks for this step)

Conversion to denary: –51 (1)

10 a Conversion to binary: 1010 1110 (1)

Calculation of exponent: 7 (1)

Final answer: M: 0.101 0111 E: 0111 (1)

NB: Exactly 8 bits for mantissa/4 bits for exponent required for final mark.

b Conversion to binary: 0.0001 (1)

Calculation of exponent: –4 (1)

Final answer: M: 0.100 0000 E: 1100 (1)

NB: Exactly 8 bits for mantissa and 4 bits for exponent required for final mark.

11 a Absolute error: 0.0375 (1, must be positive)

Relative error: 0.82% OR 0.0375 ÷ 4.6 (1)

b Absolute error: 0.025 (1, must be positive)


Fundamentals of data representation

Relative error: 0.15% OR 0.025 ÷ 17.2 (1)

Information coding systems


12 (1 mark for each correct answer)

Character ASCII – upper case ASCII – lower case


A 65 97
B 66 98
D 68 100
L 76 108
13 a 128 OR 27 (1)

b 65 536 OR 216 (1)

c Any two from: (2)

To encode a wider range of alphabets OR specific examples, e.g. Japanese, Cantonese,


Mandarin, Cyrillic. (1)

To allow for including an increased range of non-alphabetic symbols (e.g. divide sign, sigma
sign, copyright sign, emojis). (1)

Improved portability/compatibility between systems OR a system might assume the wrong


character set from a smaller encoding system. (1)

14 a 0011 0000 (1)

b Rejected (1)

Because the number of 1s is odd (and the system is using even parity). (1)

c If two (or more) errors occur then the parity check may be passed. (1)

Simple parity is not sufficient to correct the error. (1)

15 a 0110 (1)

b Each bit is transmitted multiple times OR 3 times OR 5 times OR any odd number greater
than 2. (1)

The receiver checks if all the bits are the same each time. (1)

If they are not then it assumes the value received the most times is correct. (1)

c A calculation is performed using the bits that are to be sent OR a (single-digit) value is
produced by an algorithm. (1)

When received, the same algorithm is used to calculate the check digit. (1)

If the digits match then the transmission is accepted OR if the digits don’t match then the
transmission is rejected. (1)
Fundamentals of data representation

d A check digit is exactly one digit in length. (1)

A checksum can be of any length. (1)

Representing images, sound and other data


16 a 6 000 000 pixels/6 million pixels OR 6 megapixels (1)

b 256 or 28 (1)

c 6 million pixels * 8 bits per pixel ÷ 8 bits per byte (1 mark for any two parts applied correctly)

6 MB OR 6000 kB OR 6 000 000 bytes (1)

NB: Only allow 1 mark if no working shown.

d Any three from: (3)

Pixel dimensions OR image height OR image width OR colour depth OR colour palette OR
date the image was created OR date last modified OR date last opened OR location (in the
case of photographs) OR file type OR application used to edit OR camera used OR camera
settings OR facial recognition data (tagged person) OR any other reasonable answer.

17 a 4 OR 4 bits per pixel (1)

b 420 px * 120 px * 4 bits per pixel ÷ 8 bits per byte (1, any three parts applied correctly)

210 000 bytes OR 210 kB (1)

NB: Only allow 1 mark if no working shown.

(Don’t penalise twice – allow following mark if part (a) incorrect.)

18 a Any three from: (3)

Coordinates OR edge thickness OR edge colour OR fill colour OR edge style OR fill style OR
object type.

b Vector: logo OR clipart OR font OR cartoon (1)

Bitmap: photograph OR poster OR flyer OR any other suitable answer (1)

19 a 120 kHz (1)

Nyquist’s theorem OR the minimum sample rate should be at least double the maximum
frequency to be recorded. (1)

b 100 000 samples per second * 30 seconds * 12 bits per sample ÷ 8 bits per byte (1 mark for
any three correct elements)

4.5 MB OR 4500 kB OR 4 500 000 bytes (1)

NB: Only allow 1 mark if no working shown.

c Quality: improved accuracy of the sounds (1)


Fundamentals of data representation

File size: doubled OR 2  file size (1)

20 Any three from: (3)

Channel OR note-on/note-off OR pitch/frequency/note number OR volume OR velocity OR


key pressure OR duration OR timbre OR instrument OR pedal effects OR pitch bend OR
envelope.

21 a Repeated values can be stated once (1) along with the number of times they are repeated (1)

e.g. T8A4 OR 8T4A (1)

b Repeated patterns can be stored in a dictionary (1) and referred to by their index (1)

e.g. CGT : 1, AA: 2, Sequence: 12121 (1) (Allow any sensible sequence.)

Encryption
22 a HOHSKDQW (1)

b APRIL (1)

c FGGF (1)

d FGGF (1)

e A shift of +21 is identical to a shift of –5 as the wheel contains 26 letters. (1)

f One of: (2)

Point: brute force (1) Explain: try every possible combination as there are only 25. (1)

Point: frequency distribution (1) Explain: assume the most common letters in the ciphertext
relate to the most common letters in plaintext, typically ‘e', ‘t’, ‘a’. (1)

23 a 0100 0011

1100 1010 XOR

1000 1001 (1 mark for the answer only)

b 0100 0010 0100 0001 0100 0100 (1 mark for writing out BAD in ASCII)

1010 0111 0101 1011 1001 0110 (1 mark for laying out key correctly)

1110 0101 0001 1010 1101 0010 (1 mark for applying XOR)

c Key must be completely random. (1)

Key must not be re-used OR can only be used once. (1)

Key must not be shared. (1)

d The same key is used to encrypt and decrypt the ciphertext/plaintext. (1)
Fundamentals of data representation

Exam-style questions
24 a (1 mark per correct row)

Number ℤ ℝ ℚ ℕ Irrational
3.7  

–9   

4    

π 

b To denote the order of a set of values OR to denote the position or rank of each item. (1)

25 a 0001 0001 (1)

b 0111 1110 (1 mark for showing positive representation)

1000 0010 (1 mark for correctly applying two's complement)

26 a 32 + 16 + 8 + 2 = 58 (1 mark for correct answer only)

b 0011 0000 (1 mark for correctly applying two's complement)

–96 (1 mark for correctly converting to denary)

27 a 172 (1)

b 1010 1100 (binary)

10 12 (denary representation of each nibble)

AC (1 mark for correct answer only)

c 0101 0100 (applying two's complement)

–84 (1 mark for correct answer only)

d 1010 . 1100 (binary with decimal place present)

8 + 2 + ½ + ¼ (conversion process)

10.75 (1 mark for correct answer only)

28 a 0 0101.01 (1) (Move decimal point by 5 for the value of the exponent. Allow/ignore leading
zeros.)

4+1+¼

5.25 (1 mark for correct answer)

b In a normalised floating point number the first two bits/most significant bits will be different. (1)

Mantissa: 0.1010100 Exponent: 0011 (1)


Fundamentals of data representation

c 0001 1001 . 11 (1 mark for conversion to binary)

Mantissa: 0.1100111 (1 mark for correctly normalised mantissa)

Exponent: 0101 (1 mark for correct exponent for denary 5)

d 33.75 for 33.68 = 0.07 (1 mark, must always be a positive number)

e 0.07 ÷ 33.68 = 0.21% (1 mark for correct answer only)

29 a Unicode uses more bits per character OR uses 16 bits. (1)

So more characters are available OR can send messages that use characters beyond the
basic Roman alphabet OR can send messages in other languages OR can send messages
that use emojis. (1)

b A method of converting a plaintext message to a ciphertext message OR altering a message


so that it cannot be understood by unauthorised people/devices. (1)

c 0100 0001 0100 0010 0100 0011 (1 mark for correctly listing ASCII codes)

0101 1010 0010 0110 0111 1011 (1 mark for correctly listing the key)

0001 1011 0110 0100 0011 1000 (1 mark for correctly applying XOR)

d Indicative response

Brute force

The Caesar cipher uses one common key for all characters. It is trivially easy to try all 25
combinations of keys for a Caesar cipher and there are very few possible double-matches
(where one ciphertext word could be converted to more than one plaintext word).

It is impossible to use a brute force approach to crack the Vernam cipher as each character
uses a different key.

Frequency analysis

With the Caesar cipher, it is likely that the most commonly found characters in the ciphertext
message will match the most commonly found characters in the language (e.g. ‘e’, ‘a’, ‘t’ in
English). The letter 'q' in English is almost always followed by the letter ‘u’. As the same key is
used throughout, once a match has been made for some letters, the entire message will be
compromised.

With the Vernam cipher, each character is encrypted using a different key and therefore
frequency analysis is unhelpful. Even if one or two characters could be cracked with
confidence, this would give no clue to the remainder of the message.

Rules for key security

As long as the key is:

 truly random

 only used once (is at least as long as the message)


Fundamentals of data representation

 can be kept secret by both sender and receiver

then the encryption is mathematically secure and cannot be decrypted even given infinite time
and infinite ciphertext, whereas this is not true of the Caesar cipher.

Level Description Marks


3 A line of reasoning has been followed to produce a 5–6
coherent, relevant, substantiated and logically
structured response. The response covers all areas
indicated in the indicative response and there is
sufficient detail to show that the student has an
excellent level of understanding of the issues
involved.
2 A line of reasoning has been followed to produce a 3–4
coherent, relevant, substantiated and logically
structured response but the response may only cover
some of the areas indicated in the indicative
response. A reasonable understanding is shown of
each of these areas.
1 A few relevant points have been made but there is no 1–2
evidence that a line of reasoning has been followed.
The points may only relate to one of the areas from
the indicative response or may be made in a
superficial way with little substantiation.
30 a The smallest addressable element of an image. (1)

b 6000 × 4000 = 24 million pixels (1)

24 million × 24 bits per pixel ÷ 8 bits per byte = 72 million bytes (1)

= 72 MB (1)

c Any two from: (2)

Dimensions OR resolution (both are the same in computing terms)

Colour depth OR bit depth

Colour palette

Data last opened/modified

Camera settings

Geo-location settings.

d Reducing the resolution/dimensions/pixel count of the image. (1)

Using fewer pixels the file size can be reduced, but without lowering the quality so much that
it becomes intrusive. (1)

Reducing the colour depth/bit depth/number of colours. (1)


Fundamentals of data representation

By reducing the number of colours fewer bits will be needed to store the colour of each pixel.
(1)

e A string of identically coloured pixels (1) could be stored by recording the number of pixels
and then the colour. (1)

(Allow demonstration by example, e.g. if there were 10 identical black pixels in row then
storing ’10  black' is much shorter than storing black 10 times.)
Fundamentals of computer systems

Fundamentals of computer
systems
Hardware and software
1 a To hide the complexity of the hardware from the user. (1)

b Any four from: (4)

Management/allocation of processors

Management/allocation of memory/RAM

Management of IO devices/peripherals OR device drivers

Management of backing store/secondary storage/file management

Power/battery management

Interrupt handling.

2 a i Translator (1)

ii Utility program (1)

iii Application software (1)

iv Application software (1)

NB: An IDE is designed to allow the user to write, edit and run program code; it is not software
designed to help the computer system run.

b A resource/collection of program code. (1)

To reduce the amount of programming required OR to provide access to subroutines OR to


allow sharing of code across different programs. (1)

c (Allow any reasonable response (too many to list here).)

Mark in pairs, 1 mark for identification and 1 mark for explanation. Max. two pieces of
software: (4)

e.g.

Anti-virus/anti-malware; used to detect and remove viruses/malware.

Firewall; used to control/prevent data from being transmitted or received.


Fundamentals of computer systems

Device driver; used to allow the operating system to communicate with an external
device/peripheral (allow by example, e.g. printer).

Backup manager; used to schedule/organise backup and recovery of data.

System monitor; used to record/display data relating to the system such as memory usage,
processor usage, temperature, etc.

Classification of programming languages and


types of translator
3 a Similarity: both programs will be the same length/have the same number of instructions. (1)

Difference: the machine code program will be represented in binary. The assembly language
program will be represented using characters/mnemonics OR the assembly language
program will be stored using ASCII/Unicode. (1)

NB: Refuse ‘stored’ instead of ‘represented’ but allow ‘written’. All data stored in a computer
system is ultimately stored as binary. Allow ‘stored’ in reference to ASCII/Unicode as the
distinction is clear.

b Assembler (1)

4 a High-level language (1)

Justification: Any three from: (3)

The program needs to run on several different platforms.

Low-level programming languages are platform specific OR high-level languages can be


translated/run on different platforms.

It is quicker for developers to write programs using high-level languages.

It is easier for developers to write OR read OR debug OR maintain code using high-level
languages.

Comments can be added to high-level code to make the code easier to understand/maintain.

b Interpreter (1)

5 a Instructions are carried out in a specified order/sequence. (1)

The language describes how to solve the problem. (1)

b Any four from: (4)

Bytecode is an intermediate code designed to be run on a virtual machine OR bytecode is a


type of machine code that will run on a software platform rather than a hardware platform. (1)

This allows a high-level language to be compiled into a format that will run on any platform.
(1)
Fundamentals of computer systems

As long as the virtual machine is present (e.g. Java and the Java Virtual Machine (JVM)) (1)
the bytecode is then compiled by the virtual machine at (or just before) runtime into machine
code for that specific platform. (1)

This gives the appearance that compiling the program produces platform-specific machine
code, while actually allowing the compiled bytecode to be executed quickly across multiple
platforms. (1)

Logic gates and Boolean algebra


6 a OR gate (1)

A B P
0 0 0
0 1 1
1 0 1
1 1 1
A and B show four unique combinations (any order) (1)

Correct values for P (1)

c NAND gate (1)

A B P
0 0 1
0 1 1
1 0 1
1 1 0
A and B show four unique combinations (any order) (1)

Correct values for P (1)

e XOR gate (1)

(1)

NB: Ignore any labelling.

f NOT gate (1)

(Allow buffer.)

7
Fundamentals of computer systems

A B C D E
0 0 0 0 0

0 1 1 0 1

1 1 1 1 1

1 0 0 0 0

All column D correct (1)

All column E correct (1)

b E = A.B + C (Allow (A.B) + C)

Correctly identifying A.B OR + C (1)

If completely correct (1)

8 NB: For Boolean algebra questions, examiners typically mark until they see the FIRST error.

Steps CAN be combined and marks should be awarded where the working is clear even if two
steps have occurred at the same time BUT it is much better to show EVERY step.

a A (1)

b 0 (1)

c 0 + Y + Y = 0 + 1 (1 mark for applying identity Y + Y = 1)

0 + 1 = 1 (1)

d A.( A + B) = A. A + A.B (1 mark for expanding brackets)

= 0 + A.B (1 mark for applying identity)

= A.B (1 mark for applying identity)

e (P + Q).( P + Q ) = P. P + P.Q + P .Q + Q.Q (1 mark for expanding brackets)

= 0 + P .Q + P.Q + 0 (1 mark for applying identity twice)

= P .Q + P.Q (1 mark for applying identity to remove zeros)

= P ⊕ Q (1)

f ( a+ b ) . a=á .b . a (1 mark for applying De Morgan’s Law)

= a.b .a (1 mark for cancelling double NOT)

= a.b (1)

g ( ( x . y ) . x ) . y=( ( x ´. y )+ x ) . y (1 mark for applying De Morgan’s Law)


= ¿ + x ). y (1 mark for cancelling double NOT)
Fundamentals of computer systems

= x . y . y+ x . y (1 mark for expanding brackets)

= x .0 + x . y (1 mark for applying identity on y . y ¿

= x . y (1)

(Allow x + y )

Alternative approach (max. 5 marks)

( ( x . y ) . x ) . y=( ( x . y ) . x ) + y
= (( x + y ) . x )+ y

= ( x .x+x. y )+ y

= 0+ x . y+ y

= x . y+ y

= x.y. y

= (x + y ). y

= x . y+ y . y

= x.y

9 a Used to store the state of data OR used as memory. (1)

b Clock/trigger/enable (1)

Used to output the current state of the input. (1)

(Accept: Allows synchronisation with other flip-flops.)

Data (1)

Used to accept data OR allow data input OR change the internal state of the D-type flip-flop.
(1)

NB: The model of the D-type flip-flop used by AQA (and some other exam boards) only has two
inputs: data and clock, without set or reset. Some resources may include all four.

Exam-style questions
10 a Software designed to manage the system OR allow the system to run OR manage the
computer hardware (1)

b 1 mark for identification, 1 mark for explanation, 1 mark for example


Fundamentals of computer systems

Utility (program) (1) a program used to maintain/optimise a computer system. (1) Any suitable
example, e.g. anti-malware, firewall, disk defragmenter, disk clean up, system monitor,
backup manager, etc. (1)

Library (program) (1) a resource OR collection of program code that can be accessed by
other programs. (1) Any suitable example, e.g. math library, random number library, GUI
library, etc. (1)

Translator (1) used to translate high-level language OR assembly language source code into
machine code (for execution). (1) Example: assembler OR compiler OR interpreter. (1)

c Role of the OS: to hide the complexity of the hardware from the user. (1)

Key functions: Any six from: (6)

Processor scheduling OR allocation of processors

Memory management OR allocation of RAM

Virtual memory management OR allocation of VM

Peripheral management OR I/O management

File management OR backing store management OR secondary storage management

Interrupt handling

Power management OR battery management

User interface provision

Thread management (in the context of CPU/processor scheduling).

11 a Need:

The high-level language source code cannot directly be understood/executed by a processor


(1) and must therefore be translated into machine code in order to be executed. (1)

Steps: Any three from: (3)

Each instruction is checked for syntax errors. (1)

Each instruction is translated into machine code instructions. (1)

Using the instruction set specific to that system/platform OR processor. (1)

One HLL instruction may be translated into several machine code instructions. (1)

Each instruction is then executed by the process (in the case of an interpreter) OR stored in
an object code/machine code/bytecode file (in the case of a compiler). (1)

b Any two from: (4) (Mark in pairs: 1 mark for identification, 1 mark for expansion)

Easier/quicker to read/write (1) as HLL is closer to natural language OR English. (1)

Less likely to make mistakes (1) as machine code looks very similar OR counter argument for
HLL. (1)
Fundamentals of computer systems

Logic in HLL is easier to follow (1) due to the use of structured statements OR data structures
OR comments. (1)

Can be run on different platforms (1) as machine code is specific to one instruction set OR
platform. (1)

c Indicative response

The source code can be made available so that others can view/edit/improve/maintain the
algorithms/program code. The program can be updated more easily as the form and structure
of the data may change over time.

The program will not need to be translated separately for each platform before it is shared
and the program will work on any platform for which an interpreter is available.

Debugging will be easier as the program will halt at the exact point in the program where an
error is detected.

Some programming languages are restricted to either a compiler or an interpreter. Paul may
have chosen a programming language that does not have a compiler available.

Level Description Marks


3 A line of reasoning has been followed to produce a coherent, 5–6
relevant, substantiated and logically structured response. The
response covers all areas indicated in the indicative response
and there is sufficient detail to show that the student has an
excellent level of understanding of the issues involved.
2 A line of reasoning has been followed to produce a coherent, 3–4
relevant, substantiated and logically structured response but
the response may only cover some of the areas indicated in
the indicative response. A reasonable understanding is shown
of each of these areas.
1 A few relevant points have been made but there is no 1–2
evidence that a line of reasoning has been followed. The
points may only relate to one of the areas from the indicative
response or may be made in a superficial way with little
substantiation.
12 a 0 (1)

b 1 (1)

c a .(b+b) (1 mark for factorising)

a.1 (1 mark for Boolean identity)

a (1 mark for correct answer)

(Max. 1 mark for working, 1 mark for correct answer)

d a . b (1 mark for application of De Morgan’s Law)

a . b (1)
Fundamentals of computer systems

e LHS RHS

(a . a+ b . a) (b . a+ b . b)

(0+ b . a) (b . a+ 0)

b.a b.a

b+ a b+ a

b+ a b+ a
1 mark for expanding brackets

1 mark for Boolean identity, e.g. a . a=0

1 mark for Boolean identity, e.g. 0 + x = x

1 mark for De Morgan

1 mark for cancelling double negative

1 mark for identical final answer for both sides

Mark positively: reward any legitimate manipulation.

Stop marking on each side once a mistake has been made.

13 a (4)

1 mark per correctly connected gate

(Allow AND between A OR B and C, then the second AND between this and NOT D.)

b X =( A + B ) .C . D (2)

1 mark for A + B

1 mark for C . D

Ignore extra brackets, e.g. ( A+ B ) . ¿ or ( ( A+ B ) . C). D


Fundamentals of computer systems

14 a

A B C S
0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

1 mark for column C

1 mark for column S

b Half adder (1)

c Used to add two binary digits OR two single-bit binary numbers (1) and output the result as a
two-digit binary number OR output the sum and carry. (1)

NB: Refuse ‘binary numbers’ unless explicitly stated that they are single-bit.

d By using two half-adders and an OR gate OR XOR gate (1) two-digit/n-digit/numbers of more
than one digit can be added together. (1)

15

A B Cin A⊕B A.B (A⊕B).Cin Cout S


0 1 1 1 0 1 1 0
1 1 1 0 1 0 1 1
1 1 0 0 1 0 1 0
1 0 0 1 0 0 0 1
1 mark for correct values for Cout

1 mark for correct values for S

1 mark for evidence of following the circuit diagram and not simply adding the three binary
numbers

Order of columns not important. Not all three intermediary columns required to be used.
Fundamentals of computer organisation and
architecture

Fundamentals of computer
organisation and
architecture
Internal hardware components
The stored program concept, structure of the
processor and its components
External hardware devices
1 a

Label Component name


a Any suitable output device – monitor, speaker, printer (1)
b Processor/CPU (1)
c Main memory/RAM (1)
d Any suitable input device – keyboard, mouse, microphone, scanner
(1)
e Address bus (1) NB: Unidirectional – away from the CPU.
f Data bus (1) NB: Sends data to the output device, receives from
the input device.
g Control bus (1) NB: Bidirectional in all locations.
b 1 (1)

c Any two from: (2)

More data can be transferred simultaneously.

Decreases the time taken to transfer data into/out of the processor.

Increases the performance of the computer system.

Step number Step Description


Fundamentals of computer organisation and
architecture

1 MAR  [PC] The contents of the program counter


are copied into the memory address
register.
2a PC  [PC] + 1 The program counter is incremented.
2b MBR  [Memory] addressed The contents of the memory location
addressed by the memory address
register are copied to the memory
buffer register/memory data register.
3 CIR  [MBR] The contents of the memory buffer
register are copied to the current
instruction register.
4 Decode The contents of the current instruction
register are decoded (by the control
unit).
5 Execute The instruction is executed.
1 mark for three steps in the correct positions

1 mark for all steps in the correct position

1 mark for each correct description (match to the step, not the step number)

(Max. 8 in total)

b Both steps use separate registers/neither step directly impacts the data required for the other.
(1)

c Current state of the processor is saved in a stack. (1)

The source of the interrupt is identified. (1)

The appropriate Interrupt Service Routine (ISR) is called. (1)

The saved state of the processor is restored. (1)

d In von Neumann architecture, both programs and data use the same main memory OR data
bus. (1)

In Harvard architecture, programs are stored in one block of memory and data in another OR
programs and data are fetched using different buses. (1)

e Embedded system OR digital signal processing OR any reasonable example of an embedded


system. (1)

3 a To save data/programs (1) so that they can be accessed at a later time. (1)

b DVD drive (1)

c (External/backup) HDD (1)

d Any five from: (5)

Smaller physical size


Fundamentals of computer organisation and
architecture

Faster read/write times

Less likelihood of damage when moved

More reliable due to lack of moving parts

Lower power usage

Less noise due to lack of moving parts

Less heat generated due to lack of moving parts

Not susceptible to magnetism.

e Indicative response

Printer contains positively charged toner.

Printer generates a bitmap image based on the data received.

Print drum coated with a positive charge.

Laser beam directed by a mirror.

Laser beam fired at drum.

Laser switches on and off.

Laser beam removes charge where the ink should be attracted.

Charged portions of the drum attract the toner.

In colour printers, each colour has its own drum.

Paper is rolled over the drum/toner is transferred to the paper.

Fuser seals the toner onto the paper

Level Description Marks


3 At least five items in the indicative response have been 5–6
mentioned. There is sufficient detail to show that the student
has an excellent level of understanding of the issues involved.
2 At least three items in the indicative response have been 3–4
mentioned. A reasonable understanding is shown of each of
these areas.
1 At least one item in the indicative response has been 1–2
mentioned. Statements may be made in a superficial way with
little substantiation.
4 a

Register Current value


R0
R1
Fundamentals of computer organisation and
architecture

R2 0100 1001
1 mark for updating correct register

1 mark for correct value stored

b Immediate (1)

Register Current value


R0 0000 0100
R1
R2
1 mark for updating correct register

1 mark for correct value stored

d To check if the value in R0 is divisible by the value in R1. (1)

(Accept: Check if the value in R0 is divisible by 4.)

e Design

Identifying that a Logical Shift Right, followed by Logical Shift Left are required to perform the
integer division and multiplication. (1)

Identifying that a compare and branch are required in place of the IF statement. (1)

Programming

Performing logical shift right by 2 to perform integer division. (1)

Performing logical shift left by 2 to perform multiplication. (1)

Performing comparison of the result and the original value, with a suitable branch. (1)

Moving 0 into R3 where appropriate. (1)

Moving 1 into R3 where appropriate. (1)

Using a branch or HALT to skip over the second MOV instructions. (1)

Example solution

LSR R2, R1, #2

LSL R2, R2, #2

CMP R1,R2 OR CMP R2,R1

BEQ same

MOV R3, #0

HALT OR B end
Fundamentals of computer organisation and
architecture

Label same

MOV R3, #1

Label end

HALT

Exam-style questions
5 a

Registers Memory
R0 R1 R2 R3 600 601 602 603 604
0 3 601 12 3 12 9 14 11
12 2 602 9
21 1 603 14
35 0 604 35
R1 should count down from 3 to 0 (1)

R2 should count up from 601 to 604 (1)

R3 should store the value in the corresponding memory address from R2 (1)

R0 should provide a running total (1)

The final total should be stored in memory address 604 (1)

b Repeatedly adds n numbers, where n is the value stored in memory address 600 (1) and
stores the answer in the next memory address. (1)

(Accept any suitable answers where the understanding is clear.)

c Any four from: (8) (Mark in pairs: 1 mark for identification, 1 mark for expansion)

Increased cache size (1) so that more of the most frequently used programs/data can be
made available for fast access. (1)

Increased number of cores (1) so that more instructions can be executed simultaneously. (1)

Increased clock speed (1) so that more instructions can be executed in the same amount of
time. (1)

Wider data bus (1) for greater throughput of data into the processor OR reduces bottlenecks
when retrieving data. (1)

Larger word length (1) for larger values OR values with greater precision can be processed in
fewer steps. (1)

Wider address bus (1) allows for larger allocation of main memory/RAM (which reduces the
need for slower virtual memory). (1)

6 a Lower cost per unit of storage for magnetic hard drives OR higher cost per unit for SSDs. (1)
Fundamentals of computer organisation and
architecture

Larger capacity available for magnetic hard drives OR smaller capacities typical for SSDs. (1)

b Indicative response

DVD/Optical

Advantages:

 Cheap per disc

 Small physical size/easy/cheap to post

 Can view photos through a DVD player on a TV

Disadvantages:

 Slow to read/write

 Not every computer has an optical drive

 Easily scratched/damaged

USB stick/solid state

Advantages:

 Fast read/write time

 Small physical size/easy/cheap to post

 Almost all devices have a USB socket

 Can view photos through a USB socket on a TV

 Resilient/difficult to damage

 Cheaper than a magnetic hard drive

Disadvantages:

 More expensive than a DVD

 Need to make sure there is sufficient capacity

Magnetic hard drive

Advantages:

 Very large storage capacity

 Low price per GB

Disadvantages:

 Large/heavy/expensive to post

 Large price per item


Fundamentals of computer organisation and
architecture

 Unnecessarily large storage capacity

 Susceptible to damage during shipping

(Reward any reasonable conclusion in favour of a suitable medium except magnetic hard drive.)

Level Description Marks


3 A line of reasoning has been followed to produce a coherent, 5–6
relevant, substantiated and logically structured response. The
response covers all areas indicated in the indicative response
and there is sufficient detail to show that the student has an
excellent level of understanding of the issues involved.
2 A line of reasoning has been followed to produce a coherent, 3–4
relevant, substantiated and logically structured response but
the response may only cover some of the areas indicated in
the indicative response. A reasonable understanding is shown
of each of these areas.
1 A few relevant points have been made but there is no 1–2
evidence that a line of reasoning has been followed. The
points may only relate to one of the areas from the indicative
response or may be made in a superficial way with little
substantiation.
Consequences of uses for computing

Consequences of uses for


computing
1 Copyright, Designs and Patents Act/Copyright:

Student doesn’t necessarily own the intellectual property rights/copyright permissions to share the
resources.

If the student fails to gain permission from the relevant copyright holders they will be in breach of
the law.

The users of the service may still have access to the file after the 24 hours if they have made a
local copy.

Possibility to include DRM as part of the file in order to prevent access after the 24 hours.

Data Protection Act OR General Data Protection Regulation (GDPR):

The student has a legal responsibility to ensure that any personal data is held securely.

The data collected must be adequate, relevant and not excessive.

The data must not be kept for longer than is necessary.

The data must not be transferred to another country without similar regulation.

The user must be able to have their data deleted on request.

Regulation of Investigatory Powers Act (RIPA):

The student may need to comply with a request for access to data from authorities.

This may include logs of specific items accessed/times/dates.

(Refuse reference to Computer Misuse Act as this is aimed at those who would gain unauthorised
access and not at the student hosting the site.)

(Allow other reasonable suggestions if not listed here.)

1 mark for identification of a relevant law

Max. 2 marks for further points relating to each law

Max. 2 laws discussed (ignore any discussion after the first two laws)

Max. 6 marks total

Exam-style questions
Consequences of uses for computing

2 Indicative response

How did it occur?

Data entered into an online OR HTML form.

Details saved to a file/database stored on the web server.

Staff access these details remotely OR without being aware of the exact location of the data.

Appropriate steps

Data stored somewhere other than on the web server – transferred to a secure computer that is
not running a web server as soon as it is entered.

Data stored in a folder that is not publicly accessible OR outside the public-facing folders in the
web server’s folder structure.

Data encrypted so that if the data is accessed it cannot be understood.

Permissions used so that where the data is stored on the web server, only members of a specific
group of users would be able to access the data.

(Refuse ‘password protected’ as this is vague and, alone, would not provide sufficient levels of
security.)

Legal and ethical issues

Does this constitute personal data?

What are the possible consequences for users who have had their personal data compromised?

Potential for blackmail.

Potential for reprisal from militant pro-life groups.

Damage in trust OR damage to public reputation of the charity.

Who designed/maintained the online system – was it in-house or contracted out, and how much of
the blame should fall with each party?

Was the Data Protection Act breached? Legislation says that data should be held securely, but
there are no explicit rules about exactly what this means.

Did the person who accessed the data break the Computer Misuse Act?

Could the access be classed as unauthorised if it was unsecured?

What legal penalties should apply to the charity?

What legal penalties should apply to the person who accessed the data?

What legal recourse is there for the users whose details were accessed?

Lessons learned

Improved training for developers in terms of the legal requirements of data security.
Consequences of uses for computing

Need for scrutiny of the system/penetration testing to ensure that data is secure.

All personal data should be encrypted.

No personal data should be stored on a public-facing server.

Level Description Marks


4 A line of reasoning has been followed to produce a coherent, 10–12
relevant, substantiated and logically structured response. The
response covers all areas indicated in the indicative response
there is sufficient detail to show that the student has an
excellent level of understanding of the issues involved.
3 A line of reasoning has been followed to produce a coherent, 7–9
relevant, substantiated and logically structured response but
the response may only cover some of the areas indicated in
the indicative response. A reasonable understanding is shown
of each of these areas.
2 A number of relevant points have been made and there is 4–6
some evidence of a line of reasoning. At least two areas from
the indicative response have been addressed and at least four
relevant points have been made.
1 A few relevant points have been made but there is no 1–3
evidence that a line of reasoning has been followed. The
points may only relate to one of the areas from the indicative
response or may be made in a superficial way with little
substantiation.
Fundamentals of communication and networking

Fundamentals of
communication and
networking
Topic 1 Communication
1 a A set of rules OR standards (to allow for data transmission) (1)

b In parallel transmission data is sent simultaneously (through a number of wires/lines). (1)

In serial transmission data is sent consecutively/one after another (through a single line). (1)

c Any three from: (3)

Interference OR crosstalk from the other wires

Data sent simultaneously might arrive at different times OR data skew

Parallel data cables more expensive to manufacture

The longer distance needed for peripheral devices makes interference OR crosstalk more
likely.

2 a Bandwidth OR latency (1)

b A wider bandwidth means that each signal can contain more than 1 bit OR can be used to
represent more than two possible values (1) meaning that the bit rate can be higher than the baud
rate. (1)

Topic 2 Networking
3 a Star (1)

b A network can be configured to operate as if it was a different physical topology OR by


example (e.g. a star network can be configured to behave as if it was a bus network). (2)

c Any two from: (2)

To manage a centralised resource

By responding to requests

and processing OR delivering a response.


Fundamentals of communication and networking

d Data would not be centralised OR separate copies would be held on each workstation (1)
so a workstation may not hold the current/correct version of a file. (1)

Changes made on one workstation may not be reflected on the other workstations. (1)

(Allow other suitable terms for workstation, e.g. computer, device.)

4 a Wireless access point OR wireless router OR wireless network adapter (1)

(Refuse ‘wireless modem’.)

b Any one from: (2)

More customers may visit (1) because of access to public WiFi. (1)

Computers OR staff can be moved more freely (1) allowing for more flexible working practices
(allow any sensible example). (1)

Café can charge customers for WiFi (1) increasing profits. (1)

c Wireless signals are not restricted to the physical building. (1)

Data can be received without physical access to the network. (1)

Anyone with a wireless network adapter can receive the transmission/data/signal. (1)

d Mark in pairs:

Hide the network’s SSID (1)


so that only people who know about the network are able to access it. (1)

Encrypt the network OR use WPA/WPA2 encryption. (1)


Refuse ‘password’ so that unauthorised users cannot understand the signal/data OR data is
meaningless to anyone without the key. (1)

(Allow ‘password’ in place of ‘key’ in order to decrypt the signal, but for the identification mark
it must be clear that the data is encrypted. Stating ‘password protected’ is not enough.)

Use MAC address filtering OR a MAC address whitelist (1)


so that only authorised devices are able to access the data. (1)

e Any three from: (3)

Listen for a current transmission.

Pause (and try again) if a transmission is detected.

Send the message if one is not detected.

If another transmission is detected at the same time the message was sent (1), wait a
random amount of time. (1)

f Benefits: (2)

In the case of collision, RTS is a small message to resend (1) instead of having to resend the
whole message (1) especially on a busy network. (1)
Fundamentals of communication and networking

Drawbacks: (2)

Increased latency OR more data needs to be transmitted overall OR delay while performing
the RTS/CTS protocol (1) especially on a quiet network (where collisions are less likely). (1)

The internet
5 a Any four from: (4)

Data is split into packets.

Each packet is given an (IP) address.

Each packet is placed onto the internet via a gateway OR router.

Each packet is sent independently.

Routers forward the packets until they arrive at their destination.

Each router decides on the path for that packet.

Packets are reassembled once received.

b Any three from: (3)

Sender’s IP address

Receiver’s IP address

Packet number

Error checking data OR parity bit(s) OR checksum bit(s)

Length

Priority

Payload OR original data.

c A gateway is used to allow data to be placed onto/accepted from the internet. (1)

A router is used to forward data across the internet. (1)

d Easier to remember OR recognise OR provides information to the user (e.g. name of the
organisation). (1)

e Any four from: (4)

When the user enters a domain name, a DNS lookup occurs.

A request is made to the DNS server to find the IP address for a given domain name.

DNS server/Domain Name Server holds a table of domain names and corresponding IP
addresses.
Fundamentals of communication and networking

The DNS server responds with the corresponding IP address.

The (file transfer) software uses the IP address to establish a connection.

f The DNS result is stored in the user’s cache (because it was used recently) OR stored on the
user’s computer (in the hosts file). (1)

6 a Symmetric encryption uses the same key to encrypt and decrypt the data OR asymmetric
encryption uses different keys to encrypt and decrypt the data. (1)

b Any three from: (3)

A public key is made available to everyone.

The data is encrypted using the public key.

Because the encryption is asymmetric, no other users can decrypt the message.

The authorised receiver of the data holds the private key.

The message can only be decrypted using the private key.

c Any five from: (5) (max. three from either sender/receiver)

Sender

The message is hashed (to generate a shorter message digest). (1)

The hash OR a message is encrypted using the sender’s private key. (1)

The encrypted code is added to the original message. (1)

The message is transmitted OR received. (1)

Receiver

The public key is publicly available. (1)

The encrypted code is decrypted using the public key. (1)

The message is hashed. (1)

The decrypted code is compared to the hash. (1)

d To prove that a user’s public key is authentic (1) by encrypting the public key using the
certificate authority’s private key (1) and decrypting it using the certificate authority’s public
key. (1)

e Any two for each question from: (6)

i Code/program that attaches itself to a file (1)

Self-replicating OR copies itself when the file is run (1)

Completes some malicious action OR by example. (1)

ii Code that exploits a weakness in the network (as opposed to attaching itself to a file) (1)
Fundamentals of communication and networking

Software is standalone (1)

Replicates automatically OR without having to be run by the user. (1)

iii A program that tricks the user into running it OR a program that pretends to do one thing
but actually does something else (1)

Does not self-replicate (1)

Must be loaded/executed by the user in order to function. (1)

The transmission control protocol/internet


protocol (TCP/IP)
7 a Application: (1) protocol-specific data OR data required by an application OR payload (1)

Transport: (1) used to split the data into packets OR packet number OR port number (1)

Network OR internet: (1) used to address each packet OR sender’s IP address OR receiver’s
IP address (1)

Link: (1) used to put the packet onto the transmission medium OR sender’s MAC address OR
receiver’s MAC address (1)

b Transport and network OR transport and internet (1)

c Link (1)

d So that one layer can be rewritten OR changed OR modified (1) without affecting the other
layers. (1)

8 a IP address (1) (Refuse ‘address’ – not enough.)

b i 80 (1)

ii 20 OR 21 (1)

iii 25 OR 110 (1)

iv 22 (1)

v 443 (1)

c SSH (1) (Refuse ‘Telnet’ as this is not encrypted.)

d One from: (2)

Server may not be in the same location as the administrator (1) so saves on travel time OR
having to physically relocate the server. (1)

No need for a keyboard and mouse OR input and output devices for the server (1) saving
money. (1)

9 a 192.168.0.2 OR 192.168.0.3 OR 192.168.1.1 OR 192.168.2.1 (1)


Fundamentals of communication and networking

This is a private IP address OR reserved for home/office/enterprise area network. (1)

Cannot be addressed directly from outside that network. (1)

b i e.g. 192.168.0.1 (1) (any value between 192.168.0.0 and 192.168.0.255 except for
192.168.0.2 or 192.168.0.3)

ii e.g. 192.168.0.4 (1) (any value between 192.168.0.0 and 192.168.0.255 except for
192.168.0.2, 192.168.0.3 or the answer to part (i))

iii e.g. 192.168.1.2 (1) (any value between 192.168.1.0 and 192.168.1.255 except for
192.168.1.1)

iv e.g. 192.168.2.2 (1) (any value between 192.168.1.0 and 192.168.1.255 except for
192.168.2.1)

c i 243.16.95.0 (1) (accept 243.16.95)

ii 0.0.0.83 (1) (accept .83 OR 83)

d When a request is sent from a workstation within the network the return IP address will be
non-routable OR private. (1)

e A gateway OR router at the edge of the network (1) will provide a return address from the
pool of allowable routable IP addresses OR from the 245 available IP addresses (1) so that
when the response is received it can be returned to the correct device. (1)

(Max. 2)

10 a Websocket creates a persistent OR continuous (1) full-duplex OR two-way (1) connection


between the web browser and the server. (1)

b C – Create

R – Retrieve

U – Update

D – Delete

2 correct (1)

All correct (1)

c POST – Create (1)

GET – Retrieve (1)

PUT – Update (1)

DELETE – Delete (1)

d JSON (1)

XML (1)

e JSON (1)
Fundamentals of communication and networking

Exam-style questions
11 a Advantage: Can send more data simultaneously OR can use one line for
synchronisation/timing. (1)

Disadvantage: More expensive cable OR crosstalk/interference OR data skew/de-


synchronisation of data. (1)

b Why asynchronous: No common timing signal available. (1)

Why extra bits: Any two from: (2)

Start and stop bits must be added.

Start bit: to synchronise OR wake receiver OR start receiver’s clock.

Stop bit: allows start bit to be recognised OR allows message to be processed.

12 a Wireless access point (1)

b Any two from: (4) (mark in pairs)

SSID hiding (1) so that visitors will not be able to see the network. (1)

MAC address filtering OR MAC address whitelisting (1) so that only authorised devices will
be able to connect to the network. (1)

WPA OR WPA2 OR encryption (1) so that unauthorised users will be unable to read any of
the data that is transmitted. (1)

c 172.16.0.263 (1)

d (2)

i Any address between 172.16.0.3 and 172.16.0.255

ii Any address between 172.17.0.2 and 172.17.255.255

iii Any address between 172.20.0.1 and 172.20.255.255 (except 172.20.3.16)

1 correct answer (1)

All three correct answers (1)

e DHCP dynamically assigns IP addresses to devices on demand. (1)

Useful when there are potentially more devices that could access the network than there are
devices available. (1)

Drawback is that it can be more difficult to trace an action back to one user/device. (1)

13 a Barnabyestates.com (1) (Refuse ‘www.barnabyestates.com’)

b Easier to remember than an IP address OR tells the user something about the organisation or
nature of the website. (1)
Fundamentals of communication and networking

c Internet registries manage the sale of domain names (1) so that the same domain name
cannot be linked to more than one IP address OR customer. (1)

d Update (1)

e PUT (1) (Ignore case)

f Any two from: (2)

Easier for a person to read.

More compact to display.

Easier/quicker for computers to parse/read.

Easier for computers to generate.

g Indicative response

Hardware

The existing thick-client network will be made of standard PCs, each running the majority of
tasks locally. A thin-client network would require a central server (or servers, depending on
the scale of the network) with cheaper ‘thin’ or ‘dumb’ terminals, each with very little individual
processing power. The central server may be very expensive and would need to be
significantly more powerful than a standard thick-client machine. Each terminal must be
connected to the network at all times or will lose access to the vast majority of its processing
capabilities as well as access to data storage.

Capability

The existing thick-client network will likely afford staff adequate processing power for the vast
majority of office-based tasks and is probably not using its full processing capabilities for the
vast majority of the time. A well-designed thin-client network would cope very well with most
office-based activities and staff would be unlikely to notice a significant difference in
processing capabilities. Graphics-intensive tasks such as producing digital animation, video
editing, gaming and detailed image editing is more likely to be problematic, partly due to the
requirement for fast data connections and partly due to the remote nature of the server and
the latency in waiting for a response to processing requests. It may be wise to maintain a
small number of thick clients specifically for any graphics or processor intensive tasks.

Sustainability

Once configured, a thin-client network should be easier to sustain as software updates and
the installation of new software only needs to be carried out on the central server. Adding new
thin clients will be quicker, easier and cheaper than adding new thick clients to the network.
Hardware upgrades to the server are likely to be less frequent, but more expensive when they
do occur. Overall the total cost of ownership for a thin-client network may be lower if it is
properly specified when first installed and depending on the nature of the tasks and the
number of machines that are replaced.

Level Description Marks


3 A line of reasoning has been followed to produce a coherent, 5–6
relevant, substantiated and logically structured response. The
Fundamentals of communication and networking

response covers all areas indicated in the indicative response


and there is sufficient detail to show that the student has an
excellent level of understanding of the issues involved.
2 A line of reasoning has been followed to produce a coherent, 3–4
relevant, substantiated and logically structured response but
the response may only cover some of the areas indicated in
the indicative response. A reasonable understanding is shown
of each of these areas.
1 A few relevant points have been made but there is no 1–2
evidence that a line of reasoning has been followed. The
points may only relate to one of the areas from the indicative
response or may be made in a superficial way with little
substantiation.
Fundamentals of databases

Fundamentals of databases
Conceptual data models, relational databases,
database design and normalisation
1 a Channel OR Programme OR Owner (1) (Refuse if any other detail (e.g. attributes) included.)

b OwnerID OR ChannelID OR ChannelNumber OR Name OR ProgrammeID OR Title OR


Genre OR Country (1) (Allow in the format Channel.ChannelID but otherwise refuse if any
other detail included.)

c ChannelID (1)

d Channel.OwnerID OR Programme.ChannelID (2)

1 mark for identification of foreign key

1 mark for correct identification of relation

(Longer, written answers are more likely than the shorter format used here and are perfectly
acceptable.)

e (2)

One correct relationship (1)

All three correct relationships (1)

2 a Two or more attributes/fields (1) used together to uniquely identify a record (1)

Used here because it is possible for two different tenants to have the same first name or
same last name (1)

NB: It is still possible for two different tenants to have the same first AND last names, so this does
not represent the most ideal solution.

b Any two from: (2)

The data is atomic.


Fundamentals of databases

No attribute depends on a partial element of a composite key.

No dependencies other than on the key field(s).

Every attribute is dependent on the key.

Every determinant is a candidate key.

c Create a new relation, Postcode:

Postcode(Postcode, StreetName, Town)

Edit relation Property:

Property(HouseNum, Postcode, PropertyType, LandlordID)

Purpose of Postcode relation is clear (can be inferred from the attributes used even if not
exactly correct) (1)

Attributes of Postcode, including primary key, correct (1)

Attributes remaining in Property, including composite key, correct (1)

Structured query language (SQL)


NB: For all questions in this topic:

 Do not award marks if quotes are missing.

 DPT (don’t penalise twice) for this within the same question part (e.g. part (a)).

 Allow single or double quotes.

 Ignore case.

 Allow any sensible format for dates/times.

o e.g. 14/07/2020, “14/07/2020”, “14th July 2020”, 14–07–20, etc.

o e.g. 2:59, “2hr59”, 2.59, etc.

 Ignore a FINAL trailing semicolon (;) at the end of any SQL statement.

3 a CREATE TABLE Student(

StudentID VARCHAR (20)

FirstName VARCHAR (20)

LastName VARCHAR (20)

YearGroup INT

PRIMARY KEY (StudentID))


Fundamentals of databases

OR

StudentID VARCHAR(20) PRIMARY KEY

Defining StudentID with a valid data type and as primary key (1)

Two other valid fields with sensible data types and lengths (if included) (1)

All fields with sensible data types and lengths and no additional fields (1)

Valid data types for YearGroup: INT, SMALLINT, MEDIUMINT, INTEGER, any text type

Valid data types for text fields: VARCHAR, CHAR, NCHAR, NVARCHAR, VARCHAR2,
NVARCHAR2, TEXT, LONGTEXT, NTEXT, TINYTEXT, MEDIUMTEXT

Text lengths not necessary but must be sensible if included.

NOTNULL not necessary but allow.

b INSERT INTO Test (1)

VALUES (603, “graph theory”, 80) (1)

OR

INSERT INTO Test (TestID, Topic, MaxScore) (1)

VALUES (603, “graph theory”, 80) (1)

c UPDATE TABLE Student (1)

SET YearGroup = 12 (1)

WHERE StudentID = “BloggsJ” (1)

d DELETE FROM Student (1)

WHERE StudentID = “SmithD” (1)

4 a UPDATE TABLE Audiobook (1)

SET Length = 2:59 (1)

WHERE Title = “Alice in Wonderland” (1)

b SELECT Title, Reader

FROM Audiobook, Author

WHERE FirstName = “Terry”

AND LastName = “Pratchett”

AND Audiobook.AuthorID = Author.AuthorID

Analysis (3)
Fundamentals of databases

Identifying the tables and attributes needed (1)

Identifying the foreign key relationship as part of the WHERE clause (1)

Identifying the correct condition (FirstName and LastName) (1)

SQL (2)

Correct SQL syntax in 2 or 3 of the four SQL clauses (SELECT, FROM, WHERE, AND) (1)

Fully correct SQL (1)

Refuse answers that include other tables.

Accept answers that use INNERJOIN or OUTERJOIN as correct.

c SELECT Title, FirstName, LastName

FROM Purchase, Audiobook, Author

WHERE Purchase.bookID = Audiobook.bookID

AND Audiobook.AuthorID = Author.AuthorID

AND Date BETWEEN 1/6/18 AND 30/6/18

ORDER BY LastName

Analysis (4)

Identifying the tables and attributes needed (1)

Identifying one foreign key relationship as part of the WHERE clause (1)

Identifying the correct condition (Date in June 2018) (1)

Identifying need to sort the results by last name (1)

SQL (3)

Correct SQL syntax in 2 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER BY)
(1)

Correct SQL syntax in 3 or 4 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER
BY) (1)

Fully correct SQL (1)

Accept answers that include the Student table, even though this is not necessary.

Accept answers that use INNERJOIN or OUTERJOIN as correct.

Accept other forms of selecting a valid date, e.g. Date >= 1/4/18 AND Date <= 30/4/18, use of
DATEPART, MONTH or LIKE, as long as they are valid.

Refuse overly simplistic attempts to identify the date, e.g. Date = “May 2018” Q1.
Fundamentals of databases

Big Data
5 a Volume: data that is too big to fit on a single server (1)

Velocity: the speed at which data is generated (1)

Variety: the differences in the structure OR format/types of data (1)

NB: The 3Vs are excellent to aid recall but answer MUST go into more detail.

b Functional programming (1)

c Any two from: (2)

Data is immutable OR stateless OR one part of a program cannot change the data and
therefore impact another part of the program.

High-order functions OR functions such as Map/Reduce/Fold/Filter can be easily parallelised


(to run as part of a distributed system).

Order of execution is less important/not as strictly defined (due to the immutable nature of the
data, which makes it easier to process the data in a distributed system).

Exam-style questions
NB: For all questions in this topic:

 Do not award marks if quotes are missing.

 DPT (don’t punish twice) for this within the same question part (e.g. part (a)).

 Allow single or double quotes.

 Ignore case.

 Allow any sensible format for dates/times.

o e.g. 14/07/2020, “14/07/2020”, “14th July 2020”, 14–07–20, etc.

o e.g. 2:59, “2hr59”, 2.59, etc.

6 a CREATE TABLE Booking(

BookingID INT

ActName VARCHAR (60)

StageName VARCHAR (20)

Day VARCHAR(8)

StartTime TIME

PRIMARY KEY (BookingID)


Fundamentals of databases

FOREIGN KEY (ActName) REFERENCES Act(Name)

FOREIGN KEY (StageName) REFERENCES Stage(Name))

OR

BookingID INT PRIMARY KEY

ActName FOREIGN KEY REFERENCES Act(Name)

StageName FOREIGN KEY REFERENCES Stage(Name)

Defining BookingID with a valid data type and as primary key (1)

Defining ActName with a valid data type and as a foreign key, with correct reference (1)

Defining StageName with a valid data type and as a foreign key, with correct reference (1)

Two other valid fields with sensible data types and lengths (if included) (1)

All fields with sensible data types and lengths and no additional fields (1)

Valid data types for BookingID: INT, SMALLINT, MEDIUMINT, INTEGER, any text type

Valid data types for text fields: VARCHAR, CHAR, NCHAR, NVARCHAR, VARCHAR2,
NVARCHAR2, TEXT, LONGTEXT, NTEXT, TINYTEXT, MEDIUMTEXT

Day: text field, but also allow DATE, DATETIME, DATETIME2, DATE/TIME, SMALLDATETIME

StartTime: TIME, DATETIME, DATETIME2, DATE/TIME, SMALLDATETIME

Text lengths not necessary but must be sensible if included.

NOTNULL not necessary but allow.

b Name OR BookingID OR AgentID (1)

(Accept answers in the form Act.Name)

c Booking.ActName OR Booking.StageName OR Act.Agent (1)

d Any two from: (2)

The data is atomic.

No attribute depends on a partial element of a composite key.

No dependencies other than on the key field(s).

Every attribute is dependent on the key.

Every determinant is a candidate key.

e (2)
Fundamentals of databases

One correct relationship (1)

Three correct relationships (2)

f INSERT INTO Stage (1)

VALUES (“Trapezoid”, “Comedy”, 23:00) (1)

OR

INSERT INTO Stage(Name, StageType, Curfew) (1)

VALUES (“Trapezoid”, “Comedy”, 23:00) (1)

g DELETE FROM Act (1)

WHERE ActType = “fire eater” (1)

h SELECT Name, ActType, Day

FROM Act, Booking, Agent

WHERE FirstName = “Paul”

AND LastName = “Scott”

AND Act.Agent = Agent.AgentID

AND Booking.ActName = Act.Name

SORT BY Day

Analysis (4)

Identifying the tables and attributes needed (1)

Identifying the foreign key relationships as part of the WHERE clause (1)

Identifying the correct condition (FirstName and LastName) (1)

Identifying need to sort the results by Day (1)

SQL (3)

Correct SQL syntax in 2 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER BY)
(1)
Fundamentals of databases

Correct SQL syntax in 3 or 4 of the five SQL clauses (SELECT, FROM, WHERE, AND, ORDER
BY) (1)

Fully correct SQL (1)

Refuse answers that include other tables.

Accept answers that use INNERJOIN or OUTERJOIN as correct.

i (3)

New relation: AllowedActs(StageType, ActType) // AllowedActs(AA_ID, StageType, ActType)

Identification of a new relation to store the information about what act types can be matched
with stage types. (1)

Valid primary / composite key. (1)

No extra fields included (other than an optional primary key). (1)

(Allow any meaningful name for the relation. Allow responses that explain the new design rather
than the table design.)

Alternative response given the wording of the question may be to add two fields to an existing
table, e.g. Stage(Name, StageType, Curfew, ActType1, ActType2).

(Allow max. 1 mark for this response.)

j Add each edit/update to a queue (1) and process each one in order. (1)

(Allow any sensible mention of FIFO processing.)

7 a Any four from: (4)

Adding subscription property (1)

Adding additional person entity, with appropriate properties (1)

Adding directed nodes to indicate following Maryam (1)


Fundamentals of databases

Adding directed node to indicate previous visit (1)

Adding undirected node to indicate sibling relationship (1)

(Accept slightly different labels as long as meaning still clear.)

b Data set too large to fit on a single server OR data set too large to be processed on a single
computer. (1)

c Variety of data types OR structures OR formats (1) meaning that the data will not fit into a
traditional relational database structure. (1)

Volume of data being captured/speed at which data is collected OR continual streaming of


data (e.g. from GPS devices) (1) meaning that traditional processing is not sufficient to keep
pace with the organising OR processing of the data. (1)

d Immutable means unchangeable. (1)

The data structure cannot be made larger/smaller OR the data itself cannot be changed/must
be copied if it needs to be altered (1) which means that in a distributed/parallel architecture,
each process is unaffected by other processes. (1)
Fundamentals of functional programming

Fundamentals of functional
programming
Functional programming paradigm
1 a N/ /natural numbers/positive integers (1)

b R/ /real numbers (1)

c Q/ /rational numbers (1)

d Q/ /rational numbers (1)

e 6 (1) NB: dbl 18 = 36, sqrt 36 = 6

f 6 (1) NB: sqrt 9 = 3, dbl 3 = 6

2 a Z/ /integers (1)

b Z/ /integers (1)

c integer (1)

d integer (1)

e (3)

Allows the calling/application of a multi-parameter function (1) with fewer than the required
number of parameters/only one argument. (1)

Avoids the need for an anonymous function. (1)

Example: f = times (3), therefore f (7) = 21 (1)

Max. 2 marks for an explanation, 1 mark for any suitable example

(Allow parameter/argument in each case.)

3 a sub: integer x integer  integer

sub (x, y) = x - y

Correct structure for function application scheme (1)

Correct data types for function application scheme (1)

Correct description of how to apply the function (1)


Fundamentals of functional programming

(Allow sub: integer  integer  integer)

b Z/ /integers (1)

c 32 = 9 (1)

7 + 9 = 16 (1)

d 42 = 16 (1)

12 – 16 = –4 (1)

Writing functional programs and lists in functional


programming
4 a 1 (1)

b [4,9,16,25] (1) (Allow the answer even if not explicitly a list.)

c tail num = [4,9,16,25]

tail (tail num) = [9,16,25]

head (tail (tail num)) = 9 (1) Mark for correct answer only, working not needed

d [0,1,4,9,16,25] (1) (Allow the answer even if not explicitly in a list.)

e [1,4,9,16,25,36] (1) (Allow the answer even if not explicitly in a list.)

(Allow [0,1,4,9,16,25,36] ambiguous as to whether to follow on from part (d).)

5 a [1,2,3,4,5] (1)

b [2,8,18,32,50] (1)

c [16,25] (1)

d [4,16] (1)

e 55 (1)

f 0 (1)

g 48 (1)

6 a Applying filter: [1,4,9] (1)

Applying map dbl: [2,8,18] (1)

b Applying filter: [16,25] (1)

Applying fold: 51 (1)

c Applying filter: [1,4,9] (1)


Fundamentals of functional programming

Applying sq; [1,16,81] (1)

Applying fold: 98 (1)

7 a One from: (1)

A function that can take a function as an argument (1)

A function that can return a function (1)

b Where the list is empty (1)

c To reduce the list to a single value (1)

By repeatedly applying a (combining) function (1)

(Accept an example for the second mark.)

d Potential answer

fold (+) 0 [2,4,6]

Split into head/tail:

2 + fold (+) 0 [4,6]

Repeat:

2 + 4 + fold (+) 0 [6]

Repeat:

2 + 4 + 6 + fold (+) 0 []

Base case reached:

2+4+6+0

Result is 12

Potential answer

fold (+) 0 [2,4,6]

Split into head/tail recursively:

fold (+) 0 2:(4:(6:[]))

Apply combining function:

2+4+6+0

Result is 12

Identifying the use of head/tail (1)

Identifying the application of the combining function (1)


Fundamentals of functional programming

Identifying the use of recursion to repeat the process (1)

Identification of the base case/empty list (1)

(Allow the use of different types of fold, e.g. foldl would combine to 0 + 2 + 4 + 6.)

Exam-style questions
8 a N/ /natural numbers (1)

b i 10 (1)

ii [4,9] (1)

iii [1,4,9,2,3,4] (1)

iv [10,4,9] (1)

c i 18 (1)

ii [10,20] (1)

iii [2,8,18] (1)

iv 24 (1)

v 72 (1)

d map; dbl a (2)

e Potential answer

Identify correct list:

filter (<5) [1,4,9]

Apply head/tail:

filter (<5) 1:[4,9]

Correctly identify that 1 is acceptable and make recursive call:

1: filter (<5) [4,9]

Identify that 4 is not acceptable:

1: filter (<5) [9]

Identify that 9 is acceptable and make recursive call:

1:9: filter (<5) []

Identify base case:

1:9:[]

Recombine into list:


Fundamentals of functional programming

[1:9]

Potential answer

Identify correct list:

filter (<5) [1,4,9]

Apply head/tail recursively:

filter (<5) 1:(4:(9:[]))

Apply filter:

1:9:[]

Recombine into list:

[1,9]

Any four from: (4)

Correct identification of list

Use of head/tail

Use of recursion

Identification of base case/empty list

Recombination into list.

You might also like