Pearson Edexcel International GCSE (9-1) Computer Science Comprehensive Study Notes
UNIT 1: PROBLEM SOLVING
1. UNDERSTANDING ALGORITHMS
Definition: An algorithm is a precise, unambiguous method for solving a problem consisting of a sequence of step-by-step instructions.
Criteria for Success:
Accuracy: Leads to the expected outcome.
Consistency: Produces the same result каждую time it is run.
Efficiency: Solves the problem in the shortest time using minimum computer resources.
Relationship to Programs: An algorithm is the detailed design of a solution; a program is the implementation of that design in a high-level language.
Representation Methods:
Written Descriptions: Simplest verbal/textual form (e.g., a recipe or manual).
Flowcharts: Visual diagrams using standard symbols:
Oval: Start/End.
Rectangle: Process/Action.
Diamond: Decision (Yes/No).
Parallelogram: Input/Output.
Pseudocode: A structured, code-like language that mimics actual programming syntax but is independent of specific language rules.
2. DATA TYPES AND OPERATORS
Programming Concepts:
Variables: Named memory locations (containers) where values can change during execution.
Constants: Containers for values that remain fixed throughout the program (e.g., ).
Identifiers: Unique names given to variables or constants; should be descriptive.
Common Data Types:
Integer: Whole numbers (e.g., ).
Real/Float: Numbers with decimal parts (e.g., ).
Boolean: Only two values: True or False.
Character: A single letter, symbol, or number (e.g., 'm').
String: A sequence of characters treated as text (e.g., "Catherine").
Arithmetic Operators:
+: Addition.
-: Subtraction.
*: Multiplication.
/: Real Division (returns result with decimals).
DIV: Integer Division/Quotient (returns only the whole number).
MOD: Modulus (returns the remainder of division).
^: Exponentiation (to the power of).
3. PROGRAMMING CONSTRUCTS
Sequence: Instructions executed in the exact order they appear.
Selection: Creating branches in a program based on conditions (IF…THEN…ELSE).
Relational Operators: , >, <, >=, <=, (not equal).
Logical Operators: AND (both must be true), OR (either true), NOT (inverts logic).
Iteration (Loops):
Definite: Number of iterations is known in advance (FOR…END FOR).
Indefinite: Action repeated until a condition is met (WHILE…DO).
4. SORTING AND SEARCHING ALGORITHMS
Sorting:
Bubble Sort: Compares adjacent pairs and swaps them if in the wrong order. Requires multiple "passes" until no swaps occur. Simple to code but inefficient for large datasets.
Merge Sort: A "divide and conquer" approach. Recursively splits a list into smaller lists until size is one, then merges them in the correct order. Highly efficient for large datasets.
Searching:
Linear Search: Checks each item sequentially from the start. Works on unsorted lists.
Binary Search: A "divide and conquer" method. repeatedly checks the median item of a sorted list. Much faster than linear search for large datasets but requires data to be sorted first.
5. COMPUTATIONAL THINKING
Decomposition: Breaking a complex problem down into smaller, manageable sub-problems that can be solved independently.
Abstraction: Removing or hiding unnecessary details to focus on important features. Used to model real-world events in code (e.g., using a random number from 1 to 6 to model a die throw).
UNIT 2: DATA REPRESENTATION
1. BINARY SYSTEMS
Hardware Logic: Computers use billions of transistors acting as switches (On/Off). 1 represents "On", 0 represents "Off".
Units of Measurement:
Bit: A single 0 or 1.
Nibble: 4 bits.
Byte: 8 bits.
Prefixes (IEC Standard): Kibibyte (KiB) = ; Mebibyte (MiB) = ; Kilobyte (KB) = .
2. NUMBER REPRESENTATION
Unsigned Integers: Positive whole numbers.
Two's Complement: Used to represent negative integers in binary.
Process: Flip all bits of the positive version (0 to 1, 1 to 0) and add 1.
Arithmetic Shifts:
Left Shift: Multiplies the value by powers of 2. For binary number , shift left by places results in .
Right Shift: Divides the value by powers of 2. A logical right shift fills the left with 0s; an arithmetic right shift replicates the sign bit.
Hexadecimal: Base-16 system using 0-9 and A-F. Used by humans to simplify long binary strings (e.g., HTML color codes like #FFFFFF).
3. TEXT, IMAGES, AND SOUND
Text: Uses character sets to map binary patterns to symbols.
ASCII: 7-bit code representing 128 characters.
Unicode: 16-bit or 32-bit code covering all world languages.
Images: Stored as a grid of Pixels (picture elements).
Resolution: Number of pixels per inch.
Colour Depth: Bits per pixel (e.g., 24-bit "True Colour" allows ).
File Size Calculation: .
Sound: Analogue waves are sampled at regular intervals.
Sample Rate: Number of samples taken per second (e.g., 44.1 kHz for CD).
Bit Depth: Number of bits used to encode the amplitude/volume of each sample.
4. COMPRESSION AND ENCRYPTION
Compression:
Lossless: No data is lost; original can be reconstructed (e.g., Run-Length Encoding [RLE] for repeating data patterns).
Lossy: Deletes data humans can't easily perceive (e.g., JPEG for images, MP3 for audio).
Encryption: Securing data using algorithms (ciphers):
Caesar Cipher: Shifting letters by a fixed key value.
Vigenère Cipher: Polyalphabetic substitution using a keyword.
Rail Fence: Transposition cipher using a zigzag pattern.
UNIT 3: COMPUTERS AND HARWARE
1. HARDWARE ARCHITECTURE
Von Neumann Model: A stored-program architecture where both instructions and data are held in memory.
CPU Components:
Control Unit (CU): Decodes instructions and manages the flow of data.
Arithmetic Logic Unit (ALU): Performs all calculations and Boolean comparisons.
Registers: High-speed memory storage within the CPU (Accumulator, Program Counter, etc.).
Clock: Synchronizes internal actions ().
Performance Factors: Clock speed, number of processor cores (Dual-core, Quad-core), and size/type of Cache memory.
2. MEMORY AND STORAGE
RAM: Main memory; volatile (loses data when power is off); temporary store for open programs.
ROM: Non-volatile; contains boot-up instructions (firmware).
Secondary Storage:
Magnetic: Hard Disk Drives (HDD).
Optical: CDs, DVDs, Blu-rays.
Solid State (SSD): Faster, more durable, uses NAND flash memory.
3. SOFTWARE AND LANGUAGES
Operating Systems (OS): Manages hardware, user interface, files, and scheduling of processes.
Utility Software: Tools for maintenance (Antivirus, Defragmenter, Compression).
Languages:
Machine Code: Raw binary ( and ).
Low-level: Assembly language using Mnemonics (e.g., 'ADD' for machine code ).
High-level: Human-readable syntax (Python, C#, Java).
Translators: Compilers (entire code at once) and Interpreters (line-by-line).