An interactive simulation exploring the roles of luck and hard work in determining success over time. This project uses Streamlit to provide real-time visualization and parameter adjustment.
github.com/imzeeshaan/LuckVsHardwork
This simulation compares two groups:
- Hard Work Only: Success determined purely by effort
- Hard Work + Luck: Success influenced by both effort and random events
The model uses compound growth to demonstrate how these factors affect outcomes over time.
- Clone the repository:
git clone https://github.com/imzeeshaan/LuckVsHardwork.git
cd LuckVsHardwork- Install required packages:
pip install -r requirements.txt- Launch the app:
streamlit run CP.py- Population: Choose between 1,000-20,000 individuals
- Time Period: Simulate 5-50 years
- Hard Work Impact (α): Set influence of effort (0.0-0.5)
- Luck Impact (β): Set influence of random events (0.0-0.5)
- Mean Hard Work (μ): Average effort level (0.0-1.0)
- Hard Work Variation (σ_H): Spread in effort (0.01-0.5)
- Luck Variation (σ_L): Spread in random events (0.01-0.5)
-
Pure Merit System
- Emphasizes hard work (α=0.4)
- Minimal luck influence (β=0.1)
-
Luck-Dominated
- Strong luck impact (β=0.4)
- Moderate effort reward (α=0.1)
-
High Volatility
- Maximum randomness
- Equal effort/luck weights
-
Long-Term Study
- Extended timeframe (50 years)
- See compounding effects
LuckVsHardwork/
├── CP.py # Main simulation
├── requirements.txt # Dependencies
├── README.md # Documentation
├── Procfile # Deployment settings
├── .gitignore
└── .streamlit/
└── config.toml # Streamlit settings
The simulation uses compound growth formulas:
- Hard Work Only:
Success *= (1 + α * HardWork) - Hard Work + Luck:
Success *= (1 + α * HardWork + β * Luck)
Where:
HardWork~ N(μ, σ_H²)Luck~ N(0, σ_L²)
- Visit share.streamlit.io
- Connect to GitHub
- Select
imzeeshaan/LuckVsHardwork - Choose
CP.pyas main file
- Fork the repository
- Create feature branch:
git checkout -b feature/your-feature- Test locally:
streamlit run CP.py- Submit pull request
MIT License - See LICENSE file
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request
Built with: