Expected optimization time

Lax343628.Runtime · concepts/Lax343628/Runtime.lean · lax-343628

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. The expected optimization time is E[T]\mathbb E[T].

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

    Lean source view on GitHub

    1import Lax343628.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. The expected optimization time is E[T]\mathbb E[T].
    13-/
    14
    15namespace Lax343628.Runtime
    16
    17open Lax343628.Algorithm
    18open scoped ENNReal Classical BigOperators
    19
    20noncomputable section
    21
    22/-- The population distribution after tt iterations of the (μ+1)(\mu+1) GA.
    23Initialization is uniform over all indexed populations, equivalently independent uniform
    24initial individuals. Each subsequent iteration uses `step` with fitness Jumpk\mathrm{Jump}_k. -/
    25def populationLaw (n k : ℕ) (μ : ℕ+) (p_c : ℝ) : ℕ → PMF (Population n μ)
    26 | 0 => PMF.uniformOfFintype (Population n μ)
    27 | t + 1 => do
    28 let P ← populationLaw n k μ p_c t
    29 step (jump k) p_c P
    30
    31/-- The probability that the population after tt iterations does not contain 1n1^n.
    32For 1≤k≤n1\le k\le n, this equals Pr⁡[T>t]\Pr[T>t]: since 1n1^n has the unique
    33maximal fitness, it is deleted only when all μ+1\mu+1 entries equal 1n1^n, so it is never
    34lost once present. -/
    35def tailProbability (n k : ℕ) (μ : ℕ+) (p_c : ℝ) (t : ℕ) : ℝ≥0∞ :=
    36 ∑ P : Population n μ with (∀ i, P i ≠ optimum n),
    37 populationLaw n k μ p_c t P
    38
    39/-- The expected optimization time E[T]=∑t=0∞Pr⁡[T>t]\mathbb E[T]=\sum_{t=0}^{\infty}\Pr[T>t].
    40The sum is in nonnegative extended reals and may equal infinity. An optimum already present
    41in the initial population is found at time zero. -/
    42def expectedRuntime (n k : ℕ) (μ : ℕ+) (p_c : ℝ) : ℝ≥0∞ :=
    43 ∑' t : ℕ, tailProbability n k μ p_c t
    44
    45end
    46end Lax343628.Runtime
    47

    Discussion

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

    Loading discussion…