Beispiel #1
0
        public HashMultiset(Multiset <T> baseSet)
        {
            elementCounts = new Dictionary <T, int>();

            foreach (var x in baseSet)
            {
                this[x] = baseSet[x];
            }
        }
        public static double PolyaEggenberger <T>(Multiset <int> mset, List <T> parties, double alpha)
        {
            int    m = parties.Count;
            double M = Factorial(m);
            int    n = mset.Weight;

            double result;

            result = Factorial(n);
            // Divide by M(a,n)?
            //result /= C(

            for (int i = 0; i < M; i++)
            {
                var elementWeight = mset[i];

                result *= C(alpha, elementWeight);

                // Divide n[i]!
                //result /=
            }

            return(result);
        }