https://github.com/bmarwell/montecarlo-java8
Some example programs using a monte carlo algorithm and java8 features, like streams.
https://github.com/bmarwell/montecarlo-java8
Last synced: 2 months ago
JSON representation
Some example programs using a monte carlo algorithm and java8 features, like streams.
- Host: GitHub
- URL: https://github.com/bmarwell/montecarlo-java8
- Owner: bmarwell
- License: apache-2.0
- Created: 2016-05-12T18:42:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T03:45:11.000Z (over 1 year ago)
- Last Synced: 2025-04-02T01:11:09.509Z (2 months ago)
- Language: Java
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# montecarlo-java8
Some examples on how to use java8 features (like streams) to solve easy excercies.## pi
"Calculate" (guess) the number pi by random dots. Count, if they are inside a circle.## The Dice Rolling Drinking Game
Reddit: .
Mathematical solution: .### Description
The game starts with 6 empty glasses in a row numbered 1 to 6. You roll a standard die. If the number for the glass is empty, then the glass is filled up. If the number for the glass is full, then you drink that glass. There is a special rule when 5 glasses are full. If you roll the number for the lone empty glass, then the final glass gets filled and you have to drink all 6 glasses. At this point the game ends.From the start of the game, what is the average number of rolls until the game ends?
### Dice Rolling Drinking Game on Youtube
[](http://www.youtube.com/watch?v=Mdqt5EknXBg)