Created
April 25, 2022 15:33
-
-
Save audhiaprilliant/2748c9638f0c6c7d27916024cbe50756 to your computer and use it in GitHub Desktop.
Simulation of Monty Hall Problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Probability of winning the game (stick in the door) | |
| plotnine.options.figure_size = (10, 4.8) | |
| ( | |
| ggplot( | |
| data = df_stick | |
| )+ | |
| geom_line( | |
| aes(x = 'iter', | |
| y = 'win_rate', | |
| group = 1), | |
| size = 1 | |
| )+ | |
| ylim( | |
| [0, 1] | |
| )+ | |
| scale_x_continuous( | |
| breaks = range(0, len(df_stick) + 100, 100) | |
| )+ | |
| labs( | |
| title = 'Probability of winning the game (stick in the door)' | |
| )+ | |
| xlab( | |
| xlab = 'Number of iteration' | |
| )+ | |
| ylab( | |
| ylab = 'Probability' | |
| )+ | |
| theme_minimal() | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment