Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Optimization problem for dice game (repost)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109653] Re: Optimization problem for dice game (repost)
  • From: David Bevan <david.bevan at pb.com>
  • Date: Mon, 10 May 2010 06:39:08 -0400 (EDT)

Peter,

I developed a solution similar to Scott's and confirm his value of 23.46 for the expected score when playing the game to maximise the expected score.

To help explain why maximising the expected score does not necessarily produce the optimal strategy against opponents, let's consider the much simpler game in which you throw a dice either once or twice and your score is the value from the last throw. Maximising the expected score is obviously achieved by rethrowing after a 1, 2 or 3.

If you have a large number of opponents, and by optimal is meant maximising the proportion of wins (with all players with equal top scores winning), then winners are very likely to have a score of 6. So the optimal strategy would be to rethrow if you don't throw a 6 initially. (For a smaller number of opponents, there would be intermediate results.)

David %^>


> -----Original Message-----
> From: Scott Hemphill [mailto:hemphill at hemphills.net]
> Sent: 8 May 2010 12:09
> To: mathgroup at smc.vnet.net
> Subject: [mg109623] Re: Optimization problem for dice game (repost)
>
> Peter Sisak <p-kun80 at hotmail.com> writes:
>
> > Hello,
> >
> >   Yes, the goal is to maximize the expected score (in the calculation
> including the non-qualifying hands with score 0). While it is a
> multiplayer game, you do not see other peoples' rolls, therefore you can
> make no strategy adjustments based on that. For this reason, maximizing
> the expected value coincides with maximizing the chance of beating them, I
> would think.
>
> The last statement isn't true, but we can get to that later.
>
> What have you done so far to solve this problem?
>
> Here's what I would do to solve it:
>
> Define a function "score" which takes a list of the final values of the
> dice and returns the score according to the criteria you mention in
> point 5.
>
>   score[h_] :== Total[h] /; MemberQ[x,1] && MemberQ[x,4]
>
>   score[h_] :== 0
>
> Define a function expect which takes a list of held dice plus a list of
> dice just rolled and returns the expected value of the score.  Also
> define a function expect which takes just a list of held dice and
> returns the expected value of the score:
>
>   I use "h" for a list of "held" dice and "r" for a list of rolled
>   dice.
>
>   expect[h_, {}] :== score[h]
>
>   expect[h_, r_] :==
>     maximum of the expected values achieved by adding subsets of r to h
>
>   expect[h_] :==
>    average of the expected values over all the possible rolls of
>    remaining dice
>
> Note that "expect" is defined recursively.  The two argument version of
> "expect" does a maximum over calls to the one argument version, and the
> one argument version does an average over calls to the two argument
> version.
>
> You may also need a way to generate a list of the possible dice rolls:
>
>   rolls[k_] :== Sort /@ Tuples[Range[6],k]
>
> We can talk about optimization/collation when you have an implementation
> that calculates expected values.  I don't find the table to be
> excessively large.  I get
>
>   In[8]:== N[expect[{}]]
>
>   Out[8]== 23.46
>
> Scott
>
> >
> > Peter
> >
> > ----------------------------------------
> >> Date: Thu, 6 May 2010 04:50:48 -0400
> >> From: hemphill at hemphills.net
> >> Subject:  Re: Optimization problem for dice game (repost)
> >> To: mathgroup at smc.vnet.net
> >>
> >> Peter Sisak writes:
> >>
> >>> Hello,
> >>>
> >>> I wish to use Mathematica to determine the best strategy applicable t=
o
> t==
> > he following game:
> >>> 1. The game is played with 6 6-sided fair dice.
> >>> 2. At the beginning of the game, the player rolls all 6 dice at once.
> >>> 3. Each die may then be either a) put in hold (its value gets fixed)
> or ==
> > b) set to be re-rolled. At least one die must be put in hold per roll.
> If a==
> > ll dice are put in hold, there are no further rolls, scoring follows.
> >>> 4. On re-roll, step 3 follows again, i.e. the player decides which of
> th==
> > e resulting dice are put in hold (at least one must be), and re-roll th=
e
> re==
> > st, if there are dice remaining which are not in hold.
> >>> 5. Scoring is executed in the following manner: The hand must contain
> at==
> >  least one "1" and one "4" die. If either of these cannot be found, the=
n
> th==
> > e hand does not qualify for scoring (the score is 0). If it qualifies,
> the ==
> > values of the respective dice are summed; the maximum reachable score i=
s
> th==
> > us 29 (four 6s, one 4 and one 1), while the minimum score where the han=
d
> st==
> > ill qualifies for scoring is thus 9 (one 4 and five 1s).
> >>>
> >>> Since the dice already put in hold do not change, it is trivial that
> the==
> >  following cases must be examined separately:
> >>> a) if there are six dice that are still free, then the entire set of
> pos==
> > sibilities.
> >>> b) if there are five dice that are still free, then 1. the case when
> the==
> >  die put in hold is a "1" 2. the case when the die put in hold is a "4"
> 3. ==
> > the case when the die put in hold is neither "1" nor "4".
> >>> c) if there are less than five dice still free, then 1. the case when
> am==
> > ongst the dice put in hold both "1" and "4" can be found 2. the case
> when a==
> > mongst the dice put in hold "1" can be found but not "4" 3. the case
> when a==
> > mongst the dice put in hold "4" can be found but not "1" 4. the case
> when a==
> > mongst the dice put in hold neither "1" nor "4" can be found.
> >>>
> >>> It would be helpful furthermore if there would be a kind of
> generalisati==
> > on/collation step at the final "best strategy" output, since otherwise,
> the==
> >  number of entries in the list would be huge. Ideas?
> >>
> >> Although the description of the game is clear enough, what you mean by
> >> "best strategy" still needs to be defined. Is the goal just to maximiz=
e
> >> the expected score? If there are other players, is the goal to maximiz=
e
> >> the chances of beating all of them? Do you get to see any of their
> >> rolls?
> >>
> >> Scott
> >> --
> >> Scott Hemphill hemphill at alumni.caltech.edu
> >> "This isn't flying. This is falling, with style." -- Buzz Lightyear
> >>
> > _________________________________________________________________
> > Hotmail: Powerful Free email with security by Microsoft.
> > https://signup.live.com/signup.aspx?id====60969
> >
>
> --
> Scott Hemphill	hemphill at alumni.caltech.edu
> "This isn't flying.  This is falling, with style."  -- Buzz Lightyear
>


  • Prev by Date: Re: RuleDelayed for parsing XML with multiple children
  • Next by Date: Re: How to write reports and books in Mathematica
  • Previous by thread: Re: Optimization problem for dice game (repost)
  • Next by thread: Re: Optimization problem for dice game (repost)