Knowledge Organiser: Random Numbers

Part of Merge Sort ยท Section 8 of 8

Topic SummaryUnit: 3.1 Fundamentals of AlgorithmsGCSE

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

This topic summary covers Knowledge Organiser: Random Numbers within Merge Sort for GCSE Computer Science. Revise Merge Sort in 3.1 Fundamentals of Algorithms for GCSE Computer Science with 16 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.

Practice questions for Merge Sort

Which design strategy does merge sort use?

  • A. Brute force โ€” try every possible ordering
  • B. Greedy โ€” always pick the locally best element
  • C. Divide and conquer โ€” split the list, sort halves, then merge
  • D. Dynamic programming โ€” store results to avoid repeated work
1 markfoundation

Describe how merge sort works. You should include what happens in both the divide and merge phases.

3 marksstandard

Quick recall flashcards

Is merge sort a recursive algorithm?
Yes - it calls itself on smaller sub-lists
What technique does merge sort use?
Divide and conquer - splits list in half repeatedly then merges sorted halves

16 questions on Merge Sort: practise free

Instant marking, adaptive difficulty and spaced-repetition flashcards โ€” all aligned to your exam board.

Start revising free โ†’