karthik-2905 commited on
Commit
de3eb6b
ยท
verified ยท
1 Parent(s): 3426e5f

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ monte_carlo_results/plots/.ipynb_checkpoints/mcmc_results-checkpoint.png filter=lfs diff=lfs merge=lfs -text
37
+ monte_carlo_results/plots/.ipynb_checkpoints/mcts_results-checkpoint.png filter=lfs diff=lfs merge=lfs -text
38
+ monte_carlo_results/plots/.ipynb_checkpoints/pi_estimation-checkpoint.png filter=lfs diff=lfs merge=lfs -text
39
+ monte_carlo_results/plots/integration.png filter=lfs diff=lfs merge=lfs -text
40
+ monte_carlo_results/plots/mcmc_results.png filter=lfs diff=lfs merge=lfs -text
41
+ monte_carlo_results/plots/mcts_results.png filter=lfs diff=lfs merge=lfs -text
42
+ monte_carlo_results/plots/pi_estimation.png filter=lfs diff=lfs merge=lfs -text
.ipynb_checkpoints/Untitled-checkpoint.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
.tool-versions ADDED
@@ -0,0 +1 @@
 
 
1
+ python 3.13.5t
README.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Monte Carlo Methods Implementation
2
+
3
+ A comprehensive implementation of Monte Carlo Methods for probabilistic modeling, numerical integration, and AI applications, featuring educational content and practical demonstrations.
4
+
5
+ ## ๐Ÿ“‹ Project Overview
6
+
7
+ This project provides a complete learning experience for Monte Carlo Methods, from theoretical foundations to practical implementations. It covers multiple Monte Carlo techniques including basic sampling, integration, Markov Chain Monte Carlo (MCMC), and Monte Carlo Tree Search (MCTS) with real-world applications.
8
+
9
+ ## ๐ŸŽฏ Key Features
10
+
11
+ - **Educational Content**: Comprehensive learning roadmap with real-life analogies
12
+ - **Multiple Monte Carlo Techniques**: Pi estimation, numerical integration, MCMC, and MCTS
13
+ - **Practical Applications**: From simple probability estimation to AI game playing
14
+ - **Rich Visualizations**: Interactive plots showing convergence and results
15
+ - **Performance Analysis**: Detailed metrics and convergence studies
16
+
17
+ ## ๐Ÿ“ Project Structure
18
+
19
+ ```
20
+ โ”œโ”€โ”€ implementation.ipynb # Main notebook with theory and implementation
21
+ โ”œโ”€โ”€ README.md # This file
22
+ โ””โ”€โ”€ monte_carlo_results/ # Generated results and outputs
23
+ โ”œโ”€โ”€ data/ # Numerical results and summaries
24
+ โ”‚ โ”œโ”€โ”€ results_20250730_110945.pkl # Detailed results data
25
+ โ”‚ โ””โ”€โ”€ summary_20250730_110945.csv # Key metrics summary
26
+ โ”œโ”€โ”€ models/ # Saved models (if any)
27
+ โ””โ”€โ”€ plots/ # Visualization outputs
28
+ โ”œโ”€โ”€ integration.png # Monte Carlo integration visualization
29
+ โ”œโ”€โ”€ mcmc_results.png # MCMC sampling results
30
+ โ”œโ”€โ”€ mcts_results.png # Monte Carlo Tree Search analysis
31
+ โ””โ”€โ”€ pi_estimation.png # Pi estimation convergence plot
32
+ ```
33
+
34
+ ## ๐Ÿš€ Getting Started
35
+
36
+ ### Prerequisites
37
+ ```bash
38
+ pip install numpy pandas matplotlib seaborn jupyter scipy scikit-learn
39
+ ```
40
+
41
+ ### Running the Project
42
+ 1. Open `implementation.ipynb` in Jupyter Notebook
43
+ 2. Run all cells to see the complete learning experience
44
+ 3. The notebook includes:
45
+ - Theoretical explanations with real-life analogies
46
+ - Step-by-step implementations of different Monte Carlo methods
47
+ - Interactive visualizations and convergence analysis
48
+ - Performance metrics and practical applications
49
+
50
+ ## ๐Ÿงฎ Methods Implemented
51
+
52
+ ### 1. Pi Estimation
53
+ - **Method**: Random dart throwing in unit circle
54
+ - **Concept**: Geometric probability using area ratios
55
+ - **Result**: Accurate ฯ€ estimation through random sampling
56
+ - **Key Metric**: Estimated ฯ€ โ‰ˆ 3.1348
57
+
58
+ ### 2. Monte Carlo Integration
59
+ - **Method**: Numerical integration using random sampling
60
+ - **Concept**: Estimating definite integrals through random points
61
+ - **Application**: Solving complex integrals analytically difficult
62
+ - **Key Metric**: Integration result โ‰ˆ 1.997
63
+
64
+ ### 3. Markov Chain Monte Carlo (MCMC)
65
+ - **Method**: Sampling from complex probability distributions
66
+ - **Concept**: Using Markov chains to explore probability spaces
67
+ - **Application**: Bayesian inference and parameter estimation
68
+ - **Key Metric**: Sampling efficiency โ‰ˆ 0.837
69
+
70
+ ### 4. Monte Carlo Tree Search (MCTS)
71
+ - **Method**: Decision tree exploration for game AI
72
+ - **Concept**: Balancing exploration and exploitation in decision making
73
+ - **Application**: Game playing AI (like AlphaGo)
74
+ - **Key Metric**: Search depth/efficiency = 1000.0
75
+
76
+ ## ๐Ÿ“Š Key Results
77
+
78
+ | Method | Key Metric | Description |
79
+ |--------|------------|-------------|
80
+ | Pi Estimation | 3.1348 | Estimated value of ฯ€ using random sampling |
81
+ | Integration | 1.9974 | Numerical integration result |
82
+ | MCMC | 0.8371 | Sampling efficiency metric |
83
+ | MCTS | 1000.0 | Search performance indicator |
84
+
85
+ ## ๐Ÿง  Learning Content
86
+
87
+ The notebook includes comprehensive educational material:
88
+
89
+ 1. **Basic Probability Sampling** - Random number generation and coin flipping
90
+ 2. **Monte Carlo Integration** - Estimating areas and integrals
91
+ 3. **Monte Carlo Tree Search** - Decision trees with random exploration
92
+ 4. **Markov Chain Monte Carlo** - Complex distribution sampling
93
+ 5. **Variational Monte Carlo** - Neural network optimization
94
+ 6. **Formula Memory Aids** - Real-life analogies for key concepts
95
+
96
+ ## ๐Ÿ” Key Concepts Covered
97
+
98
+ - **Monte Carlo Estimation**: "Sample, Apply function, Average" (SAA)
99
+ - **Integration**: "Width ร— Average Height = Area"
100
+ - **Standard Error**: "More samples = Square root better accuracy"
101
+ - **Law of Large Numbers**: Why averaging random samples works
102
+ - **Central Limit Theorem**: Why errors decrease with โˆšN
103
+
104
+ ## ๐Ÿ“ˆ Visualizations
105
+
106
+ - **Pi Estimation Plot**: Convergence of ฯ€ estimate over iterations
107
+ - **Integration Visualization**: Random sampling for numerical integration
108
+ - **MCMC Results**: Sampling distribution and chain convergence
109
+ - **MCTS Analysis**: Tree search performance and decision quality
110
+
111
+ ## ๐ŸŽ“ Educational Value
112
+
113
+ This project serves as a complete learning resource for understanding Monte Carlo Methods, combining:
114
+
115
+ - **Theoretical Foundation**: Mathematical principles with intuitive explanations
116
+ - **Practical Implementation**: Working code for multiple Monte Carlo techniques
117
+ - **Real-world Applications**: From numerical analysis to AI game playing
118
+ - **Performance Analysis**: Understanding convergence and accuracy trade-offs
119
+
120
+ ## ๐Ÿ”ฌ Real-World Applications
121
+
122
+ - **Finance**: Risk assessment and option pricing
123
+ - **Physics**: Quantum mechanics and statistical mechanics simulations
124
+ - **Machine Learning**: Bayesian inference and neural network training
125
+ - **Game AI**: Strategic decision making (AlphaGo, chess engines)
126
+ - **Engineering**: Reliability analysis and optimization
127
+ - **Statistics**: Complex probability distribution sampling
128
+
129
+ ## ๐Ÿ“š Study Resources
130
+
131
+ The project references key learning materials:
132
+ - "Monte Carlo Methods in Financial Engineering" by Glasserman
133
+ - "Pattern Recognition and Machine Learning" by Bishop (Chapter 11)
134
+ - Stanford CS228 notes on MCMC
135
+ - 3Blue1Brown probability videos
136
+
137
+ ## ๐Ÿ† Key Achievements
138
+
139
+ โœ… **Accurate Pi Estimation**: Demonstrates fundamental Monte Carlo principles
140
+
141
+ โœ… **Numerical Integration**: Solves complex mathematical problems
142
+
143
+ โœ… **MCMC Sampling**: Advanced probabilistic inference techniques
144
+
145
+ โœ… **MCTS Implementation**: AI decision-making algorithms
146
+
147
+ โœ… **Comprehensive Visualizations**: Clear understanding of convergence behavior
148
+
149
+ This project provides a solid foundation for understanding Monte Carlo Methods and their applications in AI, machine learning, and computational science.# MonteCarloMethods
implementation.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
monte_carlo_results/data/results_20250730_110945.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02d4db1b304c4148a9e14a1eb3b167b1d2ab0b44e1cb4db6cc11fc0d4a524565
3
+ size 89677
monte_carlo_results/data/summary_20250730_110945.csv ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Method,Key_Metric
2
+ Pi Estimation,3.1348
3
+ Integration,1.9974721519128755
4
+ MCMC,0.8371
5
+ MCTS,1000.0
monte_carlo_results/plots/.ipynb_checkpoints/mcmc_results-checkpoint.png ADDED

Git LFS Details

  • SHA256: 0a30003db4e4dab10d4fec4734f710759dd03ba894b4ac6f6ef3d81afd01d4d8
  • Pointer size: 131 Bytes
  • Size of remote file: 615 kB
monte_carlo_results/plots/.ipynb_checkpoints/mcts_results-checkpoint.png ADDED

Git LFS Details

  • SHA256: 8130bb66ef1105ce295b8810bd3769c88a5182acb7627b95d152b3d08bccbc99
  • Pointer size: 131 Bytes
  • Size of remote file: 683 kB
monte_carlo_results/plots/.ipynb_checkpoints/pi_estimation-checkpoint.png ADDED

Git LFS Details

  • SHA256: 6e218b40f21f8087832976af94010ed5f09e5f668c71bbce9abf9681e9b73a11
  • Pointer size: 131 Bytes
  • Size of remote file: 650 kB
monte_carlo_results/plots/integration.png ADDED

Git LFS Details

  • SHA256: 726d2decb264cfe67e423bc40e55a6e553146c9f05ca85d2c68cce70d429aa28
  • Pointer size: 131 Bytes
  • Size of remote file: 295 kB
monte_carlo_results/plots/mcmc_results.png ADDED

Git LFS Details

  • SHA256: 0a30003db4e4dab10d4fec4734f710759dd03ba894b4ac6f6ef3d81afd01d4d8
  • Pointer size: 131 Bytes
  • Size of remote file: 615 kB
monte_carlo_results/plots/mcts_results.png ADDED

Git LFS Details

  • SHA256: 8130bb66ef1105ce295b8810bd3769c88a5182acb7627b95d152b3d08bccbc99
  • Pointer size: 131 Bytes
  • Size of remote file: 683 kB
monte_carlo_results/plots/pi_estimation.png ADDED

Git LFS Details

  • SHA256: 6e218b40f21f8087832976af94010ed5f09e5f668c71bbce9abf9681e9b73a11
  • Pointer size: 131 Bytes
  • Size of remote file: 650 kB