Skip to content

Added birthday collision simulation example#3

Merged
jody merged 3 commits into
mainfrom
birthday-collision-example
May 2, 2026
Merged

Added birthday collision simulation example#3
jody merged 3 commits into
mainfrom
birthday-collision-example

Conversation

@jody
Copy link
Copy Markdown
Contributor

@jody jody commented May 2, 2026

Created a "Birthday Collision" simulation example and updated the README.
Also added macOS specific files to .gitignore.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new runnable Monte Carlo example (BirthdayCollisionSimulation) to the simulation.examples package, updates the README to reference/run it, and ignores macOS Finder metadata.

Changes:

  • Introduce BirthdayCollisionSimulation example that estimates birthday-collision probability across multiple trial counts.
  • Add JUnit 5 unit tests covering constructor validation, core collision logic, and estimate behavior.
  • Update README.md usage examples and extend .gitignore for .DS_Store.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
src/main/java/simulation/examples/BirthdayCollisionSimulation.java New example simulation implementing repeated trials using the existing discrete-event engine.
test/java/simulation/examples/BirthdayCollisionSimulationTest.java New unit tests validating input checks and probabilistic estimate behavior with seeded RNG.
README.md Documents running the new example and adjusts suggested first tasks accordingly.
.gitignore Adds macOS .DS_Store ignore entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor Author

@jody jody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual cleanup of AI generated simulation model for birthday collision problem

@jody jody requested a review from Copilot May 2, 2026 21:52
@jody jody merged commit 306e527 into main May 2, 2026
4 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build.xml
Comment on lines +271 to +276
output="html"
outputFile="${reports.dir}/spotbugs.html"
effort="max"
reportLevel="low"
reportLevel="medium"
jvmargs="-Xmx512m"
failOnError="true"
failOnError="false"
Comment thread build.xml
Comment on lines +274 to +276
reportLevel="medium"
jvmargs="-Xmx512m"
failOnError="true"
failOnError="false"
* @param seed specific seed value for random source of random birthdays
* @throws IllegalArgumentException if {@code groupSize} or {@code trialCount}
* is less than one
* @throws NullPointerException if {@code random} is {@code null}
new BirthdayCollisionSimulation(23, 10_000, 2026L);

simulation.run();
System.out.println(simulation.getEstimatedProbability());
@jody jody deleted the birthday-collision-example branch May 2, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants