Class Combinatorics

java.lang.Object
mathvoyage.combinatorics.Combinatorics

public class Combinatorics extends Object
The type Combinatorics.
  • Method Details

    • getInstance

      public static Combinatorics getInstance()
      Returns the singleton instance of this class.
      Returns:
      The singleton instance
    • combination

      public double combination(int n, int r)
      Returns combination value.
      Parameters:
      n - is the total number of items.
      r - is the number of items to be chosen.
      Returns:
      the combination value.
    • permutation

      public double permutation(int n, int r)
      Returns permutation value.
      Parameters:
      n - is the total number of items.
      r - is the number of items to be arranged.
      Returns:
      the permutation value.
    • generateSubsets

      public static ArrayList<ArrayList<Integer>> generateSubsets(Integer[] set)
      Returns subsets of set.
      Parameters:
      set - is the set we want to show subsets
      Returns:
      the subsets of a sets.
    • numberOfSubsets

      public double numberOfSubsets(int setSize)
      Return number of subsets of a set.
      Parameters:
      setSize - is the number of elements of a set.
      Returns:
      number of subsets of a set.