https://github.com/junaidsalim/implementation_of_central_limit_theorem
C++ code implementing the Central Limit Theorem for calculating mean, standard deviation, and sample mean, generating random samples, and calculating Z-values.
https://github.com/junaidsalim/implementation_of_central_limit_theorem
central-limit-theorem cpp maths statistics
Last synced: 2 months ago
JSON representation
C++ code implementing the Central Limit Theorem for calculating mean, standard deviation, and sample mean, generating random samples, and calculating Z-values.
- Host: GitHub
- URL: https://github.com/junaidsalim/implementation_of_central_limit_theorem
- Owner: JunaidSalim
- Created: 2023-06-28T12:54:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T16:44:09.000Z (over 1 year ago)
- Last Synced: 2025-02-11T13:52:27.395Z (4 months ago)
- Topics: central-limit-theorem, cpp, maths, statistics
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C-plusplus-Implementation-of-Central-Limit-Theorem
C++ code implementing the Central Limit Theorem for calculating mean, standard deviation, and sample mean, generating random samples, and calculating Z-values.## Central Limit Theorem C++ Implementation
This C++ program demonstrates the Central Limit Theorem by calculating mean, standard deviation, sample mean, and Z-values. It also generates random samples from a dataset and saves the calculated values in output files.
### Instructions:
1. **Data File**: Make sure you have a data file named "EmployeeData.csv" in the same directory as the program. The file should contain the dataset from which random samples will be extracted.
2. **Libraries**: The program requires the following libraries: ``, ``, ``, ``, ``, ``, and ``. Ensure that these libraries are available in your C++ environment.
3. **Compile**: Compile the program using a C++ compiler. For example, using g++ in the command line:
```
g++ central_limit_theorem.cpp -o central_limit_theorem
```4. **Run**: Execute the compiled program:
```
./central_limit_theorem
```5. **Output Files**: The program will generate two output files:
- "Output10.txt": Contains the Z-values calculated for sample size 10. Each value is listed on a separate line.
- "test.txt": Contains the Z-values calculated for sample size 300. Each value is listed on a separate line.6. **Review Results**: Open the output files to review the calculated Z-values.
Note: The program assumes that the data file is in the correct format and the dataset contains at least 1000 entries.
### Additional Notes:
- The program uses random number generation to extract samples from the dataset.
- The Central Limit Theorem states that as the sample size increases, the distribution of sample means approaches a normal distribution, regardless of the shape of the original population.
- The calculated Z-values represent the standardized deviation of the sample mean from the population mean, taking into account the sample size and standard deviation.**Important**: Ensure that you have a proper understanding of the Central Limit Theorem and the code before using it or making any modifications.