MathGroup Archive 2005

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

Search the Archive

Re: The two dices

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

On 2/21/05 at 3:44 AM, bugaboo12703 at (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:

>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, ....)

>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

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

{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