subject
Mathematics, 24.01.2020 05:31 daedae96

The game dien is played in the following way: you will be given a die with n sides. you will know the size of n, and can assume that n is a value greater than 1 and less than or equal to 30. you will be given a bit mask vector isbadsiderepresenting the sides of a die that will make you lose. the vector will be of size n, and 1 indexed. (there is no 0 side) you start with 0 dollars. at any time you have the option to roll the die or to quit the game if you decide to roll: and you roll a number not in isbadside, you receive that many dollars. (eg. if you roll the number 2 and 2 is not active -- meaning the second element of the vector is 0 -- in isbadside, then you receive 2 dollars) repeat step 4. and you roll a number in isbadside, then you lose all money obtained in previous rolls and the game ends. if you decide to quit: i. you keep all money gained from previous rolls and the game ends. procedure for this problem, determine an optimal policy for playing the game dien for n sides. you will be givenn and the array isbadside which indicates which sides are bad. as you will see, the optimal policy for this game will depend onyour current bankroll. you can try solving this problem either by creating an mdp of the game (state, action, transition, reward function, and assume a gamma of 1) and then calculating the optimal state-value function or you can plug-in values and solve directly using the bellman equations. what is the expected amount of dollars for this game if you follow an optimal policy? that is, what is the optimal state-value function for the initial state of the game? provide answers for the problems you are given. your answer must be correct to 3 decimal places. examples the following examples can be used to verify your calculation is correct. input: n = 21, isbadside = {1,1,1,1,0,0,0,0,1,0,1,0,1,1,0,1,0, 0,0,1,0}, output: 7.3799 input: n = 22, isbadside = {1,1,1,1,1,1,0,1,0,1,1,0,1,0,1,0,0, 1,0,0,1,0}, output: 6.314 input: n = 6, isbadside = {1,1,1,0,0,0}, output: 2.5833 question: solve the problem for the following inputs: input: n=5, isbadside={0,1,1,1,1,}

ansver
Answers: 1

Another question on Mathematics

question
Mathematics, 21.06.2019 13:30
The number of pages in the u.s. tax code exceeds the number of pages in the king james bible by 18,528. the combined number of pages in the tax code and the bible is 21,472
Answers: 2
question
Mathematics, 21.06.2019 16:50
The parabola y = x² - 4 opens: a.) up b.) down c.) right d.) left
Answers: 1
question
Mathematics, 21.06.2019 17:00
Asif spent $745.10 on 13 new file cabinets for his office. small file cabinets cost $43.50 and large file cabinets cost $65.95. write and solve a system of equations to find the number of small cabinets and large cabinets he purchased. determine if each statement is true or false. 1. he purchased 5 small cabinets. true or false 2. he purchased 7 large cabinets. true or false 3. he spent $527.60 on large cabinets. true or false
Answers: 2
question
Mathematics, 21.06.2019 17:30
Mrs. morton has a special reward system for her class. when all her students behave well, she rewards them by putting 3 marbles into a marble jar. when the jar has 100 or more marbles, the students have a party. right now, the the jar has 24 marbles. how could mrs. morton reward the class in order for the students to have a party?
Answers: 3
You know the right answer?
The game dien is played in the following way: you will be given a die with n sides. you will know t...
Questions
question
History, 29.05.2020 20:03
Questions on the website: 13722360