Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Computer Player In this problem you will write a computer player for the word game that you implemented in problem set 2. The computer

image text in transcribed

1. Computer Player In this problem you will write a computer player for the word game that you implemented in problem set 2. The computer player will generate candidate words using Ionte Carlo simulation. You will explore the relationship between the Monte Carlo parameters and the quality of the hints provideod (a) Implement choose word. Using the framework provided, implement the function choose_word which takes a hand and N - the number of Monte Carlo candidates to generate and returns the best scoring word and the score of that word The function should only return valid words. If no valid word can be found, it should return None for the word and 0 for the score. (b) Implement play mc_hand. Using the framework provided, implement the function play_hand using the choose_word function. It should take the hand and N. It should return (1) a list containing the words played and (2) the total score of the sequence of words played (c) Update play_hand. Update the branching logic in play_hand so that if the user enters?" the function choose_word is run with N -100. It should simply print the suggested word and the corresponding score for the user and then allow them to continue play. Make sure you handle the situation where a valid word is not found - this is not an error condition. (d) Implement play_n_mc_hand. using the framework provided, implement play_n_mc_hand. This function takes (1) hand, (2) N, (3) n, where n is the number of times the same hand is played and each word is selected from N candidate Monte Carlo samples. The function should return (1) list of word lists (2) a list of scores. 1. Computer Player In this problem you will write a computer player for the word game that you implemented in problem set 2. The computer player will generate candidate words using Ionte Carlo simulation. You will explore the relationship between the Monte Carlo parameters and the quality of the hints provideod (a) Implement choose word. Using the framework provided, implement the function choose_word which takes a hand and N - the number of Monte Carlo candidates to generate and returns the best scoring word and the score of that word The function should only return valid words. If no valid word can be found, it should return None for the word and 0 for the score. (b) Implement play mc_hand. Using the framework provided, implement the function play_hand using the choose_word function. It should take the hand and N. It should return (1) a list containing the words played and (2) the total score of the sequence of words played (c) Update play_hand. Update the branching logic in play_hand so that if the user enters?" the function choose_word is run with N -100. It should simply print the suggested word and the corresponding score for the user and then allow them to continue play. Make sure you handle the situation where a valid word is not found - this is not an error condition. (d) Implement play_n_mc_hand. using the framework provided, implement play_n_mc_hand. This function takes (1) hand, (2) N, (3) n, where n is the number of times the same hand is played and each word is selected from N candidate Monte Carlo samples. The function should return (1) list of word lists (2) a list of scores

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

explain the concept of strategy formulation

Answered: 1 week ago