0% found this document useful (0 votes)
14 views17 pages

CAIE-A2 Level-Computer Science - Theory

The document provides a comprehensive overview of the CAIE A2 Level Computer Science syllabus, focusing on internet technologies, protocols, and hardware concepts. It covers key topics such as HTTP, FTP, TCP/IP suite, circuit and packet switching, processor types (RISC and CISC), virtual machines, and logic gates. Additionally, it discusses advanced concepts like pipelining, parallel processing, and flip-flops, essential for understanding computer architecture and data communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views17 pages

CAIE-A2 Level-Computer Science - Theory

The document provides a comprehensive overview of the CAIE A2 Level Computer Science syllabus, focusing on internet technologies, protocols, and hardware concepts. It covers key topics such as HTTP, FTP, TCP/IP suite, circuit and packet switching, processor types (RISC and CISC), virtual machines, and logic gates. Additionally, it discusses advanced concepts like pipelining, parallel processing, and flip-flops, essential for understanding computer architecture and data communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

ZNOTES.

ORG

UPDATED TO 2023-2025 SYLLABUS

CAIE A2 LEVEL
COMPUTER SCIENCE
SUMMARIZED NOTES ON THE THEORY SYLLABUS
Prepared for 无邪 for personal use only.
CAIE A2 LEVEL COMPUTER SCIENCE

HTTP and HTTPS (Hypertext Transfer Protocol): Used


1. Communication and to transfer webpages from server to client. HTTPS is
more secure.
Internet Technologies FTP (File Transfer Protocol): Used for sending and
receiving files over the network between two devices.
POP3 (Post Office Protocol): Used for receiving emails.
1.1. Protocols IMAP (Internet Message Access Protocol): Also used
for receiving emails. The email client retrieves the emails
A protocol sets the rules of the communication. Protocols from the mail server.
allows for devices to communicate across different SMTP (Simple Mail Transfer Protocol): Used for
platforms. If two devices attempted to communicate while sending emails
using different protocols, the communication would fail.
TCP/IP is the dominant protocol suite for internet usage. Transport Layer:

TCP/IP Suite Handles packets.


Converts the data received from the application layer
A layered model (stack) with 4 layers; Application. into individual packets when sending a message.
transport, internet and data link. The Suite uses a set of Adds packet headers and then sends these packets to
protocols for the transmission of data in these layers like the internet layer.
TCP (Transport Control Protocol) and IP (Internet Controls the flows of packets and handles packet loss or
Protocol). corruption.
TCP maintains connection between two nodes and When receiving a message, it reads the header and
ensures delivery of data between the two nodes. determines which application layer the data must be
IP provides rules of exchange for packets and decides sent to, then strips the header and forwards it
the route for sending packets.
Internet Layer:

Handles the transmission of data using IP addresses.


Identifies the intended network and host and then
transmits the packets through the data link layer.
Routes each packet independently through the best
route available
IP Addresses, of the sender and receiver, and checksum
are added when sending messages
When receiving a message it reassembles the fragments,
strips the IP header and sends it to the transport layer

(Data) Link Layer:

Application Layer: Converts the electrical data into analog signals and sends
it, allowing the upper layers access to the physical
The application layer provides user services. medium.
Encodes data in an appropriate format when sending a Formats data into frames for transmission and maps IP
message addresses to MAC (hardware) addresses.
Performs the action requested by the user when Ensures correct network protocols are followed.
receiving a message Verifies the checksum when receiving a message and
then sends it to the internet layer
There are the main types of protocols:
Peer-to-peer File Sharing

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

BitTorrent uses Peer-To-Peer file sharing model. Method of transmission where the message is broken
A BitTorrent client software is made available to the down into packets which can be sent along independent
public. paths
Swarm: All connected peer computers that have all or Data is split into multiple packets and each packet a
parts of file being downloaded/uploaded. route is calculated for each packet.
Tracker: A central server that stores information on Each packet contain a header, which has a source IP
which computers have which files and which parts of address and destination IP address, and a payload.
those files. It also shares the IP addresses of computers Calculates the most efficient path for each packet.
to allow them to connect to each other. Used when sending large files that don’t need to be live
Seed: is the peer computer that uploads the file that is streamed or when it is necessary to be able to overcome
being downloaded. faulty lines by rerouting like emails, text messages,
sending documents, etc.
If a user wishes to join this network, they need to use a Harder to intercept as new route is used each time.
BitTorrent client to load the torrent descriptor file. When a Packets need to be reassembled.
user wishes to download a file, pieces of this file are If there’s a missing packet, a request is sent to retransmit
downloaded and uploaded at the same time. When a user the data.
has even a single piece of a file they become a seed. To be
able to download this file, a complete copy needs to exist on Role of Router:
one of the peer computers.
Examines the header and finds the destination IP
address.
1.2. Circuit Switching, Packet Switching Decides the best route for the packet, with the help of
the information from the routing table, and sends it
Circuit Switching towards the next hop.
Circuit Switching: Method of transmission in which a Comparison
dedicated circuit lasts throughout the duration of the
communication. Circuit Switching Packet Switching
Dedicated circuit is selected before the communication Nature
Setup
Dedicated channel
Requires pre-established channel
Data segmented into packets
No prior setup needed
starts and is used to send all the data through this route. Data handling Message remains intact Message gets split into packets
- Uses the whole bandwidth. Transmission
Order
Single Path
In order
Path recalculated each time
May need reassembly
Releases circuit once the communication ends. Layer (Data) Link Layer Network Layer
Used for live video broadcasts or calling Bandwidth Makes full use of bandwidth Bandwidth can be shared
Error handling Communication ends incase of an error Allows packets to be resent
Data arrives in order so it doesn’t need to be Complexity Simple More complex
reassembled.
Whole bandwidth is available.
Data can’t get lost. 2. Hardware and Virtual
Less secure as it only uses one route.
No alternative route in case of failure. Machines
Bandwidth can’t be shared.

Packet Switching
2.1. RISC & CISC Processors
RISC: Reduced Instruction Set Computers.
CISC: Complex Instruction Set Computers.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
RISC CISC
Fewer instructions More instructions
Simpler instructions Complicated instructions Pipelining for Five-Stage Instruction Handling
A small number of instruction formats Many instruction formats
Single-cycle instructions whenever possible Multi-cycle instructions
Fixed-length instructions Variable-length instructions
Only load and store instructions to address Many types of instructions to address
memory memory
Fewer addressing modes More addressing modes
Multiple register sets Fewer registers
Hard-wired control unit Microprogrammed control unit
Pipelining easier Pipelining much difficult

Pipelining: Instruction level parallelism


Used extensively in RISC processor-based systems to
reduce the time taken to run processes
Multiple registers are employed
Interrupt handling in CISC and RISC Processors:
As soon as the interrupt is detected, the current
processes are paused and moved into registers
For pipelining to be implemented, the construction of the
The ISR (Interrupt Service Routine) is loaded onto the
processor must have five independent units, each
pipeline and is executed.
handling one of the five identified stages.
When the interrupt has been serviced, the paused
Therefore, it's important for RISC processors to have
processes are resumed by bringing them back from the
many register sets. Each processor unit must have
registers to the pipeline
access to its own set of registers. The representations
RISC processors allow for providing efficient pipelining.
1.1, 1.2, and so on are used to define the instruction and
Pipelining is instruction-level parallelism. Its underlying
the stage of the instruction. Initially, only the first stage
principle is that the fetch-decode execute cycle can be
of the first instruction has entered the pipeline. At clock
separated into several stages.
cycle 6, the first instruction has left the pipeline, the last
One of the possibilities include: stage of instruction 2 is being handled, and instruction 6
has just been entered. Once underway, the pipeline is
1. Instruction fetch (IF) handling 5 stages of 5 individual instructions. At each
2. Instruction decode (ID) clock cycle, the complete processing of one instruction is
3. Operand fetch (OF) finished. Without the pipelining, the processing time
4. Instruction execution (IE) would've been 5 times longer.
5. Result write back (WB) One disadvantage is interrupt handling. There will be 5
instructions in the pipeline when an interrupt occurs, so
it needs to remove those previous instructions and then
handle the interrupt.

2.2. Parallel Processing

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

SISD Used by companies wishing to use the legacy software


Single Instruction Single Data stream on newer hardware and server consolidation companies
Found in the early computers Virtualising machines allows developers to test
Contains a single processor; thus, there is no applications on many systems without making expensive
pipelining hardware purchases.
SIMD
Single Instruction Multiple Data. 2.4. Logic Gates & Circuit Design
Found in array processors
Contains multiple processors, which have their own Logic Gates: A component of a logical circuit that can
memory. perform a Boolean operation
MISD
Multiple Instruction Single Data AND Gate: A.B = X
Used to sort large quantities of data.
Contains multiple processors which process the same
data
MIMD
Multiple Instruction Multiple Data.
Found in modern personal computers.
Each processor executes a different individual
instruction.
Massively parallel computers
Computers that contain vast amounts of processing
power.
Has a bus structure to support multiple processors
and a network infrastructure to support multiple A B X
‘Host’ computers. 0 0 0
0 1 0
Commonly used to solve highly complex 1 0 0
mathematical problems. 1 1 1

OR Gate: A + B = X
2.3. Virtual Machines
Virtual machine:
Process interacts with the software interface
provided by the OS. This provides an exact copy of
the hardware.
OS kernel handles interaction with actual host
hardware
Pros Cons
Allows more than one OS to run on a system Performance drop from native OS
The time and effort needed for implementation
Allows multiple copies of the same OS is high

Examples and Usage:


A B Output
0 0 0
0 1 1
1 0 1
1 1 1

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
A B Output
NOT Gate: A = X 0
0
0
1
1
0
1 0 0
1 1 0

XOR Gate: A.B + A.B = X

A Output
0 1
1 0

NAND Gate: A.B = X

A B Output
0 0 0
0 1 1
1 0 1
1 1 0

Half-Adder

A B Output
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate: A + B = X​

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

A half adder adds two binary digits and outputs the sum Can be made with NAND gates or NOR gates
(s) and their carry (c). Error state exists
A XOR gate acts like a half adder.
Input Output
A B S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

Full-Adder
A full adder adds three binary digits and outputs the sum
and their carry.
S R Q Q Bar
0 0 1 1
0 1 1 0
1 0 0 1
1 1 No Change No Change

00 causes an error as Q Bar is no longer the complement


of Q
01 sets Q to 1
10 resets Q to 0
R is "Carry In" 11 leads to no change; the initial value remains
J is "Carry Out"
K is "Sum"

S R Q Q Bar
0 0 No Change No Change
0 1 0 1
1 0 1 0
1 1 0 0

11 causes an error as Q Bar is no longer the complement


2.5. Flip-Flops of Q
10 sets Q to 1
Flip flops can store a single bit of data as 0 or 1 01 resets Q to 0
Computers use bits to store data. 00 leads to no change; the initial value remains
Flip-flops can be used to store bits of data.
Memory can be created from flip-flops. JK Flip Flops
SR Flip Flops

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

JK flip flops are only active when the clock is high. Double Complement: A = A
JK flip flops use a clock pulse for synchronization to Identity Law
ensure proper functioning. 1.A = A
Advantages of JK flip flops include the validity of all input 0+A = A
combinations, avoidance of unstable states, and Null Law
increased stability compared to SR flip flops.
0.A = 0
1+A = 1
Idempotent Law
A.A = A
A+A=A
Inverse Law
A.A = 0
A+A = 1
Commutative Law
A.B = B.A
A+B = B+A
Associative
(A.B).C = A.(B.C)
Clock J K Q Q Bar
0 0 0 - - (A + B) + C = A + (B + C)
0 0 1 - - Distributive Law
0 1 0 - -
0 1 0 - - A + B.C = (A + B).(A + C)
1 0 0 No Change No Change
1 0 1 0 1
A. (B + C ) = A.B + A.C
1 1 0 1 0 Adsorption
1 1 0 Toggle Toggle
A. (A + B ) = A
A + A.B = A
2.6. Boolean Algebra De Morgan’s Law
(A.B ) = A + B
(A + B) = A.B ​

{example}

2.7. Karnaugh Maps

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Karnaugh maps: a method of obtaining a simplified 3. Circle the largest group containing an even number
Boolean algebra expression from a truth table. They of 1s.
minimize the number of logic circuits, thus making it
more efficient.
Sum of products: all the combinations that lead to 1 in
the output.

Methodology
Try to look for trends in the output, thus predicting the
presence of a term in the final expression
Draw out a Karnaugh Map by filling in the truth table
values into the table 4. Take the common values from both
Select groups of ‘1’ bits in even quantities (2, 4, 6, etc.); if In the first group, A ⋅ B is common
not possible, then consider a single input as a group In the second group, A ⋅ C is common
Note: Karnaugh Maps wrap around columns 5. Write the simplified expression.
Within each group, only the values that remain constant A⋅C +A⋅B
are retained

Example 3. System Software


3.1. Purposes of an Operating System
(OS)
Maximizing Resource Use
Memory
Partitioning main memory into static and dynamic
partitions allowing for more than one program to be
available.
Removing unused items from RAM as soon as the
process is terminated and then marking the partition
1. Sum of Products as available.
A⋅B⋅C +A⋅B⋅C +A⋅B⋅C Use virtual memory with paging to swap parts of the
2. Fill in the map memory and the disk.
Disk
Compressing files in order to decrease the size and to
allow for more larger files to be stored.
Using defragmentation software so that files are
arranged contiguously in the disk thereby reducing
access times.
Caching data that is frequently transferred to/from
the disk either on the disk or in RAM.

User Interface

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Hides complexities of the hardware from the user Scheduling Algorithms


gives users access to the hardware/software systems
depending on their needs without involving them with Shortest Job First: Processes are executed in ascending
the backend order based on the time needed to execute the task with
Examples include GUIs and CLIs smaller jobs being executed first. This allows the CPU to
execute more processes in a smaller amount of time.
Multi-Tasking This is non-preemptive.
Round Robin: Each process is allocated a specific
Managing the execution of multiple programs that amount of time from the CPU. Their execution takes
appear to be running simultaneously. place within these time frames. This helps prevent
starvation.
Process First Come First Served: No complex logic involved;
processes are executed in the order they are requested.
A process is the code being executed. There is less processor overhead due to its simplicity.
Shortest Remaining Time: Processes are executed in
Program
order of shortest remaining time for execution. It
A program is the code that has been written. ensures there is smaller waiting times between process
execution. This is preemptive.

3.2. Process Scheduling Interrupt Handling


The process of allocating the CPU’s time on different When an interrupt occurs, the process in the running state is
processes based on their needs. moved to the ready state and the interrupt is moved to the
running state so that it may be serviced.
Importance Low Level Scheduler: Decides which of the processes in the
ready state should be moved to the running state based on
Allows for multi-tasking to take place their priority/position.
Ensures the CPU is busy at all times High Level Scheduler: Decides which of the processes
Makes sure that all programs have fair access to the CPU should be loaded from the backing store into the ready
so that they can be executed efficiently. state.
Prevents starvation
3.3. Memory Management
Virtual Memory
Temporarily using secondary storage to simulate additional
main memory, as only part of a program needs to be in
RAM. Data is swapped between the two.
Paging
A large process is divided into pages of equal sizes.

Process States
Ready: The process is not currently being executed. It is
in the queue waiting for the processor’s attention.
Running: The process is being executed and currently
has the processor’s attention.
Blocked: The process is waiting for an event before it
can continue running like a user input.
Terminated: The process has finished execution and has
been removed from the queue.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
A parse tree is generated for reverse polish notation and
1. The RAM is divided into frames. syntax errors are reported.
2. Virtual memory is divided into same-sized blocks
called pages with fixed sizes. Code generation
3. Page table created to translate logical address to
physical addresses and track all the free frames. Object code is generated.
4. Pages are swapped between them as necessary.
5. When there is no empty space in the memory, a page Code Optimization
gets replaced with the new one. The replacement
algorithm is either first in first out, least used page Code is optimized to improve time for execution.
and recently least used page.

Page
3.5. Backus-Naur Form (BNF) Notation
Virtual memory is divided into equal blocks called pages.
A form of expressing the grammar of a language visually.
Page Frame
Example
Main memory is divided into parts equal in size to a page.

Page Table
Contains the mappings of pages to page frames.

Segmentation
A large process is divided to segments, the segments need
not be the same size.

Disk Thrashing
When pages are needed in the RAM as soon as they are
moved to the disk leading to a continuous swapping of the <variable> ::= <letter> <usigned integer>;
same pages because the pages being swapped in and out
<usigned integer> ::= <digit> | <digit> <digit>;
are inter-dependent.
<letter> ::= X | Y | Z;
3.4. Translation Software
<digit> ::= 1 | 2 | 3;
Interpreter
<operator> ::= + | - | *;
An interpreter reads line by line and checks statements
for errors, if no errors are found it is executed otherwise <assignment statement> ::== <variable> = <variable> <oper
a report is made and the interpreter stops execution. It is
easier for debugging.
A compiler does not run the code line by line but rather Notations
at the end of translation. < > : used to enclose an item
:: == : separates an item from its definition
Lexical Analysis | : between items, indicates a choice
; : the end of each rule.
Characters are converted from strings into tokens.
Comments are removed.
Symbol table stores identifiers and keywords.
3.6. Reverse Polish Notation (RPN)
Keyword table stores the reserved words used and the
matching operators.

Tokens: Strings with an assigned meaning

Syntax Analysis

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
Reverse Polish notation (RPN): An unambiguous method A private key is never shared. It is used to decrypt data that
for representing an expression left to right without needing was encrypted with its matching public key.
rules of precedence or brackets.
Symmetric Encryption
Advantages
A single key is used for both encryption and decryption. The
No brackets or precedence of operators needed key is shared between the sender and the receiver.
Simpler to evaluate Disadvantages:
No need for backtracking in evaluation as the operators
appear in the order required for computation and can be Key has to be exchanged securely.
evaluated from left to right Once compromised, it can decrypt sent and received
messages.
Uses with a Stack Cannot ensure origin or integrity of data.

RPN expression is read left to right Asymmetric Encryption


As values are read numbers are pushed into the stack.
If an operator is read the last two values in the stack are Two keys are used: public key and private key. The message
popped, the operation is performed on them, and the is encrypted with the public key and decrypted using the
result is pushed back onto the stack. matching private key.
Repeated until the end of the expression is reached.
Symmetric VS Asymmetric
Example Symmetric Asymmetric
Number of Keys 1 key for both 2 keys
(a–b) ∗ (a + c)/7 ↔ ab − ac + ∗7/ Is Key Shared Yes Only public key
Security Less secure as key needs to be shared More secure
ab/4 ∗ ab + − ↔ (a/b) ∗ 4 − (a + b) Complexity Simple Complex
Speed Fast Slow
Key Length Short Longer

4. Security Security concerns relating to a transmission:

4.1. Encryption Confidentiality: Only the intended recipient should be


able to decrypt the message.
The process of converting of data into an unreadable Authenticity: Receiver must know who sent the
format. ciphertext.
Integrity: Message must not be modified during
Plain Text transmission.
Non-repudiation: Neither the sender nor the receiver
Data before applying encryption. should be able to deny involvement in the transmission.

Cipher Text Quantum Cryptography

Data after applying encryption. Quantum Cryptography is used to produce a virtually


unbreakable encryption system using the properties of
Key Encryption: photons.
Advantages:
To ensure a message is authentic.
To ensure a message isn’t altered during transmission. More secure.
To ensure that only the intended receiver can Eavesdropping can be detected.
understand the message. Longer keys can be used.
To ensure that neither send nor receiver can deny Almost un-hackable.
involvement in the transmission. Cannot be copied and decrypted at a later time.

Disadvantages:
Public Key
A public key is shared. It is used to encrypt data so that it can
be decrypted with its matching private key.

Private Key

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
When received the message and the digital signature are
Only works for short distances. decrypted with the receiver’s private key. The digital
High cost for maintenance and setup. signature is then decrypted with the sender’s public key. The
Lacks important features like digital signature, certified decrypted message is put through the same hashing
mail etc. function to output a digest. The two digests are compared
High error rate due to being new. and if they are the same then the message was not
Polarization of light may be altered during transmission. tampered with.

4.2. Encryption Protocols


5. Artificial Intelligence (AI)
Purpose
5.1. Graphs
Allow for more security when communicating over the
internet as it allows two parties identify and verify each A graph is an abstract datatype that contains a collection of
other and communicate confidentially with integrity nodes. These nodes are connected to each other with edges.
Provides encryption. A node usually has a name, and an edge usually has a
numerical value.
Working One example of graphs is A* or Dijkstra's algorithm. The
nodes represent locations, and the edges represent the
An SSL/TLS connection is initiated between two
distance between them.
applications.
The one initiating it is the client. The one receiving it is
the server.
Session begins with a handshake.
Server sends its digital certificate and public key
Client confirms the server’s identity.
Encryption algorithm is agreed upon and the symmetric
session keys are generated.

Use Cases
Transmitting passwords or session cookies.
Online shopping and banking websites.
Use of Graphs
4.3. Digital Certification
Graphs provide relationships between different nodes.
Digital Certificate Allows AI problem to be defined as the most efficient
route between two nodes
1. An organization sends a request to Certificate Analyzed by machine learning algorithms such as A* to
Authority (CA). perform calculations
2. They send their public key, information to prove their Graphs can also be used to represent neural networks.
identity as well as any additional information
required by the CA.
3. The CA then verifies their identity and then issues the
5.2. A* & Dijkstra’s Algorithm
certificate after encrypting it with their private key. These algorithms are used to find the shortest route
between two nodes based on the distance.
Digital Signature
How to Implement A Algorithm?
The message is put through a hashing algorithm to produce
the digest. This is then encrypted with the sender’s private Below is an example of the implementation of the A*
key. This is the digital signature. Algorithm:

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

h is the heuristic value


g is the movement cost
F is the sum of g and h values.

5.3. Neural Networks & Machine


Learning
Start from the Home. The cost from Home to Home is 0,
so g= 0. The heuristic cost of a home is 14, so h=14 and
Neural Networks
f=g+h=14.
Now, there are three immediate nodes from home: A, B,
and C. Calculate the values of g, h and f for A, B and C
from home and write them in the table.
Select the node whose f value is the shortest (in this
case, Node A).
From A, there are two immediate nodes, B and E.
Calculate the g value for each node and add the g value
of A. Then, add the corresponding h values to get f for
each node.
From E, there are two immediate nodes, School and F.
Calculate the g value for each node and add the g value
of E. Then, add the corresponding h values to get f for Neural networks are modelled on the human brain.
each node. They contain input and output nodes as well as one or
From F to School, add the g value (3) to the g value of F more hidden layers.
(8) and calculate f. Each input node is assigned a specific weight, these
weights are summed, and an activation function
Final path = Home → A→E→F→School.
calculates a value for the output.
Repeated for each layer within the network thereby
allowing reinforcement learning to take place.

Use of Hidden Layers:

Allow deep learning to take place


Allows the network to make decisions independently
Helps to improve the accuracy of the output

Machine Learning

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
Machine learning is a field of artificial intelligence in which
computers learn from provided data and past experiences in
order to improve its performance in a given task without 6. Data Representation
explicitly being programmed to know how to do the task. For
example, rather than telling the computer that emails that 6.1. User-defined data types
advertise free products are most likely scams we feed it a lot
of data and it identifies that pattern on its own. A data type constructed by the programmer using
primitive data types.
Deep Learning User-defined data types are used to create new data
types that help to extend the flexibility of a programming
A subset of machine learning that simulates the decision
language as the programmer can create data types
making and data processing abilities of the human brain. based on the application’s requirements.
Benefits:
Importance of user-defined data types:
Good with extremely large sets of data Code organization- Helps structure and group related
Good with unstructured data data logically, making programs easier to read and
Can identify hidden patterns maintain.
Reusability- Once defined, the data type can be
Reinforcement Learning reused multiple times, reducing redundant code and
improving efficiency.
Reinforcement learning allows the computers to make Examples include:
decisions that maximize the reward, it is then graded based Record
on how well it performed. Over time the computer learns Set
the correct decisions it needs to make based on its past Class
experiences. Object

Supervised Learning Composite User-Defined Data Types


In supervised learning the computer is fed labelled test data, Composite user-defined data types have a definition
and it identifies the patterns that led to the data being referencing at least one other type.
labelled in a specific way. This allows it to then predict labels
for new unseen data.

Unsupervised Learning
In unsupervised learning the computer is fed unlabeled test
data, and it identifies hidden patterns.

Back Propagation of Errors


An algorithm identifies errors with the machine learning and
is then used to adjust the model for improved accuracy by
starting at the output layer and working backwards through
the hidden layers to the input layer.
For example, if you threw a ball and missed your target.
You'd check how far off you were from the target and then
adjust things like angle and strength the next time you threw
the ball.

Regression
Regression is finding a mathematical function that best fits
out output data based on the previous results in order to
predict the future value.

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE
Data types that can be defined without referencing another
Record: A composite data type that is a collection of type. Examples include:
related items which may or may not have different data
types Integers
Booleans
TYPE TBook // Example Strings
DECLARE Name : STRING Enumerated Data Type: A user defined non-composite
DECLARE Isbn : INTEGER data type that contains an ordered list of all possible
ENDTYPE values.

DECLARE Book1: TBook // Creating a variable TYPE <name> : (<value1>, <value2>, ...)
Book1.Name = "To Kill a Mockingbird" // Accessing prop TYPE Days: (Sunday, Monday, Tuesday, Wednesday, Thursd
TYPE Numbers: (1..10) // Inclusive
Set: A set stores a finite number of unique items in no DECLARE Today: Days // Declaration
particular order allowing the program to apply Days ← Sunday
mathematical operations defined in set theory. Days ← Days + 1 // Value is now Monday
TYPE <set-name> = SET OF <type> //Declaration Pointer Data Type: A user defined non-composite data
DEFINE <var-name> (value1,value2,value3,...) : <set-na type that is used to reference a memory location.
TYPE Numbers = SET OF INTEGERS TYPE <Name> = ^<Type>
DEFINE EvenNumbers (2,4,6,8,10) : Numbers
// Declaring a pointer type
Classes: In object-oriented programming (OOP), a class TYPE PIntPointer: ^INTEGER
is the base for creating objects. It has methods and // Declaring a pointer variable
properties. DECLARE MyPointer: PIntPointer

// Class definition
MyPointer^ ← 3 // Sets the value at the address to
CLASS Bird
MyPointer ← 3 // Pointer points to value at the addre
PRIVATE Name: STRING
MyPointer ← @<variable_name> // Makes pointer point t
PUBLIC PROCEDURE NEW(pName: STRING)
Name ← pName
ENDPROCEDURE 6.2. File organization and access
ENDCLASS
File organization
// Implementing inheritance
CLASS FlyingBird IMPLEMENTS Bird
// Class info...
ENDCLASS

// Creating an object
<name> ← NEW <class_name>(<parameter1>, <parameter2>,
MyPet ← NEW Bird("Kiwi")

Non-Composite Data Type

WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.
CAIE A2 LEVEL COMPUTER SCIENCE

Serial: In serial files, records are stored one after Serial: In serial access records are read in the order that
another in chronological order. Records are appended to they are stored in.
the next available spot. Benefits: It is read record by record until the record is found or the
No need to sort list. key field value is exceeded.
Data can be appended easily. This is used for serial and sequential file organization.
Sequential: In sequential files, records are stored one Direct/Random Access: In random access you can
after another in the order of the key field. Records are directly access the data needed.
inserted into the correct position. A new version of the This is used in both sequential and random file
file has to be created to update it. Benefits: organisation.
Allows for batch processing. In sequential, index of all the key fields is used, while
Allows the data to be stored and sorted in a specific hash algorithm is used in random file organization.
order.
Random: In random files, records are stored in no 6.3. Floating-point numbers,
particular order. Changes to file are done directly.
In random file organization a unique key field is representation and manipulation
passed through a hash algorithm which produces the
home location for the data, if that location is empty Floating point representation
the data is stored else it relies on an overflow
method. Mantissa: Represents the numbers. If we increase the
A collision can occur when two different records bits allocated to the mantissa, we increase accuracy.
produce the same hash, this means that the location Exponent: Represents the number of times the decimal
is already being used to store a different record. place needs to move. If we increase the bits allocated to
When saving a file, it searches the file linearly for an exponent, we increase the range.
empty spot and saves the file there or search the M × 2E
overflow area linearly for the next empty spot and M = Mantissa
save the record there. When finding a record, search E = Exponent
the overflow area linearly of the matching record or
start from current location and search linearly and Converting from Binary Digit to Positive Float
until matching record is found.
Benefits: Mantissa = 01101000Exponent = 0011
Fast as real time processing is used
1. Write the binary number with the decimal point
File access
0 ⋅ 1101
2. Multiply with 2 to the power of the exponent (Move
the decimal point the same number of places as the
exponent)

0 ⋅ 1101 x 23 \0110 ⋅ 1
3. Convert to decimal by multiplying

(4 × 1) + (2 × 1) + ( 12 × 1) ​

Therefore the answer is 6.5

Converting from Float to Binary Digit


6.5
Make the float into an integer by multiplying by factors of
2 tilt it becomes a whole number.
6.5 = 13 2

Now multiply the denominator by multiples of 2 till it is


larger than the numerator.
13 1 ​

13 2 13 3 13 ​ ​

2 ​ ​

4 ​ ​

8 ​ ​

16 ​

So we get exponent as 3 which in binary is 0011. Now for


mantissa, we slowly split 13 1
16 into factors of 2 . ​ ​

13 1 12 1 6 1 3 1 1 2
16 = 16 + 16 = 16 + 8 = 16 + 4 = 16 + 4 + 4 =
​ ​ ​ ​ ​ ​ ​ ​ ​ ​

1 1 1
16 + 4 + 2
​ ​ ​

Put these back into the mantissa table

Mantissa: 01101000
Exponent: 0011
WWW.ZNOTES.ORG Copyright © 2025 ZNotes Education & Foundation. All Rights Reserved. This document is
authorised for personal use only by 无邪 at Chongqing Liangjiang Yucai Middle School on 13/05/25.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy