---
key: lesson/controlled-randomness
type: lesson
id: controlled-randomness
lang: en
title: Randomness and unlucky streaks
summary: >-
  Separate average probability from a short session and decide whether the game
  needs limits on outcome streaks.
updatedAt: '2026-10-20'
status: active
url: 'https://gamemechanics.pro/en/lessons/controlled-randomness/'
jsonUrl: >-
  https://gamemechanics.pro/api/v1/knowledge/en/lesson/controlled-randomness.json
markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/controlled-randomness.md'
aliases:
  - seed
  - сид
  - rng
  - вероятность
tags:
  - balance
  - probability
  - testing
sourceIds:
  - source-a545884312cd1d9f
  - source-de02a17640cd2ba9
sources:
  - id: source-a545884312cd1d9f
    title: 'Ian Schreiber: Level 4, Probability and Randomness'
    url: >-
      https://gamebalanceconcepts.wordpress.com/2010/07/28/level-4-probability-and-randomness/
    verifiedAt: null
  - id: source-de02a17640cd2ba9
    title: 'Ian Schreiber: Level 5, Probability and Randomness Gone Horribly Wrong'
    url: >-
      https://gamebalanceconcepts.wordpress.com/2010/08/04/level-5-probability-and-randomness-gone-horribly-wrong/
    verifiedAt: null
relations:
  - type: requires
    direction: outgoing
    label: Before you start
    key: lesson/choice-cost
    title: Choice costs and situational value
    url: 'https://gamemechanics.pro/en/lessons/choice-cost/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lesson/choice-cost.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lesson/choice-cost.md'
  - type: requires
    direction: incoming
    label: Continue learning
    key: lesson/progression-pacing
    title: 'Progression: capabilities and pacing'
    url: 'https://gamemechanics.pro/en/lessons/progression-pacing/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/lesson/progression-pacing.json
    markdownUrl: >-
      https://gamemechanics.pro/content/knowledge/en/lesson/progression-pacing.md
  - type: explains
    direction: outgoing
    label: Apply the principle
    key: mechanic/rpg-grind--rarity-hunting
    title: Rarity hunting
    url: 'https://gamemechanics.pro/en/knowledge/mechanic/rpg-grind--rarity-hunting/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/mechanic/rpg-grind--rarity-hunting.json
    markdownUrl: >-
      https://gamemechanics.pro/content/knowledge/en/mechanic/rpg-grind--rarity-hunting.md
  - type: practices
    direction: outgoing
    label: Put it into practice
    key: practice/three-workshop-shifts
    title: Three workshop shifts
    url: 'https://gamemechanics.pro/en/knowledge/practice/three-workshop-shifts/'
    jsonUrl: >-
      https://gamemechanics.pro/api/v1/knowledge/en/practice/three-workshop-shifts.json
    markdownUrl: >-
      https://gamemechanics.pro/content/knowledge/en/practice/three-workshop-shifts.md
  - type: practices
    direction: outgoing
    label: Put it into practice
    key: practice/weather-window
    title: The weather window
    url: 'https://gamemechanics.pro/en/knowledge/practice/weather-window/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/practice/weather-window.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/practice/weather-window.md'
  - type: reviews
    direction: outgoing
    label: Review through a lens
    key: lens/schell-036
    title: Chance
    url: 'https://gamemechanics.pro/en/knowledge/lens/schell-036/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/lens/schell-036.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/lens/schell-036.md'
  - type: contains
    direction: incoming
    label: Learning paths
    key: path/balance
    title: Balance and progression
    url: 'https://gamemechanics.pro/en/learn/balance/'
    jsonUrl: 'https://gamemechanics.pro/api/v1/knowledge/en/path/balance.json'
    markdownUrl: 'https://gamemechanics.pro/content/knowledge/en/path/balance.md'
placements: []
supersededBy: []
attributes:
  category: design
  level: intermediate
  minutes: 6
endsAt: null
provenance: >-
  Original gamemechanics.pro material. Check illustrative examples in your own
  project.
license: CC-BY-4.0
codeLicense: MIT
attribution: gamemechanics.pro contributors
---
# Randomness and unlucky streaks

id: controlled-randomness
type: lesson
key: lesson/controlled-randomness
lang: en
status: active
url: https://gamemechanics.pro/en/lessons/controlled-randomness/

Separate average probability from a short session and decide whether the game needs limits on outcome streaks.

## Prerequisites

A reward with a 25% chance need not appear once every four attempts. A short session can differ considerably from the average across many runs.

## The principle

Before implementation, name the event, its probability and dependencies between attempts. [Game Balance Concepts](https://gamebalanceconcepts.wordpress.com/2010/07/28/level-4-probability-and-randomness/) helps distinguish a probability model from one outcome. If you change the distribution for the player experience, update the rule's description too.

Independent rolls do not suit every design. You can limit failure streaks, but the next outcome then depends on history. That choice is not automatically fair: define whose experience and which behavior matter.

<span id="example-expedition-batteries"></span>

## Practical example

### Expedition batteries

In this teaching model, each crate independently contains a battery with probability 0.25. Across five crates, the expected battery count is `5 × 0.25 = 1.25`. The probability of finding none is `0.75^5 ≈ 23.73%`. An average above one coexists with a substantial chance of getting no batteries.

An alternative is to shuffle a bag of four tokens, one representing a battery. Each complete bag provides exactly one. Order is random, but outcomes are dependent. A battery at the beginning of one bag and at the end of the next permits six empty crates in a row. A four-token bag does not guarantee a reward in every sliding window of four attempts.

If a battery is required to finish the level, provide recovery from a poor outcome separately. A guarantee or fallback route changes the design, not just the random-number generator.

## Common mistakes

- Testing 25% with four rolls and declaring the generator broken.
- Applying independent-event formulas to dependent outcomes.
- Saving only the seed (the generator’s initial value) while losing the order of generator calls.

## Verify it

1. Recalculate the empty-streak probability analytically.
2. In simulation, record reward frequency and streak-length distribution, not only the mean.
3. For bags, check every position of the single battery in two adjacent bags.
4. Save the seed, algorithm version and event sequence to reproduce a failure.

## Prompt for an AI agent

> Compare independent rolls and bags over equal crate counts. Show assumptions, a reproducible run and the worst possible bag streak. Do not replace a guarantee calculation with a random simulation result.

Test the choice in [Weather Window](/en/practice/#weather-window) and through the [Chance lens](/en/lenses/#schell-036).

## Connected materials

- Before you start: [Choice costs and situational value](https://gamemechanics.pro/en/lessons/choice-cost/) (key: lesson/choice-cost)
- Continue learning: [Progression: capabilities and pacing](https://gamemechanics.pro/en/lessons/progression-pacing/) (key: lesson/progression-pacing)
- Apply the principle: [Rarity hunting](https://gamemechanics.pro/en/knowledge/mechanic/rpg-grind--rarity-hunting/) (key: mechanic/rpg-grind--rarity-hunting)
- Put it into practice: [Three workshop shifts](https://gamemechanics.pro/en/knowledge/practice/three-workshop-shifts/) (key: practice/three-workshop-shifts)
- Put it into practice: [The weather window](https://gamemechanics.pro/en/knowledge/practice/weather-window/) (key: practice/weather-window)
- Review through a lens: [Chance](https://gamemechanics.pro/en/knowledge/lens/schell-036/) (key: lens/schell-036)
- Learning paths: [Balance and progression](https://gamemechanics.pro/en/learn/balance/) (key: path/balance)

## Sources and provenance

Original gamemechanics.pro material. Check illustrative examples in your own project.

- [Ian Schreiber: Level 4, Probability and Randomness](https://gamebalanceconcepts.wordpress.com/2010/07/28/level-4-probability-and-randomness/) (id: source-a545884312cd1d9f)
- [Ian Schreiber: Level 5, Probability and Randomness Gone Horribly Wrong](https://gamebalanceconcepts.wordpress.com/2010/08/04/level-5-probability-and-randomness-gone-horribly-wrong/) (id: source-de02a17640cd2ba9)

CC-BY-4.0 · gamemechanics.pro contributors
