Randomisation techniques

7th June 2011

ACT Protocol

Each participant randomly allocated - coin toss

Refresh to review another outcome

<?php
function generateRandArray($f=10, $opts=array(0, 1), &$stats=array())
{
     $res = array();
     $o = count($opts)-1;

     for ($i=0;$i<$f;$i++)
     {
         $j = mt_rand(0, $o);
         $res[] = $opts[$j];
     $stats[$opts[$j]]++;
     }
     arsort($stats);
     return $res;
}


$res = generateRandArray(500, array('WL', 'TX'), $stats);