Class RandomDerangement

java.lang.Object
dk.jonaslindstrom.ruffini.permutations.algorithms.RandomDerangement

public class RandomDerangement extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(int n)
    Algorithm from "Generating random derangements" by Martínez et.al (https://epubs.siam.org/doi/pdf/10.1137/1.9781611972986.7).
    static double
    D(int n)
    Compute the number of derangements of n symbols recursively

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RandomDerangement

      public RandomDerangement(Random random)
  • Method Details

    • D

      public static double D(int n)
      Compute the number of derangements of n symbols recursively
    • apply

      public Permutation apply(int n)
      Algorithm from "Generating random derangements" by Martínez et.al (https://epubs.siam.org/doi/pdf/10.1137/1.9781611972986.7).