Expected optimization time

Lax637351.Runtime · concepts/Lax637351/Runtime.lean · lax-637351

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    The (μ+1)(\mu+1) genetic algorithm with crossover probability pcp_c is run on Jumpk\mathrm{Jump}_k, starting from μ\mu individuals chosen independently and uniformly at random from {0,1}n\{0,1\}^n. Its optimization time TT is the number of iterations until the population first contains the optimum 1n1^n; iterations whose offspring is discarded by avoidance of replications count as well. The expected optimization time is E[T]\mathbb E[T].

    Concept map
    2 concepts; 5 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Lax637351.Algorithm
    2import Mathlib.Topology.Algebra.InfiniteSum.ENNReal
    3
    4/-!
    5---
    6title: Expected optimization time
    7type: definition
    8---
    9The (μ+1)(\mu+1) genetic algorithm with crossover probability pcp_c is run on
    10Jumpk\mathrm{Jump}_k, starting from μ\mu individuals chosen independently and uniformly at
    11random from {0,1}n\{0,1\}^n. Its optimization time TT is the number of iterations until the
    12population first contains the optimum 1n1^n; iterations whose offspring is discarded by
    13avoidance of replications count as well. The expected optimization time is E[T]\mathbb E[T].
    14-/
    15
    16namespace Lax637351.Runtime
    17
    18open Lax637351.Algorithm
    19open scoped ENNReal Classical
    20
    21noncomputable section
    22
    23/-- The population distribution after tt iterations of the (μ+1)(\mu+1) GA.
    24Initialization is uniform over all populations, equivalently independent uniform initial
    25individuals. Each subsequent iteration uses `step` with fitness Jumpk\mathrm{Jump}_k. -/
    26def populationDistribution (n k : ℕ) (μ : ℕ+) (p_c : ℝ) (avoidReplications : Bool) (t : ℕ) :
    27 PMF (Population n μ) :=
    28 match t with
    29 | 0 => PMF.uniformOfFintype (Population n μ)
    30 | s + 1 => do
    31 let P ← populationDistribution n k μ p_c avoidReplications s
    32 step (jump k) p_c avoidReplications P
    33
    34/-- The expected optimization time E[T]=∑t=0∞Pr⁡[T>t]\mathbb E[T]=\sum_{t=0}^{\infty}\Pr[T>t]. The inner sum is
    35the probability that the population after tt iterations does not contain 1n1^n; for
    361≤k≤n1\le k\le n it equals Pr⁡[T>t]\Pr[T>t], since 1n1^n has the unique maximal fitness and is never
    37lost once present. The sum is in nonnegative extended reals and may equal infinity. An optimum
    38already present in the initial population is found at time zero. -/
    39def expectedOptimizationTime (n k : ℕ) (μ : ℕ+) (p_c : ℝ) (avoidReplications : Bool) : ℝ≥0∞ :=
    40 ∑' t : ℕ, ∑ P : Population n μ with (∀ i, P i ≠ optimum n),
    41 populationDistribution n k μ p_c avoidReplications t P
    42
    43end
    44end Lax637351.Runtime
    45

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…