Question: Python question Simulating Gombaud Gombaud bet he would roll at least one 6 in 4 rolls of a single die. Later he began betting he
Python question
Simulating Gombaud Gombaud bet he would roll at least one 6 in 4 rolls of a single die. Later he began betting he would roll a pair of sixes in 24 rolls of a pair of dice. Write a function called gombaud that simulates playing Gombaud's game (in a more general sense). gombaud should take the arguments 1. count, the number of dice used in the game 2. sides , the number of sides the dice have 3. rolls, the number of times the "player" is allowed to roll to win gombauds and False if it resulted in a loss. Remember, this function is a simulation. It should work by repeatedly calling dice and checking for a win (rather than calculating the probabilities of winning) Note: because the game is generalized to be played on any type of die, consider a win to be rolling all 1s (rather than rolling all 6s). This change doesn't change the odds of winning the game for six-sided dice and, it will work for any kind of die. So a simulation of Gombaud original game followed by a simulation of his newer game would look like: # roll one 6-sided die 4 times. >>gombaud (1, 6, 4) True # roll two 6-sided dice 24 times gombaud (2, 6, 24) True Note:I got lucky here and won both games, but that won't always be the case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
