Compsci 06/101, Spring 2011, Lab 5
By entering your name/net-id below you indicate you are present for Lab 5
to answer these questions and that you were part of
the process that resulted in answers being turned in.
Name: ______________ Net id: _____________ || Name: ______________ Net id: _____________
Name: ______________ Net id: _____________ || Name: ______________ Net id: _____________
Part 0: Thinking About Code
- What does the graph look like? Justify.
- Why write code to generate one roll at a time rather than use a
list?
- Purpose/use of
rc
:
- Purpose/use of
counts
:
Part I: Craps Odds
What are probabilities of winning and losing in craps on the first roll?
win (7 or 11) =
lose (2, 3, or 12) =
Write what you consider the important part of the code that calculates
the probabilities.
Part II: Poker Odds
- What odds did you calculate for each of the following poker hands?
- Pair (over how many dealt hands)?
- Two Pair (code and probability)
- Three of a Kind (code and probability)
- Full House (code and probability)
- Challenge Flush (code and probability)
- Challenge Straight (code and probability)
Part III: Pi Challenge
- Write your Python code for
pi_estimate
below.