RevisionHub

Second Form Computing โ€” enter the class password

Reigate Grammar School ยท Second Form

Second Form Computing

Work through each section, test yourself, then practise with flashcards.

Year 8 ยท End of Year Exam Revision
๐Ÿ’ฌ
Ask the AI Tutor
Stuck on something? Open the Mindjoy tutor in a new tab and ask anything about Second Form Computing โ€” it can explain things in a different way.
โ†—
1
โ–พ

The pioneers

Alan Turing (1912โ€“1954)

Broke Nazi Enigma codes in WW2. Father of computer science & AI.

Tim Berners-Lee (1955โ€“)

Invented the World Wide Web (WWW) in 1989. Made it free for all.

George Boole (1815โ€“1864)

Created Boolean logic (AND, OR, NOT) โ€” the foundation of all computing.

Key inventions timeline

YearEvent
1840sCharles Babbage designs the first mechanical computer concept
1854George Boole invents Boolean logic
1940sAlan Turing breaks the Enigma code; first electronic computers built
1989Tim Berners-Lee invents the World Wide Web at CERN
1990sInternet becomes public; personal computers in homes
2000s+Smartphones, AI, cloud computing, social media
๐ŸŒ
Internet vs Web The internet is the global network of computers. The World Wide Web is a service that runs on top of it โ€” websites and links.

Why Alan Turing mattered

  • The Nazis used the Enigma machine to encrypt military messages
  • Turing built the Bombe machine to crack Enigma codes
  • Breaking the codes helped end WW2 years earlier, saving millions of lives
  • He also proposed the Turing Test โ€” can a machine think like a human?

George Boole's lasting impact

  • Invented Boolean logic in 1854 โ€” using TRUE/FALSE (1/0) for maths
  • Every computer chip in the world runs on Boolean logic
  • AND, OR, NOT gates (see Section 4) come directly from his work

Encryption โ€” keeping data secure

Encryption = scrambling data so only the intended person can read it.

Plain text

"Hello Alice"

readable message

Encrypted

"Xq#7!pL2"

scrambled & secure

Decrypted

"Hello Alice"

readable again

Public key encryption

KeyWhat it does
Public keyShared with everyone โ€” used to lock (encrypt) the message
Private keyKept secret by the owner โ€” used to unlock (decrypt) the message
Why useful?You can send secure messages without ever sharing a secret key โ€” no risk of it being intercepted
๐Ÿ”
Think of it like a padlock: anyone can click it shut (public key) but only you have the key to open it (private key).
โœ๏ธ Test yourself
Question 1
Who invented the World Wide Web, and in what year?
Explanation
Tim Berners-Lee invented the World Wide Web in 1989 while working at CERN.
Question 2
What did Alan Turing do in World War 2?
Explanation
Turing built the Bombe machine at Bletchley Park to crack Enigma codes. This helped end WW2 years earlier and saved millions of lives.
Question 3
What is the difference between the internet and the World Wide Web?
Explanation
The internet is the global network of computers. The World Wide Web is a service of websites and links that runs on top of it.
Question 4
What is encryption?
Explanation
Any data can be intercepted and read, but without the key it cannot be understood. Examples: HTTPS, WhatsApp messages, password storage.
Question 5
In public key encryption, which key is used to encrypt the message?
Explanation
The public key encrypts (locks) the message โ€” anyone can use it. The private key decrypts (unlocks) โ€” only the owner has it.
Question 6
Every modern computer chip is built from billions of what?
Explanation
Every processor is made of billions of tiny AND, OR, NOT logic gates โ€” the system George Boole invented in 1854. That's why his work still matters today.
2
โ–พ

Core concepts โ€” quick reference

ConceptDescription
VariableNamed store for a value, e.g. score = 0, lives = 3
if / elif / elseSelection โ€” runs different code depending on a condition
while loopRepeats as long as a condition is true
for loopRepeats a set number of times
def / functionNamed block of reusable code
print()Outputs text to the screen
input()Asks the user to type something
int()Converts a string to a whole number

Reading code โ€” worked examples

What does this print?

score = 7 if score > 5: print("Win") else: print("Lose")

score (7) is > 5, so the if branch runs โ†’ prints "Win"

What is the value of count?

count = 0 for i in range(3): count = count + 5 print(count)

Loop runs 3 times, adding 5 each time: 0 โ†’ 5 โ†’ 10 โ†’ 15

Common errors to spot

โœ— Missing indent
Code inside if/loop must be indented โ€” Python uses spacing as part of its rules
โœ“ Indent correctly
Use 4 spaces or a tab for code inside an if, for, or while
โœ— Missing colon
if score > 5 โ€” missing the colon at the end
โœ“ Add colon
if score > 5: โ€” the colon after if/for/def/while is required
โœ— Wrong operator
if score = 10: โ€” single = assigns, doesn't compare
โœ“ Use ==
if score == 10: โ€” double == compares values
โœ— String vs int
age = input("Age: ") then doing maths โ€” input is a string
โœ“ Convert to int
age = int(input("Age: "))

Game logic โ€” lives & score system

A simple game in Python:

lives = 3 score = 0 while lives > 0: event = input("obstacle/coin? ") if event == "obstacle": lives = lives - 1 elif event == "coin": score = score + 1 print("Game Over")
  • while lives > 0 โ€” keeps the game running until lives run out
  • Each if/elif handles a different event
  • The loop exits automatically when lives reach 0
๐ŸŽฎ
Good game design rules Hitting an obstacle โ†’ lose a life ยท Collecting a coin โ†’ gain a point ยท Lives reach 0 โ†’ display "Game Over" ยท Always define start state: lives = 3, score = 0
โœ๏ธ Test yourself
Question 1
score = 4. The code checks if score > 5 with an else branch. What prints?
Explanation
4 is not greater than 5, so the if condition is false. The else branch runs and prints "Lose".
Question 2
A loop runs for i in range(3) and adds 5 each time, starting from count = 0. What is the final value of count?
Explanation
The loop runs 3 times. Each time count grows by 5: 0 โ†’ 5 โ†’ 10 โ†’ 15.
Question 3
What is the difference between a while loop and a for loop?
Explanation
While loops repeat until a condition is false. For loops repeat a known number of times, usually using range().
Question 4
A player starts with 3 lives and 0 score. They hit 2 obstacles and collect 3 coins. What are lives and score?
Explanation
3 lives โˆ’ 2 obstacles = 1 life. 0 score + 3 coins = 3 score.
Question 5
What is wrong with: if score = 10:?
Explanation
A single = is assignment. To compare values you need ==. Correct: if score == 10:.
Question 6
To stop a while loop in a game, what must happen?
Explanation
A while loop keeps running as long as its condition is true. When the condition becomes false (e.g. lives = 0), the loop exits.
3
โ–พ
๐Ÿค–
What is AI? A system that can make decisions or predictions based on data, without being explicitly programmed for every situation.

How AI learns โ€” training

Training data

Thousands of examples fed in

AI model

Learns patterns by trial & error

Prediction

Makes decisions on new data

How AI learns โ€” trial and error (reinforcement)

The reinforcement learning loop:

Take an action

Get reward / penalty

Update its model

repeats millions of times

Key AI concepts

๐Ÿ“š
Large Language Models (LLMs) Trained on vast amounts of text. They work by predicting the most likely next word. They do NOT search the internet live or store books word for word.
โš–๏ธ
Bias in AI If training data is unbalanced (e.g. only male faces), the AI performs poorly on underrepresented groups. Garbage in = garbage out.
โš ๏ธ
Poor training data If an AI gives incorrect or unfair results, the most likely cause is poor, limited, or unrepresentative training data โ€” not a hardware fault.

AI benefits and risks

BenefitsRisks
Diagnoses diseases from scans faster than humansBiased decisions if training data is unrepresentative
Powers search engines, auto-correct, voice assistantsDeepfakes and misinformation spread more easily
Automates dangerous or repetitive tasksJobs displaced; privacy concerns with mass data use

Key terms

TermDefinition
AISystem that makes decisions or predictions โ€” simulates human-like thinking
Training dataThe examples the AI learns from โ€” quality matters enormously
BiasUnfair or inaccurate results caused by unrepresentative training data
LLMLarge Language Model โ€” predicts likely next words to generate text (e.g. ChatGPT)
AlgorithmA set of step-by-step instructions a computer follows to solve a problem
โœ๏ธ Test yourself
Question 1
An AI trained to recognise handwriting only on typed fonts performs badly on cursive. What is the problem?
Explanation
The AI never saw cursive in training, so it can't recognise it. Garbage in = garbage out โ€” unrepresentative training data leads to poor results.
Question 2
Which of these statements about a Large Language Model is FALSE?
Explanation
LLMs do NOT store books word-for-word. They learn patterns from training text and generate new text by predicting likely next words.
Question 3
Which of these is an example of AI being used in everyday life?
Explanation
Voice assistants, auto-correct, Netflix recommendations, spam filters, face unlock and satnav routing are all everyday examples of AI.
Question 4
What is bias in AI and what causes it?
Explanation
Bias means the AI gives unfair or wrong results for certain groups, caused by training data that didn't include enough varied examples.
Question 5
What is an algorithm?
Explanation
An algorithm is a set of clear step-by-step instructions a computer follows. AI uses algorithms to make decisions from training data.
Question 6
Which of these is a real risk of using AI in healthcare?
Explanation
If training data is mostly one ethnicity or sex, the AI may misdiagnose patients from underrepresented groups โ€” a serious real-world risk.
4
โ–พ

The three main gates

AND

Output is 1 only if BOTH inputs are 1

OR

Output is 1 if AT LEAST ONE input is 1

NOT

Flips the input: 0 โ†’ 1 and 1 โ†’ 0

Truth tables

AND gate

ABOutput
000
010
100
111

OR gate

ABOutput
000
011
101
111

NOT gate

InputOutput
01
10

Real-world examples

GateReal-world example
AND โ€” security doorOpens ONLY if both keycard AND PIN are correct. Both must be 1.
OR โ€” alarm systemTriggers if the door OR the window sensor detects movement. Either can be 1.
NOT โ€” toggle switchIf light is ON (1), NOT flips it to OFF (0). Pressing again flips back.
๐Ÿ”—
George Boole connection Boolean logic (AND, OR, NOT) was invented by George Boole in 1854 โ€” long before computers existed. Every processor in the world is built from billions of these logic gates.
โœ๏ธ Test yourself
Question 1
AND gate: A = 1, B = 0. What is the output?
Explanation
AND only outputs 1 when BOTH inputs are 1. Here B is 0, so the output is 0.
Question 2
OR gate: A = 0, B = 0. What is the output?
Explanation
OR outputs 1 when at least one input is 1. Both inputs are 0, so the output is 0.
Question 3
NOT gate: input = 0. What is the output?
Explanation
NOT flips the input. 0 becomes 1.
Question 4
A school fire alarm rings if the smoke sensor is triggered OR the manual button is pressed. Which gate models this?
Explanation
The alarm triggers if either the smoke sensor OR the button is activated. Only one needs to be true, so this is an OR gate.
Question 5
An alarm triggers if sensor A OR sensor B detects motion. A = 0, B = 1. Does the alarm trigger?
Explanation
OR triggers when at least one input is 1. B = 1 is enough, so the alarm triggers.
Question 6
A microwave only beeps when the door is NOT closed. Which gate is being used to flip the door's "closed" status?
Explanation
The NOT gate flips the input. "Door closed = 1" becomes "Not closed = 0", and vice versa, which the beep system uses to know when to alarm.
5
โ–พ

Robot movement โ€” key commands

CommandEffect
forwardMove straight ahead โ€” set speed and time/distance
turn_left / turn_rightRotate the robot โ€” angle determines turn amount
stopHalt all motors immediately
distance sensorMeasures distance to nearest object โ€” triggers actions when too close
if distance <= 10When object is โ‰ค10 cm away โ†’ typically stop or turn

Shapes from movement โ€” the angle rule

๐Ÿ“
Exterior angle = 360 รท number of sides So a triangle (3 sides) needs 120ยฐ turns, a square (4 sides) needs 90ยฐ turns, a hexagon (6 sides) needs 60ยฐ turns.

Triangle

3 sides ยท turn 120ยฐ each

Square

4 sides ยท turn 90ยฐ each

L-shape

forward, turn 90ยฐ, forward again

Reading robot code โ€” obstacle avoidance

What does this robot do?

while True: dist = sensor.read() if dist <= 10: robot.stop() else: robot.forward(50)
  • Reads sensor every loop cycle
  • If something is within 10cm โ†’ stop
  • Otherwise โ†’ move forward at speed 50

Tracing robot paths โ€” triangle

for i in range(3): robot.forward(30) robot.turn_right(120)
StepActionFacing after
i = 0Forward 30, turn 120ยฐ120ยฐ (SE)
i = 1Forward 30, turn 120ยฐ240ยฐ (SW)
i = 2Forward 30, turn 120ยฐBack to 0ยฐ

Result: a triangle โ€” 3 ร— 120ยฐ = 360ยฐ total rotation.

Common patterns

PatternHow
Straight lineforward() with no turns
SquareRepeat 4 times: forward + turn 90ยฐ
TriangleRepeat 3 times: forward + turn 120ยฐ
L-shapeForward, turn 90ยฐ, forward (different lengths)
Obstacle stopif distance <= threshold โ†’ stop()
โœ๏ธ Test yourself
Question 1
A robot moves forward then turns 120ยฐ, three times. What shape does it draw?
Explanation
3 ร— 120ยฐ = 360ยฐ total rotation, returning to the start direction. With 3 sides this draws a triangle.
Question 2
To draw a regular hexagon (6 sides), what angle must the robot turn each time?
Explanation
Exterior angle = 360 รท number of sides = 360 รท 6 = 60ยฐ.
Question 3
What angle does the robot need to turn to draw a square?
Explanation
Exterior angle = 360 รท number of sides = 360 รท 4 = 90ยฐ.
Question 4
Code repeats 4 times: forward 20, turn right 90ยฐ. What shape and total distance?
Explanation
4 forward moves + 4 turns of 90ยฐ = a square. Distance: 4 ร— 20 = 80 units.
Question 5
The sensor reads 15 and the threshold is if dist <= 10. Does the robot stop or move?
Explanation
15 โ‰ค 10 is false, so the if branch is skipped and the else branch runs (move forward).
Question 6
How would you modify the triangle code to draw a square instead?
Explanation
A square has 4 sides โ€” so range(4) โ€” and exterior angle 360 รท 4 = 90ยฐ โ€” so turn_right(90).
โœจ
โ–พ
๐ŸŽฏ
These are for reinforcement Listen to the podcast on the way to school. Watch the video before bed. Look over the slides any time. No notes needed โ€” just notice how much you recognise now.

๐ŸŽง Podcast โ€” How Boolean Logic Created Modern AI

A short audio explainer linking Boole's 1854 ideas to today's AI.

๐ŸŽฌ Video โ€” The Idea That Built the World

A short film tying the year's content together.

๐Ÿ“‘ Slides โ€” The System Blueprint

Slide deck reviewing the key concepts. Opens full screen with a back button.