コード例 #1
0
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());

            int[] nums = Array.ConvertAll(Console.ReadLine().Split(' '), qTemp => Convert.ToInt32(qTemp));


            Console.WriteLine($"{StatUtilities.GetMean(nums):0.0}");
            Console.WriteLine($"{StatUtilities.GetMedian(nums):0.0}");
            Console.WriteLine($"{StatUtilities.GetMode(nums)}");
        }
コード例 #2
0
 public static double Probability(int n, int k, double p)
 {
     return(StatUtilities.GetBinCoeff(n, k) * Math.Pow(p, k) * Math.Pow(1.0 - p, n - k));
 }
コード例 #3
0
        public double CumulativeProbability(double x)
        {
            var z = (x - Mean) / (Std * Math.Sqrt(2));

            return((1 + StatUtilities.ErrorFunction(z)) / 2);
        }
コード例 #4
0
 public static double Probability(int x, double mean)
 {
     return(Math.Pow(mean, x) * Math.Pow(Math.E, -mean) / StatUtilities.Factorial(x));
 }