Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: The two dices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54553] Re: The two dices
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Tue, 22 Feb 2005 04:25:56 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 2/21/05 at 3:44 AM, bugaboo12703 at yahoo.fr (Antoine) wrote:


>I wanted to simulate the throws of two dices and something happened
>I can't explain: (Mathematica 5.0 , the same occurs on Mathematica
>5.1 )

>The following code is OK:

>n=300; 
>theThrows = Table[Random[Integer, {1, 6}]+Random[Integer,{1, 6}], {n}];
>theStats = Table[Count[theThrows, i], {i, 2, 12}]

>the occurences, as n becomes greater and greater, looks like the
>Gaussian curve (sorry for my English)

>Suppose you want your dice function, and that it is defined by

>dice[]:=Random[Integer, {1, 6}]  ( nothing wrong about it, I
>suppose )

>Now the behavior of the following code changes depending on the
>value of n. If n < 250 everything is fine ... hen n >= 250, then
>there is no occurence of odd values. ( the two dices never give 3,
>5, ....)

>n=250; 
>theThrows = Table[dice[] + dice[], {n}]; 
>theStats =Table[Count[theThrows, i], {i, 2, 12}]

>Does a rationnal explanation exists ?  Is it a bug ?

I believe this is a bug and is related to a issue with packed arrays and random number generation which has been previously discussed here since

In[43]:=
<< "Developer`"
In[55]:=
testDice[n_] := Module[
   {theThrows = Table[dice[] + dice[], {n}]}, 
   {Count[theThrows, 5], PackedArrayQ[theThrows]}]
   
In[56]:=
testDice[249]
Out[56]=
{23, False}

In[57]:=
testDice[250]
Out[57]=
{0, True}

But this does bring up another issue.

As far as I know, Wolfram does not publish a list of known bugs. That makes it impossible for any user to determine whether a given bug has been reported or not. It probably isn't useful and certaintly is not efficient for everyone to report the same bug.

So, what is the best course of action here? Report this as a bug? Or simply assume it is something already reported?
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: The two dices
  • Next by Date: Re: Show command trims bitmap edges? (newbie)
  • Previous by thread: Re: The two dices
  • Next by thread: Re: The two dices