Knowledge Organiser: Random Numbers
This topic summary covers Knowledge Organiser: Random Numbers within Merge Sort for GCSE Computer Science. Revise Merge Sort in Algorithms for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 8 of 8 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.
Topic position
Section 8 of 8
Practice
15 questions
Recall
10 flashcards
Knowledge Organiser: Random Numbers
Key Terms
- Random number: An unpredictable value chosen from a range
- Pseudo-random: Numbers that appear random but are generated by a mathematical formula
- Seed: A starting value used by a random number generator; the same seed produces the same sequence
- random(min, max): GCSE pseudocode function that returns a random integer between min and max inclusive
Must-Know Facts
- Computers cannot generate truly random numbers — they use algorithms
random(1, 6)simulates a dice roll; both 1 and 6 are possible outcomes- random() returns integers (whole numbers), not decimals
- Uses of random numbers: games, simulations, security, testing, art
- The same seed value always produces the same sequence of pseudo-random numbers
Key Concepts
- Syntax:
num = random(min, max)— both endpoints are inclusive - Dice roll example:
roll = random(1, 6) - Random numbers in security: used for encryption keys and password generation
- Random numbers in games: enemy spawning, card shuffling, procedural generation
Common Mistakes
- Saying computers generate truly random numbers: Computers use algorithms (pseudo-random number generators) — the numbers appear random but are calculated mathematically
- Thinking both endpoints are not included:
random(1, 6)can return both 1 AND 6 — the range is inclusive at both ends - Confusing seed and random number: The seed is the starting value for the generator; the random number is the output — the same seed always produces the same sequence
- Expecting random() to return a decimal: The GCSE pseudocode
random()function returns an integer (whole number) — it does not produce floating-point values
Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.
Try the interactive Knowledge Organiser — free →