Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:22:24+00:00 2026-05-24T18:22:24+00:00

i want to observe central limit theorem and wrote this program.But i confused that,must

  • 0

i want to observe central limit theorem and wrote this program.But i confused that,must i observe like that.Is there any wrong ?

xx
xxx
xxxx
xxxxx
xxxxxx
xxx
xxxx
xxx
x
x
namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
                Func();
        }
        public static void Func()
        {
            Random r = new Random();
            int[] d = new int [10];
            int sum;

            for (int k = 0; k < 5000; k++)
            {
                sum = 0;

                for (int i = 0; i < 50; i++)
                    sum += r.Next(0, 10000);
                Set(d, sum/50);

            }

            DispResult(d);
        }
        private static void DispResult(int[] d)
        {
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < d[i]; j += 1000)
                {
                    Console.Write("X");
                }
                Console.WriteLine();
            }
        }
        private static void Set(int[] d, int a)
        {

            if (a > 9000)
                d[9]++;
            else if (a > 8000)
                d[8]++;
            else if (a > 7000)
                d[7]++;
            else if (a > 6000)
                d[6]++;
            else if (a > 5000)
                d[5]++;
            else if (a > 4000)
                d[4]++;
            else if (a > 3000)
                d[3]++;
            else if (a > 2000)
                d[2]++;
            else if (a > 1000)
                d[1]++;
            else
                d[0]++;
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:22:24+00:00Added an answer on May 24, 2026 at 6:22 pm

    It is very unclear what you’re asking here but I’ll take a stab at it.

    Your program simulates rolling a 10000-sided die fifty times and taking the average. You then do that 5000 times and show a histogram of the results.

    The Central Limit Theorem states that as the number of rolls increases, the histogram should more closely approximate a Gaussian distribution.

    If what you want to do is to observe the truth of the Central Limit Theorem, then I would modify your program as follows: I would make “Func” take an integer n, the number of rolls and then have the body of Main be:

    for(int n = 1; n < 10; ++n)
    {
       Func(n);
       Console.WriteLine("-----");
    }
    

    Then replace all the “50”s in Func with n.

    That way you are simulating rolling 1, 2, 3, 4… 10 dice and taking the average. When you plot the histograms you’ll see that for 1, the histogram is rectangular and then it gets more and more bell shaped as n increases. That demonstrates the Central Limit Theorem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my EmberJS application, there are use cases where I want to observe something
I have two events that I want to observe on an object, input.blur(function(event) {
I want to observe adding element to array. below is test program. <!-- library
If I have an object that I want to be able to observe several
I want to observe /sdcard/ that if file or folder copy in /sdcard/ or
I noticed that there is no delegate to observe changes in UIDatePicker. Is there
Can someone possibly help me with this? I want to observe a file to
Using Rx, I want to observe a legacy object that exposes both the method
I want to show gps coordinates in the Label , is there any default
I want to learn how to use MSBuild ReadLinesFromFile Task I observe Output tag

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.