function retval=coinflip(x)
  n=length(x);
  i=floor(n*rand)+1;
  retval=x(i);
endfunction