liveBook · Manning

Pseudo-random number generator

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

A deterministically generated number sequence that exhibits statistical properties resembling randomness.

A pseudo-random number generator produces a deterministic sequence that appears random. In population-based metaheuristics, it samples candidate solutions across the search space to support exploration. section 7.1

Use pseudo-random initialization when you need inexpensive variation:

  • It provides moderate diversity at low computational cost, but usually produces low-quality initial solutions. section 7.1
  • Compare it with quasi-random sampling for higher diversity or heuristics for higher-quality, less diverse starting solutions. section 7.1

Generate a reproducible population

In Python, set a seed with np.random.seed(6345245), choose N=200, and generate a 200-by-200 array with np.random.rand(N,N). The seed makes the sequence deterministic while preserving its random-looking sampling behavior. section 7.1

Listing 7.1 Generating initial populations in Python
import math
import numpy as np
import matplotlib.pyplot as plt
  
np.random.seed(6345245)                  #1
  
N=200                                    #2
P_random_pseudo=np.random.rand(N,N)      #3

Inspect the Python listing for seeded pseudo-random population generation, then compare its sampling pattern with alternative methods. section 7.1

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines determinism and sampling trade-offs, then demonstrates seeded NumPy generation without deriving generator internals.
Examples
Uses seeded NumPy sampling of 200 values and compares pseudo-random, quasi-random, Sobol, Latin hypercube, and other sampling plots.
What it assumes
Assumes familiarity with candidate solutions, search spaces, and initial populations in metaheuristic optimization.
What you can do after
Apply it via NumPy to generate reproducible candidate populations for metaheuristic search.
How it connects
Connects pseudo-random numbers with initial populations, quasi-random numbers, heuristics, and exploration–exploitation balance.

Also explained in

Compare how 10 books explain pseudo-random number generator →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.