• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dice


  • Subject: Re: Dice
  • From: Graff <email@hidden>
  • Date: Tue, 26 Oct 2004 14:28:20 -0400

On Oct 26, 2004, at 1:48 PM, Emmanuel wrote:

At 12:46 PM -0400 10/26/04, Graff wrote:
I just ran it 1000 times and got the following distribution:

1    161
2    167
3    173
4    170
5    169
6    160

std deviation = 5.16

So no, it doesn't seem to be perfect but it's probably good enough for most applications.

Out of curiosity, what would the std deviation be if the random was perfect?

A perfectly even distribution would be for every value to show up the same number of times. In that case the std deviation would be 0.


The standard deviation means that 68.3% of the values were plus or minus so much of the mean of the data set. If you double the standard deviation then 95.4% of the data will be within that deviation, if you triple it then 99.7% will fit within that.

Thus, for the numbers I gave:
68.3% of the data will fit within 161.5 - 171.9 (166.7 ± 5.16)
95.4% of the data will fit within 156.4 - 177.0 (166.7 ±10.32)
99.7% of the data will fit within 151.2 - 182.2 (166.7 ±15.48)

To calculate standard deviation you first get the mean of your data set. You then calculate the deviation of each element from the mean and square it. You sum up these squared deviations and divide them by the number of items in your data set. Finally you take the square root of this number.

So if your numbers are {161, 167, 173, 170, 169, 160}

n = 6
sum = 1000
mean = sum / n = 1000 / 6 = 166.7 (approximately)

deviations are:
(161 - 166.7)^2 =  (-5.7)^2 = 32.5
(167 - 166.7)^2 =  ( 0.3)^2 =  0.1
(173 - 166.7)^2 =  ( 6.3)^2 = 39.7
(170 - 166.7)^2 =  ( 3.3)^2 = 10.9
(169 - 166.7)^2 =  ( 2.3)^2 =  5.3
(160 - 166.7)^2 =  (-6.7)^2 = 28.1

sum of deviations = 116.6

standard deviation = square root (116.6 / 5)
( I used 5 here instead of 6 because it gives you a better standard deviation to use n -1 instead of n)


standard deviation = square root (23.3)

standard deviation = 4.8 (approximately)

Rounding errors account for different value here, I calculated the previous standard deviation in Excel because I'm lazy. :)

You can read more about standard deviation here:
<http://www.med.umkc.edu/tlwbiostats/variability.html>

- Ken

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Dice
      • From: "Adam K. Wuellner" <email@hidden>
    • Re: Dice
      • From: Bill Briggs <email@hidden>
    • Re: Dice
      • From: "John C. Welch" <email@hidden>
    • Re: Dice
      • From: Emmanuel <email@hidden>
    • Statistics [was Re: Dice]
      • From: Graff <email@hidden>
References: 
 >Re:Dice (From: Kevin <email@hidden>)
 >Re: Dice (From: Adrian Milliner <email@hidden>)
 >Re: Dice (From: Robert Poland <email@hidden>)
 >Re: Dice (From: Graff <email@hidden>)
 >Re: Dice (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Dice
  • Next by Date: Statistics [was Re: Dice]
  • Previous by thread: Re: Dice
  • Next by thread: Statistics [was Re: Dice]
  • Index(es):
    • Date
    • Thread