POV-Ray : Newsgroups : povray.off-topic : Interesting dice problem Server Time
6 Sep 2024 01:25:05 EDT (-0400)
  Interesting dice problem (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kevin Wampler
Subject: Re: Interesting dice problem
Date: 14 May 2009 16:15:46
Message: <4a0c7bf2$1@news.povray.org>
Kevin Wampler wrote:
> If you're limited to two players it's a bit trickier, but I think it's 
> still pretty easy to mimic a 1dN roll with the following game:  Both 
> players pick a number between 0 and N-1, then you add the numbers mod N 
> and use the result as the value of the "roll".

Turns out it's easy to extend this to a MdN throw by having each player 
choose a number between 0 and N^M-1, taking the sum mod N^M and then 
using the digits when written in base N as the values for each of the M 
die.  It's also possible to get the same result with somewhat fewer 
moves per player by mapping the result to "bins" in the distribution 
function of the MdN roll.

I think the much more interesting question is weather there's games 
smaller than this which can give the same result.  All the examples I've 
come up with so far rely on the best strategy being uniformly random, 
but if you consider other strategies it might be possible to get a 
simpler game.


Post a reply to this message

From: Warp
Subject: Re: Interesting dice problem
Date: 14 May 2009 17:29:48
Message: <4a0c8d4c@news.povray.org>
Kevin Wampler <wam### [at] uwashingtonedu> wrote:
> Charles C wrote:
> > I think coin tossing between two players has something inherently more efficient
> > than RPS.  Namely with RPS, there's no way to avoid ties where you have to re-do
> > the round.  With coin tossing, it doesn't really matter who calls it - it's
> > called before the toss and there is no tie short of the coin landing on its
> > edge.

> This is true only if you're talking about standard rock-paper-scissors, 
> which Warp isn't.  He's talking about two-player games of the same 
> nature which are allowed to have different rules, and it's pretty easy 
> to construct such a game that doesn't allow for ties.  For instance, 
> both players show zero or one fingers, if the result is even player 1 
> wins, but if the result is odd player 2 wins.  Assuming best play, 
> either player wins with 50% probability and there are no ties.

  There's also one rather big difference between coin-tossing and RPS:
The latter allows generating a random number between 1 and 3 (with even
distribution), while with coin-tossing it's more difficult.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Interesting dice problem
Date: 14 May 2009 17:35:12
Message: <4a0c8e90@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Too busy at the moment to try to deveop the idea further, but if it's 
> acceptable to just throw fingers (i.e., from 0 to 5 fingers), there's your 
> 1d6 in one throw right there.

  The problem with only one person doing it is that the roll is not fair:
If the person "doing the roll" has something to gain from a certain result,
he will obviously be biased and deliberately roll the number he wants.

  The whole idea of rock-paper-scissors between two people is that the
result is fair to both, as neither can affect the outcome. It's purely
random.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Interesting dice problem
Date: 14 May 2009 17:43:46
Message: <4a0c9092@news.povray.org>
Charles C <nomail@nomail> wrote:
> Still ignoring that RPS isn't completely random:  This wouldn't seem very
> efficient to me but it's definitely possible to simulate a die with any number
> of sides playing Rock-Paper-Scissors.  For each player generate a binary number
> based on RPS wins or losses against any other person (opponent or not*).
> Discard the entire set and re-do if the result is zero or exceeds the number of
> die-sides simulated.

  But I think it could be made more efficient by noting that RPS can actually
be used to roll random numbers between 1 and 3...

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: Interesting dice problem
Date: 14 May 2009 18:23:48
Message: <4a0c99f4$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Too busy at the moment to try to deveop the idea further, but if it's 
>> acceptable to just throw fingers (i.e., from 0 to 5 fingers), there's your 
>> 1d6 in one throw right there.
> 
>   The problem with only one person doing it is that the roll is not fair:
> If the person "doing the roll" has something to gain from a certain result,
> he will obviously be biased and deliberately roll the number he wants.

I had meant to imply that the restrictions of the first paragraph apply to 
the second paragraph. So each of two people throw out zero to five fingers, 
you add them and take the result mod 6, to get another 0 to 5.  The RPS 
would just assign 0,1,2 to the three shapes and ignore who "won" the toss.

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: Warp
Subject: Re: Interesting dice problem
Date: 15 May 2009 02:21:31
Message: <4a0d09eb@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> So each of two people throw out zero to five fingers, 
> you add them and take the result mod 6, to get another 0 to 5.

  Adding random numbers doesn't give an even distribution.

-- 
                                                          - Warp


Post a reply to this message

From: Slime
Subject: Re: Interesting dice problem
Date: 15 May 2009 02:42:50
Message: <4a0d0eea$1@news.povray.org>
>  Adding random numbers doesn't give an even distribution.

I think the distribution is even after the modulo. The probabilities of 0 
through 5 are the opposite of the probabilities of 6 through 11, so when you 
treat the 6 as a 0 and the 11 as a 5, it evens out.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Kevin Wampler
Subject: Re: Interesting dice problem
Date: 15 May 2009 03:12:53
Message: <4a0d15f5@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> So each of two people throw out zero to five fingers, 
>> you add them and take the result mod 6, to get another 0 to 5.
> 
>   Adding random numbers doesn't give an even distribution.

Darren is indeed correct here (as you might guess I'd claim, since I 
suggest the same game).  The optimal strategy in this game is for both 
players to play randomly, and thus it gives a number from 0-5 with all 
the properties that you find desirable in RPS.


Post a reply to this message

From: Charles C
Subject: Re: Interesting dice problem
Date: 15 May 2009 03:40:00
Message: <web.4a0d1bc51d068a6acac4259f0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Charles C <nomail@nomail> wrote:
> > Still ignoring that RPS isn't completely random:  This wouldn't seem very
> > efficient to me but it's definitely possible to simulate a die with any number
> > of sides playing Rock-Paper-Scissors.  For each player generate a binary number
> > based on RPS wins or losses against any other person (opponent or not*).
> > Discard the entire set and re-do if the result is zero or exceeds the number of
> > die-sides simulated.
>
>   But I think it could be made more efficient by noting that RPS can actually
> be used to roll random numbers between 1 and 3...
>
> --
>                                                           - Warp

I suppose base 3 would run up the many-sided-die quicker than base 2.  ...Using
those ties to be more efficient.  There's some irony there. :-)

Charles


Post a reply to this message

From: John VanSickle
Subject: Re: Interesting dice problem
Date: 15 May 2009 20:40:49
Message: <4a0e0b91$1@news.povray.org>
Warp wrote:
>   The rock-paper-scissors game between two people can substitute coin-tossing:
> It's played until one of them wins, and that's equivalent to tossing a coin
> to see who wins. (Let's forget about the slight non-randomness of human
> behavior in this context. It's not the point here.)
> 
>   This method of deciding between two things at random between to people
> (or two groups of people, eg. teams) is often used when there's no proper
> equipment available (in this case a coin).
> 
>   Another way of putting it: Two people playing rock-paper-scissors once
> (ie. until one of them wins) is equivalent to rolling a 1d2: If the first
> person wins, it's like rolling a 1, and if the second person wins, it's
> like rolling a 2.
> 
>   This gave me an idea for a small thinking problem:
> 
> - How should two people play rock-paper-scissors in such way that it's
> completely equivalent to rolling a 1d6? Or is it theoretically even
> possible?

Take the first three results from RPS, represented as A or B, and follow 
the rules as given here:

A-A-A:  generate a 1 from a 1d6.
A-A-B:  Continue to play until one player repeats as a winner (including 
the result from the third game just played).  If A wins, the 1d6 result 
is 1.  If B wins, the 1d6 result is 2.
A-B-A:  Continue to play until one player repeats.  If A repeats, the 
1d6 result is 2.  If B repeats, the result is 3.
A-B-B: The 1d6 result is 3.
B-A-A: The 1d6 result is 4.
B-A-B: Continue until one player repeats.  If A repeats, the 1d6 result 
is 4.  If B repeats, the 1d6 result is 5.
B-B-A: Continue until one player repeats.  If A repeats, the 1d6 result 
is 5.  If B repeats, the 1d6 result is 6.
B-B-B:  The 1d6 result is 6.

The theory behind this is that the various ranges of probability from a 
1d6 can be represented as fractions with a radix of 2, giving a lowest 
value of .0000~ (infinitely repeating zeros) .1111~ (infinitely 
repeating ones).  Generate random zeros and ones until the resulting 
fraction definitely falls into one of the ranges in question.

This is easily generalized to 1d10, 1d20, and so on.  1d4 and 1d8 are, 
of course, trivial, ending after a finite number of games.

As for generating multiple dice combinations, the simplest solution is 
to generate separate die rolls and combine them; or, you could calculate 
the different binary representations of the probability ranges for each 
possible sum, and generate the values from one stream of RPS results.

Regards,
John


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.