News for hackers. Stuff that matters.
Re:Set of 5 non-trasitive dice shows some remarkable propert... by zdw on Monday January 30, 2012 @03:40PM (#3530556)
Anyone know of a hackable program that will simulate dice rolls that allows for arbitrary sides?

I'm working on a set of dice for rolling passwords, and wanted to simulate it in software - while this is trivial to do if it's already been done I'd like to avoid the effort.

Re:Set of 5 non-trasitive dice shows some remarkable propert... by vessenes on Monday January 30, 2012 @05:12PM (#3530857)
In python you would use random.choice and fill it with your desired faces, e.g. for one of the dice in the awesome video: random.choice([3,3,3,3,3,6])
Re:Set of 5 non-trasitive dice shows some remarkable propert... by earl on Monday January 30, 2012 @05:48PM (#3530959)
Try R:

   > s <- sample(c(3,3,3,3,3,4), size=100, replace=T)
   [...] output elided
   > table(s)
     3  4
    86 14
In order: this samples size times from a vector created by c with 5 3s and one 4 (you could also say c(rep(3,5), 4) with replacement and assigns the sample to a vector called s. table(s) produces counts of unique values.