Due: Nov. 6, 2012 CS 580 Fall 2012 Dr. Duric Homework #3 (50p) In your fourth homework you will continue building your poker program. In this installment you will estimate the quality of the cards that a player holds. Since a player can only see the cards she/he holds, and possibly the comunal cards there a several cases that have to be considered. (i) The player has 2 cards and there are no communal cards. (ii) The player has 2 cards and there are 3 communal cards. (iii) The player holds 2 cards and there 4 communal cards. (iv) The player holds 2 cards and there are 5 communal cards. For each of the 4 cases you will create a function to estimate the probability that the player holds a winning hand. The estimated probabilities will be used to determine if the player should continue playing or if she/he should stop (fold). (i) (5p) Function HandRank2: You are given a list of all possible card pairs sorted in the (approximate) order of desirability. [For each pair, 2500 random triples of communal cards were generated and the resulting 5-card hands were compared. These simulated deals were used to determine which card pair was more desirable.] Your function HandRank2 will determine the proportion of possible card pairs that are more desirable than the given pair using this sorted list. (ii) (15p) HandRank5: Given a 2-card hand and 3 communal cards your function will compare the resulting 5-card hand with 1000 random opponent hands. Note that the you need to generate 1000 random pairs using a deck from which the 5 known cards are removed. Your function should return the score corresponding to the number of opponents hands that are better than the 5-card hand your player holds. You can use 0 if two hands are equal. For example, if the function returns 123 that would mean that your player's 5-card hand is ranked 124 against 1000 simulated opponent hands. (iii) (15p) HandRank6: Given a 2-card hand and 4 communal cards your function will first determine the best 5-card hand among the 6 possible hands (removing each of 6 cards results in a different hand). You will then generate 1000 random pairs of the opponent cards and determine the best hand for each pair (again six hands are possible). For each random pair you will determine the best opponent hand. Your function will return the number of the opponent's hands (out of 1000 random hands) that are better than your best 5-card hand. (iv) (15p) HandRank7: Given a 2-card hand and 5 communal cards your function will first determine the best 5-card hand among the 21 possible hands (why are there 21 possible hands?). You will then generate 1000 random pairs of the opponent cards and determine the best hand for each pair (21 hands are possible). For each random pair you will determine the best opponent hand. Your function will return the number of the opponent's hands (out of 1000 random hands) that are better than the best 5-card hand of the player. You can write as many helper functions as you want. If you need a lisp function to compare hands please let me know and I will email an implementation to you. Instructions for submission: ---------------------------- (1) Using script or dribble, you are to capture the output of a Lisp session in which you successfully load and execute your code, showing sufficient testing of your function(s). (2) Send a SINGLE email to nvishnoi@cs.gmu.edu formatted in the following way: - the subject field of the email should read: CS580 HW#3 Duric - the content of the email should be : (a) a cover sheet containing: Your name CS580 Fall 2012 Dr. Duric Homework #3 (A short summary stating whether you were successful, describing any problems, etc.) (b) a commented version of the Lisp code for HW3. Comments at the top should include: Your name CS580 Fall 2012 Dr. Duric Homework #3 (c) a printout of a captured Lisp session involving the execution of the HW3 Lisp code As a safety precaution, always CC yourself when you submit homework this way and keep it around until it has been graded and returned.