Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) use the loop : play the game 10000,100000,1000000times seperately. calculate the expected payoff, record excecution time of each round b) use veterization programming: play
a) use the loop : play the game 10000,100000,1000000times seperately. calculate the expected payoff, record excecution time of each round
b) use veterization programming: play the game 10000,100000,1000000times seperately. calculate the expected payoff, record running time eaxh time.
please show a) and b)
the pay off condition is
import random total payoff = 0 for l in range (0, 100000): dice_num= random.randint(1,6) if dice_num>=4 Dayoff-2 else: payoffs-1 expected payoff = total payoff / number of rounds print "expected payoff=", expected_payoff) I File "cipython-input-22 28360466c1ff>", line 12 expected payoff = total payoff / number of rounds SyntaxError: invalid syntax import random total payoff = 0 for l in range (0, 100000): dice_num= random.randint(1,6) if dice_num>=4 Dayoff-2 else: payoffs-1 expected payoff = total payoff / number of rounds print "expected payoff=", expected_payoff) I File "cipython-input-22 28360466c1ff>", line 12 expected payoff = total payoff / number of rounds SyntaxError: invalid syntax if :
num>= 4
payoff = 2
else:
payoff= -1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started