Skip to content

Instantly share code, notes, and snippets.

@Connicpu
Last active February 7, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Connicpu/ca301213c92e13ebfd53b5bccf2c4bad to your computer and use it in GitHub Desktop.
Save Connicpu/ca301213c92e13ebfd53b5bccf2c4bad to your computer and use it in GitHub Desktop.

MAT340 Coding Project #1

Connor Hilarides

This project is implemented as a simple command line utility, written in Rust, verified to only depend upon kernel32.dll and advapi32.dll (for random numbers).

Usage

When you launch the program, it will display a menu of all of the assignment programs that were implemented. Type a number from 1-4 corresponding to the assignment part and press enter to utilize that part of the program.

Part 1 - Coupons

Simply enter the number of coupon types and it will run 100 trials and tell you the results. This could take a very long time if you type a large number.

Part 2 - Classic Monty Hall

You will play the classic monty hall game. To begin, pick your door by typing 1, 2, or 3 and pressing enter. Then, the host will reveal one of the other two doors that contains a goat, and will ask you again to select a new door. The Host will then reveal what you have won, and will show you what was behind each door.

Part 3 - Extended Monty Hall

In this mode the computer will play an extended version of Monty Hall against itself 100 times. Simply enter the numbers for doors, cars, and reveals. Then it will run 1000 trials of the game and show you the results. Just like in the coupon problem, this could take a very long time if you enter large numbers (> 1000).

Part 4 - Gamber's Ruin

Simply enter the $a, $b, and p values and the computer will run the simulation and show you the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment