Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Data Structures I - Poker Probabilities Homework, Wentworth Institute of Technology, Sprin, Assignments of Data Structures and Algorithms

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

Pre 2010

Uploaded on 08/18/2009

koofers-user-wvc-1
koofers-user-wvc-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Wentworth Institute of Technology
Division of Professional and Continuing Studies
COMP380 Section 71 - Data Structures I - Spring, 2006
Homework 10 – Poker Probabilities
Instructor: Bob Goldstein (617) 912-2512
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
4
36
624
3,744
5,108
10,200
54,912
123,552
1,098,240
1,302,540
649,740
72,192
4,164
693
508
254
46
20
1.37
1
Extra Credit:
1. Include the remaining categories (flush, full house, four of a kind, straight flush, and Royal Flush).
Extra, Extra Credit
2. Simulate a poker game where the user plays against the computer.
/app/work/qkd5pt-394936-2765015-homework10-doc.doc 1 11/30/2020 11/30/2020

Partial preview of the text

Download Data Structures I - Poker Probabilities Homework, Wentworth Institute of Technology, Sprin and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Wentworth Institute of Technology

Division of Professional and Continuing Studies

COMP380 Section 71 - Data Structures I - Spring, 2006

Homework 10 – Poker Probabilities

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:

  1. Include the remaining categories (flush, full house, four of a kind, straight flush, and Royal Flush). Extra, Extra Credit
  2. Simulate a poker game where the user plays against the computer. /app/work/qkd5pt-394936-2765015-homework10-doc.doc 1 11/30/2020 11/30/