Skip to content

FixedPoints ​

The number of fixed points of pp: positions ii with pi=ip_i = i.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaFixed point (mathematics)MathWorldFixedPointWikidataQ217608Encyclopedia of Mathematicsfixed_pointnLabfixed pointBritannicascience/invariant-pointFindStatSt001903via ParkingFunction✓St000022via Permutation✓
FixedPoints(p)the fixed-point count of a one-line permutation pp
SageMathenumeratio_stat("Permutation", p, "FixedPoints")
Typed signatures
TypePackageApplies
(permutation) -> integercombinatoricsalways

Domain: Permutation statistics

Details
  • A permutation with no fixed points is a derangement (see Derangements)
  • Averaged over SnS_n the count is exactly 11, independent of nn
  • Defined over Permutation as an expression in _x, evaluated by compute-engine — the definition IS the implementation.
  • Takes a Permutation and nothing else — it reads values against their positions, or walks the orbits, so it needs the bijection. Applying it to a bare list is a type error, not a wrong answer.

Definition

Epsil, as the implementation runs it.

on Permutation, over _x

0 if Length(_x) < 1 else Count(Filter(
                                       Range(1, Length(_x)),
                                       Function(_x[i] == i, i),
                                     ))

Examples

Basic #

only 11 is fixed

live ↗
InFixedPoints(Permutation⁡([1,3,2]))\mathrm{FixedPoints}({\operatorname{Permutation}}([1, 3, 2]))Out11

the identity fixes all

live ↗
InFixedPoints(Permutation⁡([1,2,3]))\mathrm{FixedPoints}({\operatorname{Permutation}}([1, 2, 3]))Out33

the one-line word 312312

live ↗
InFixedPoints(Permutation⁡([3,1,2]))\mathrm{FixedPoints}({\operatorname{Permutation}}([3, 1, 2]))Out00

the one-line word 24132413

live ↗
InFixedPoints(Permutation⁡([2,4,1,3]))\mathrm{FixedPoints}({\operatorname{Permutation}}([2, 4, 1, 3]))Out00

the endofunction 1↦1,2↦3,3↦31 \mapsto 1, 2 \mapsto 3, 3 \mapsto 3

live ↗
InCombinatorialStat(Endofunction⁡([1,3,3]),FixedPoints)\mathrm{CombinatorialStat}({\operatorname{Endofunction}}([1, 3, 3]), \text{FixedPoints})Out22

the signed permutation 1 2ˉ 31\,\bar{2}\,3: 2ˉ\bar{2} is not fixed

live ↗
InCombinatorialStat(SignedPermutation⁡([1,−2,3]),FixedPoints)\mathrm{CombinatorialStat}({\operatorname{SignedPermutation}}([1, -2, 3]), \text{FixedPoints})Out22
Properties #

a derangement fixes nothing

live ↗
InFixedPoints(Permutation⁡([2,3,1]))\mathrm{FixedPoints}({\operatorname{Permutation}}([2, 3, 1]))Out00

FindStat's value for [1]

live ↗
InCombinatorialStat(Permutation⁡([1]),FixedPoints)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1]), \text{FixedPoints})Out11

Known value · FindStat St000022

FindStat's value for [1,2]

live ↗
InCombinatorialStat(Permutation⁡([1,2]),FixedPoints)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([1, 2]), \text{FixedPoints})Out22

Known value · FindStat St000022

FindStat's value for [2,1]

live ↗
InCombinatorialStat(Permutation⁡([2,1]),FixedPoints)\mathrm{CombinatorialStat}({\operatorname{Permutation}}([2, 1]), \text{FixedPoints})Out00

Known value · FindStat St000022

About
Examples10
Checked againstSageMath 8 agreemathlib4 5 agree
CrosswalkWikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaFindStat ×2SageMath

Implementation

mappedsagepackages/oracle/src/mappings.ts
mappedmathlib4packages/oracle/src/mappings.ts

A 1-based one-line permutation list, rebuilt as an Equiv.Perm (Fin n) (a list that is not a permutation prints "not a permutation"); fixed points counted over Fin n

See also: Derangements, CycleCount, SymmetricGroup