Beispiel #1
0
        public async Task Hgm(int deck_size, int hand_size, params int[] nums)
        {
            //double hyper = AdvMath.hgm(deck_size, hand_size, c1, c2, d1, d2);
            if ((nums.Length) % 2 != 0)
            {
                await ReplyAsync($"Input must be even");
            }
            else
            {
                List <int> k = new List <int>();
                List <int> x = new List <int>();

                for (int i = 0; i < nums.Length; i++)
                {
                    if (i < nums.Length / 2)
                    {
                        k.Add(nums[i]);
                    }
                    else
                    {
                        x.Add(nums[i]);
                    }
                }

                double hyper = AdvMath.multihypergeo(x.ToArray(), deck_size, hand_size, k.ToArray());
                await ReplyAsync($"prob = {hyper}");
            }
        }
 private double perform_calc(int[] counters)
 {
     return(AdvMath.multihypergeo(counters, population, sample_size, max));
 }