Question: This is a python problem, after importing the problem2 module, I will type one armed bandit() in the Python shell to test problem2.py. Problem 2

This is a python problem, after importing the problem2 module, I will type one armed bandit() in the Python shell to test problem2.py.

This is a python problem, after importing the problem2 module, I willtype one armed bandit() in the Python shell to test problem2.py. Problem

Problem 2 [20 points | One Armed Bandit. In casinos from Monte Carlo to Las Vegas, one of the most common gambling devices is the slot machine - the "one-armed bandit". A typical such machine has three horizontally aligned wheels that spin around behind a narrow window. Each wheel is marked with the following symbols: CHERRY, LEMON, ORANGE, PLUM, BELL, and BAR. Th For example, the window might show the configuration: e window, however, allows you to see only one symbol on each wheel at a time BELL ORANGE BAR If you put a silver dollar into the slot machine and pull the handle on its side, the wheels spin around and eventually come to a rest in some new configuration. If that configuration matches one among a set of winning patterns printed on the front of the slot machine, you get back some money. If not, you're out a dollar. The following table shows a typical such set of winning patterns along with their associated payoffs pays $2 pays S5 CHERRY CHERRY CHERRY CHERRY CHE ORANGE ORANGE ORANGE/BAR pays $10 PLUM BELL BAR RRYCHERRY pays $7 PLUM BELL BAR PLUM/BAR pays $14 BELL/BARpays $20 BAR pays $250 The notation BELL/BAR means that either a BELL or a BAR can appear in that position, and:a dash means that any symbol at all can appear. Thus, getting a CHERRY in the first position is automatically good for two dollars, no matter what appears on the other wheels. Note that there is never any payoff for the LEMON symbol, even if you happen to line up three of them Write a program that simulates playing the slot machine. You will do this by writing a program with the functions described below (10 points) Implement a function called one armed bandit without any parameters. This function should provide the player with an initial stake of $50 and then let her play repeatedly until the money runs out or the player decides to quit (do this with a while loop). During each round, your program should take away a dollar (since each spin of the wheel costs S1). Then spin the wheel and calculate the resulting payoff, if any (via a Problem 2 [20 points | One Armed Bandit. In casinos from Monte Carlo to Las Vegas, one of the most common gambling devices is the slot machine - the "one-armed bandit". A typical such machine has three horizontally aligned wheels that spin around behind a narrow window. Each wheel is marked with the following symbols: CHERRY, LEMON, ORANGE, PLUM, BELL, and BAR. Th For example, the window might show the configuration: e window, however, allows you to see only one symbol on each wheel at a time BELL ORANGE BAR If you put a silver dollar into the slot machine and pull the handle on its side, the wheels spin around and eventually come to a rest in some new configuration. If that configuration matches one among a set of winning patterns printed on the front of the slot machine, you get back some money. If not, you're out a dollar. The following table shows a typical such set of winning patterns along with their associated payoffs pays $2 pays S5 CHERRY CHERRY CHERRY CHERRY CHE ORANGE ORANGE ORANGE/BAR pays $10 PLUM BELL BAR RRYCHERRY pays $7 PLUM BELL BAR PLUM/BAR pays $14 BELL/BARpays $20 BAR pays $250 The notation BELL/BAR means that either a BELL or a BAR can appear in that position, and:a dash means that any symbol at all can appear. Thus, getting a CHERRY in the first position is automatically good for two dollars, no matter what appears on the other wheels. Note that there is never any payoff for the LEMON symbol, even if you happen to line up three of them Write a program that simulates playing the slot machine. You will do this by writing a program with the functions described below (10 points) Implement a function called one armed bandit without any parameters. This function should provide the player with an initial stake of $50 and then let her play repeatedly until the money runs out or the player decides to quit (do this with a while loop). During each round, your program should take away a dollar (since each spin of the wheel costs S1). Then spin the wheel and calculate the resulting payoff, if any (via a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!