The second simulation had some difficulties.  I didn't understand what I
wrote either.  It will follow along shortly.

Linda


-----Original Message-----
From: programming-boun...@jsoftware.com
[mailto:programming-boun...@jsoftware.com] On Behalf Of Linda Alvord
Sent: Monday, December 05, 2011 5:33 PM
To: 'Programming forum'
Subject: Re: [Jprogramming] Many Turkey Rolls - No embargo

For number 1 , divide each of the results by 1 million to get "empirical"
probabilities. You can then compare these with  "theoretical" results.

For number  2  each time you toss the dice, you must get a total for all the
500 dice.  Next you toss the full bucket of dice 199 more times. Make a
frequency distribution of the 200 results.

-----Original Message-----
From: programming-boun...@jsoftware.com
[mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller
Sent: Monday, December 05, 2011 10:03 AM
To: Programming forum
Subject: Re: [Jprogramming] Many Turkey Rolls - No embargo

I am having trouble understanding this one also.

I think I understand 1:
   #/.~/:~+/?2 1e6$6
27773 55724 83930 111049 138508 166122 138982 111263 83609 55632 27408

Or, perhaps:

   (~.,.#/.~)/:~+/1+?2 1e6$6
 2  27704
 3  55158
 4  83565
 5 111238
 6 138938
 7 167140
 8 138898
 9 110833
10  83313
11  55783
12  27430

Item 2, however, seems mysterious.  The platonic solids would have face
counts of 4, 6, 8, 12, 20, but if we had 100 of each in a bucket and toss
the bucket 200 times and total the numbers we will almost always have over
100 unique values in those resulting sums.  This would result in a rather
odd frequency distribution so I'm not at all sure that I understand the
problem correctly.

Furthermore, the additional text seemed to have little relation to these
two items, so I am very confused.

-- 
Raul



On Sun, Dec 4, 2011 at 6:12 PM, Linda Alvord <lindaalv...@verizon.net>wrote:

> Below you will find my version with some changes.  However, I've pointed
> out
> some other versions that were superior to mine.  When I tried to mix them
I
> got all mixed up.  To do these two exercises, you may use any of the
> statements below. Modify their use to:
>
> 1.        Toss a pair of dice a million times and produce a frequency
> distribution of the sums. This a simulation and there will be no graphic
> images of the results.
>
> 2.       Image a large bucket with 100 dice of each of the five Platonic
> Solids. Each die is numbered from 1 with consecutive counting numbers.
> Simulate the result and summarize your results in a frequency distribution
> of the dice are all tosses from the bucket 200 times.
>
>
>
> Here are the expression you may choose from along with J symbols.  Make
> your
> expressions as simple as possible.  (I think Ric, Kip and Henry should
just
> watch and maybe referee if needed.)
>
>
>
>
>
> d1=:'    o    '
>
> d2=:'o       o'
>
> d3=:'o   o   o'
>
> d4=:'o o   o o'
>
> d5=:'o o o o o'
>
> d6=:'o oo oo o'
>
> d=:6 9$d1,d2,d3,d4,d5,d6
>
> dice=:(<"2)3 3$"1 d
>
> dice
>
> s=: 13 :'c=:1+?2 10$y'
>
> toss=: 13 :'(<"2)3 3$"1(<:s y){d'
>
> c
>
> toss 6
>
> c
>
> toss=: 13 :'(<"2)3 3$"1(<:s y){d'
>
> t=: 13 :'+/"2 y'
>
> fd=: [: /:~ ~. ,. [: +/"1 =
>
> dice
>
> toss 6
>
> c
>
> t c
>
> fd t c
>
> toss 6
>
> c
>
> t c
>
> fd t c
>
> toss 4
>
> c
>
> t c
>
> fd t c
>
> assert 0 0 3 3 3 3 = 4!:0 ;:'dice c s t toss fd'
>
>
>
> NB. dice is a graphic image of the faces of a die
>
> NB. c captures the data from an array of random rolls of the dice
>
> NB. s is the shape and s y allows for different dice
>
> NB. t is a list of totals for each of the tosses
>
> NB. fd is a frequency distribution of data in a list
>
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to