Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
earl
on Jan 30, 2012
|
parent
|
context
|
favorite
| on:
Set of 5 non-trasitive dice shows some remarkable ...
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: