Exemple #1
0
        static void Task921(string path)
        {
            Console.WriteLine("Task 921\n");
            SolvePth solution = new SolvePth();
            Dictionary <double, double> data = solution.readFile(path);
            int currentCases = 58;

            Console.WriteLine("Overall: {0}", solution.overall);
            Console.WriteLine("Amount of cases: {0}", currentCases);
            Console.WriteLine("Expected value: {0}", solution.Expected_Value(currentCases));
            Console.WriteLine("Variance: {0}", solution.Variance(currentCases));
            Console.WriteLine("S: {0}", solution.S(solution.amountOfCases));
            Console.WriteLine("Middle square error: {0}", solution.MiddleSquareError(solution.S(currentCases), currentCases, solution.overall));
            Console.WriteLine("Probability: {0}", solution.Erf(0.01 / solution.MiddleSquareError(solution.S(currentCases), currentCases, solution.overall)));

            double w = data.Values.Max() / currentCases;

            Console.WriteLine("Middle square error for part: {0}", solution.MiddleSquareErrorPart(w, currentCases, solution.overall));

            Console.WriteLine("Erf(t) = 0.834232 -> t = 0.98");
            double x = 0.98 * solution.MiddleSquareErrorPart(w, currentCases, solution.overall);

            Console.WriteLine("Delta: {0}", x);
            Console.WriteLine("Borders: [{0}; {1}]", (w - x) / 10, (w + x) / 10);
            Console.WriteLine();
        }
Exemple #2
0
        static void Task920(string path)
        {
            Console.WriteLine("Task 920\n");
            SolvePth solution = new SolvePth();
            Dictionary <double, double> data = solution.readFile(path);
            int currentOverall = int.MaxValue;

            Console.WriteLine("Overall: INF ({0})", currentOverall);
            Console.WriteLine("Amount of cases: {0}", solution.amountOfCases);
            Console.WriteLine("Expected value: {0}", solution.Expected_Value(solution.amountOfCases));
            Console.WriteLine("Variance: {0}", solution.Variance(solution.amountOfCases));
            Console.WriteLine("S: {0}", solution.S(solution.amountOfCases));
            Console.WriteLine("Middle square error: {0}", solution.MiddleSquareError(solution.S(solution.amountOfCases), solution.amountOfCases, currentOverall));
            Console.WriteLine("Probability: {0}", solution.Erf(45 / solution.MiddleSquareError(solution.S(solution.amountOfCases), solution.amountOfCases, currentOverall)));

            double w = data.Values.Max() / solution.amountOfCases;

            Console.WriteLine("Middle square error for part: {0}", solution.MiddleSquareErrorPart(w, solution.amountOfCases, currentOverall));

            Console.WriteLine("Erf(t) = 0.99 -> t = 1.82139");
            double x = 1.82139 * solution.MiddleSquareErrorPart(w, solution.amountOfCases, currentOverall);

            Console.WriteLine("Delta: {0}", x);
            Console.WriteLine("Borders: [{0}; {1}]", w - x, w + x);
        }
Exemple #3
0
        static void Task923()
        {
            Console.WriteLine("Task 923\n");
            SolvePth solution          = new SolvePth();
            int      currentOverall    = 5000;
            int      currentCases      = 300;
            double   expected          = 8000;
            double   middleSquareError = 2500;

            Console.WriteLine("Probability: {0}", solution.Erf(middleSquareError / expected));
            Console.WriteLine();
        }
Exemple #4
0
        static void Task924(string path)
        {
            Console.WriteLine("Task 924\n");
            SolvePth solution = new SolvePth();
            Dictionary <double, double> data = solution.readFile(path);

            Console.WriteLine("Overall: {0}", solution.overall);
            Console.WriteLine("Amount of cases: {0}", solution.amountOfCases);
            Console.WriteLine("Expected value: {0}", solution.Expected_Value(solution.amountOfCases));
            Console.WriteLine("Variance: {0}", solution.Variance(solution.amountOfCases));
            Console.WriteLine("S: {0}", solution.S(solution.amountOfCases));
            Console.WriteLine("Middle square error: {0}", solution.MiddleSquareError(solution.S(solution.amountOfCases), solution.amountOfCases, solution.overall));
            Console.WriteLine("Probability: {0}", solution.Erf(0.01 / solution.MiddleSquareError(solution.S(solution.amountOfCases), solution.amountOfCases, solution.overall)));
            Console.WriteLine();
        }