probability nearly zero! [Regulatives / Guidelines]

posted by Helmut Homepage – Vienna, Austria, 2012-06-16 19:08 (5113 d 05:53 ago) – Posting: # 8761
Views: 15,238

Dear Detlew!

❝ ❝ The randomization (by chance) was:

❝ ❝ RT TR RT TR RT TR RT TR RT TR RT TR (12 runs)


❝ Wow! What is the probability to obtain this by chance?


~1:500 (including the reverse order); try it yourself:
set.seed(16062012)
size       <- 12
sims       <- 1e7
y          <- rep(c(-1,1), size/2)
z          <- rep(c(1,-1), size/2)
alternate  <- 0
for (i in 1:sims) {
  x <- 1
  while (sum(x) != 0) x <- sign(rnorm(size))
  if (all(x == y) | all(x == z)) alternate <- alternate+1
}
cat(paste("‘alternating’ runs:", format(100*alternate/sims, digits=15), "%\n"))


Nine nine nine nine nine nine” wouldn’t pass the algo, since not balanced. :-D

❝ BTW: My randomisation approach was always to randomize by blocks (block size 4 or if not possible by 2). Never obtained such an 'extreme' randomlist.


Chance for block size 4 ~0.9% and for block size 2 ~3%. ;-)

❝ Random freaks may use varying block sizes chosen at random.


Too stupid to code that…

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
23,654 posts in 4,992 threads, 1,571 registered users;
126 visitors (0 registered, 126 guests [including 17 identified bots]).
Forum time: 01:01 CEST (Europe/Vienna)

Always listen to experts.
They’ll tell you what can’t be done and why.
Then do it.    Robert A. Heinlein

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5