{"id":24771108,"url":"https://github.com/cego669/coinbiasexperiment","last_synced_at":"2025-07-11T20:33:14.979Z","repository":{"id":274058802,"uuid":"921779914","full_name":"cego669/CoinBiasExperiment","owner":"cego669","description":"An interactive Python application demonstrating Bayesian inference with coin toss experiments.","archived":false,"fork":false,"pushed_at":"2025-01-24T16:17:19.000Z","size":297,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T20:33:29.036Z","etag":null,"topics":["bayesianinference","betadistribution","datavisualization","interactiveapplications","matplotlib","probability","python","statistics"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/cego669","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cego669.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T15:50:08.000Z","updated_at":"2025-03-15T04:11:53.000Z","dependencies_parsed_at":"2025-03-24T06:30:47.420Z","dependency_job_id":null,"html_url":"https://github.com/cego669/CoinBiasExperiment","commit_stats":null,"previous_names":["cego669/coinbiasexperiment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cego669/CoinBiasExperiment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego669%2FCoinBiasExperiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego669%2FCoinBiasExperiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego669%2FCoinBiasExperiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego669%2FCoinBiasExperiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cego669","download_url":"https://codeload.github.com/cego669/CoinBiasExperiment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cego669%2FCoinBiasExperiment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264893046,"owners_count":23679403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesianinference","betadistribution","datavisualization","interactiveapplications","matplotlib","probability","python","statistics"],"created_at":"2025-01-29T03:58:01.849Z","updated_at":"2025-07-11T20:33:14.898Z","avatar_url":"https://github.com/cego669.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coin Bias Experiment\n\nThis repository contains an interactive application that demonstrates how Bayesian inference can be applied to estimate the bias of a coin based on a series of coin tosses. The application is built using Python and utilizes matplotlib widgets for interactivity.\n\n## Motivation\n\nBayesian inference is a cornerstone of modern statistics and machine learning. This project showcases its power and simplicity by focusing on a classic example: estimating the bias $\\theta$ of a coin as evidence (coin tosses) accumulates.\n\nThe project is both educational and interactive, making it an excellent resource for learners and enthusiasts who want to deepen their understanding of Bayesian concepts.\n\n## How It Works\n\n1. **Bayesian Update Rule**: The application uses Bayes' Theorem to update the posterior probability density of the coin bias after each toss.\n2. **Interactive Features**: \n   - Adjust the coin's bias $\\theta$ using a slider.\n   - Toss the coin and watch the probability density function (PDF) update dynamically.\n   - Clear the experiment to start over.\n3. **Theoretical Foundation**: The probability density follows a Beta distribution, which depends on the number of tosses $n$ and the number of heads $k$ observed.\n\nFor more details, consult the [theory document](./theory_coin_experiment.pdf).\n\n## Features\n\n- Visualize the Bayesian updating process in real time.\n- Experiment with different coin biases.\n- Educational tool for learning Bayesian inference and the Beta distribution.\n\n## Getting Started\n\n### Prerequisites\n\nEnsure you have Python 3.8 or later installed. The required libraries are listed in `requirements.txt`.\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/cego669/CoinBiasExperiment.git\n   cd CoinBiasExperiment\n   ```\n2. Install the dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n3. Run the application:\n   ```bash\n   python coin_toss_experiment.py\n   ```\n## Dependencies\n\nThe following Python libraries are required:\n- matplotlib\n- sympy\n- numpy\n- scipy\n\nFor a full list of dependencies and their versions, refer to [`requirements.txt`](./requirements.txt).\n\n## Interactive Demo\n\n![Screenshot of the application in action](interactive_demo.png)\n\n- Use the slider to set the bias of the coin.\n- Click \"Toss next coin\" to add a toss and observe the updated posterior distribution.\n- Clear the experiment to reset.\n\n## Documentation\n\nFor a detailed mathematical explanation of the Bayesian model and Beta distribution, refer to:\n- [Theory Document (English)](./theory_coin_experiment.pdf)\n- [Documento Teórico (Português)](./teoria_experimento_moedas.pdf)\n\n## Author\n\n- **Carlos Eduardo Gonçalves de Oliveira**\n  - LinkedIn: [linkedin.com/in/cego669](https://www.linkedin.com/in/cego669)\n  - GitHub: [github.com/cego669](https://github.com/cego669)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcego669%2Fcoinbiasexperiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcego669%2Fcoinbiasexperiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcego669%2Fcoinbiasexperiment/lists"}