
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Information about a university homework assignment from wentworth institute of technology's division of professional and continuing studies, in the comp380 section, focused on data structures i, during the spring 2006 semester. The assignment, named 'poker probabilities', requires students to build a simulation using stacks and classes 'playingcard' and 'carddeck' to analyze poker hand probabilities. Students must calculate the probabilities of 'one pair', 'two pairs', 'three of a kind', and 'straight' categories for 2 million poker hands. The document also includes extra credit assignments, such as simulating a poker game where the user plays against the computer and calculating probabilities for all categories including 'royal flush'.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!
COMP380 Section 71 - Data Structures I - Spring, 2006
Instructor: Bob Goldstein (617) 912- bobg@vision.eri.harvard.edu http://webpages.charter.net/tlgcreations/Courses/index.html http://goldstein.eri.harvard.edu/courses/index.html http://myweb.wit.edu/goldsteinr/Courses/index.html Due Date: April 13, 2006 Hand In: Printout of program code and dialogue of how it runs. Purpose: Build a simulation by working with stacks. Description: Use the classes “PlayingCard” and “CardDeck” to build 2 million poker hands to calculate poker hand probabilities. For each poker hand, start with a freshly shuffled deck. Then pop the top 5 cards off the deck to get one poker hand. You then need to examine the hand to see which of the below categories the hand falls into. Maintain counters for each of the hand types. The tricky part of this assignment is to determine which of the below categories the hand falls into. After the 2 million hands are run, see how your numbers compare with the below numbers that were pulled off the internet. FOR THE MAIN PART OF THE HOMEWORK ASSIGNMENT, ONLY DO THE “One Pair”, “Two Pair”, “Three of a kind” and “Straight” categories. PROBABILITIES OF FIVE-CARD POKER HANDS Hand Number Approx Odds (to 1) Royal Flush Straight flush Four of a kind Full House Flush Straight Three of a kind Two pairs one pair No hand
Extra Credit: