# sxhnd/pythonprojects architecture

> Architecture diagram of the GitHub repository sxhnd/pythonprojects, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sxhnd/pythonprojects
- Repository: https://github.com/sxhnd/pythonprojects

## Overview

Birthday Problem is a small interactive command-line tool that compares a Monte Carlo estimate of shared-birthday probability with an exact calculation. Its workflow accepts a room size, runs the simulation, reports both probabilities, optionally prints a comparison table, and reports the theoretical 50% threshold. The single source file implements all behavior; the graph separates its meaningful calculation and reporting stages. Relationships are based on the excerpted source.

Main entry points: [`BirthdayProblem/birthday_problem.py`](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py) (Interactive CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_cli["Interactive CLI"]
node_simulation["Monte Carlo"]
node_trial["Birthday Trial"]
node_exact["Exact Probability"]
node_table["Comparison Table"]
node_threshold["Threshold Search"]

node_user -->|"enters room size"| node_cli
node_cli -->|"runs estimate"| node_simulation
node_simulation -->|"repeats trial"| node_trial
node_cli -->|"calculates probability"| node_exact
node_cli -->|"optionally displays"| node_table
node_table -->|"estimates each size"| node_simulation
node_table -->|"calculates each size"| node_exact
node_cli -->|"finds crossing"| node_threshold
node_cli -->|"prints results"| node_user

click node_cli "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"
click node_simulation "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"
click node_trial "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"
click node_exact "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"
click node_table "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"
click node_threshold "https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_cli,node_simulation,node_trial,node_exact,node_table,node_threshold toneTeal
```

## Components

### Other components

- **User**
- [Interactive CLI](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`
- [Monte Carlo](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`
- [Birthday Trial](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`
- [Exact Probability](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`
- [Comparison Table](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`
- [Threshold Search](https://github.com/sxhnd/pythonprojects/blob/main/BirthdayProblem/birthday_problem.py): `BirthdayProblem/birthday_problem.py`

## Connections

- User → Interactive CLI: enters room size (evidence: `BirthdayProblem/birthday_problem.py`)
- Interactive CLI → Monte Carlo: runs estimate (evidence: `BirthdayProblem/birthday_problem.py`)
- Monte Carlo → Birthday Trial: repeats trial (evidence: `BirthdayProblem/birthday_problem.py`)
- Interactive CLI → Exact Probability: calculates probability (evidence: `BirthdayProblem/birthday_problem.py`)
- Interactive CLI → Comparison Table: optionally displays (evidence: `BirthdayProblem/birthday_problem.py`)
- Comparison Table → Monte Carlo: estimates each size (evidence: `BirthdayProblem/birthday_problem.py`)
- Comparison Table → Exact Probability: calculates each size (evidence: `BirthdayProblem/birthday_problem.py`)
- Interactive CLI → Threshold Search: finds crossing (evidence: `BirthdayProblem/birthday_problem.py`)
- Interactive CLI → User: prints results (evidence: `BirthdayProblem/birthday_problem.py`)
