Skip to content

peymansheikhghomi/simple-demonstration-of-central-limit-theorem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Central Limit Theorem Demonstration

This repository provides resources for demonstrating and analyzing the Central Limit Theorem (CLT) using Python. It includes both Jupyter Notebook and Python script formats to illustrate how the distribution of sample means approaches normality as the sample size increases.

Repository Structure

  • central_limit_theorem.ipynb: A Jupyter Notebook that demonstrates the Central Limit Theorem through interactive visualization and explanations.

  • central_limit_theorem.py: A Python script that performs the same demonstration as the Jupyter Notebook, showing the CLT through command-line execution.

  • README.md: This file, providing an overview and instructions for the repository.

Overview

The Central Limit Theorem states that the distribution of sample means approaches a normal distribution as the sample size increases, regardless of the original distribution of the data. This repository provides both a Jupyter Notebook and a Python script to visualize this concept.

Jupyter Notebook (central_limit_theorem.ipynb)

  • Interactive Visualization: Allows for step-by-step exploration and visualization of the Central Limit Theorem.
  • Detailed Explanations: Includes markdown cells explaining the process and results.

Python Script (central_limit_theorem.py)

  • Command-Line Execution: Provides a script that can be run from the terminal or command prompt.
  • Histograms and Output: Generates and displays histograms of sample means to illustrate the Central Limit Theorem.

Getting Started

Prerequisites

Ensure you have Python and the required libraries installed. You can install the necessary libraries using:

pip install numpy matplotlib

Running the Script

  1. Save the Script:

    • Ensure the script is as central_limit_theorem.py.
  2. Execute the Script:

    python central_limit_theorem.py
  3. View Results:

    • The script will generate histograms and print conclusions about the Central Limit Theorem to your terminal or command prompt.

Using the Jupyter Notebook

  1. Install Jupyter Notebook: If you don’t have Jupyter installed, you can install it using:

    pip install notebook
  2. Launch Jupyter Notebook: start Jupyter Notebook:

    jupyter notebook
  3. Open the Notebook: Open central_limit_theorem.ipynb in the Jupyter interface to interact with the notebook and explore the visualizations.

Conclusion

The Central Limit Theorem is a key concept in statistics, demonstrating that the distribution of sample means will approximate normality as the sample size grows. This repository offers both an interactive notebook and a script to explore and understand this theorem through practical examples.

Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published