s-news
[Top] [All Lists]

Re: Generating a binary series

To: "Gareth Williams" <garethdaviswilliams@hotmail.com>, <s-news@wubios.wustl.edu>
Subject: Re: Generating a binary series
From: "Horace Tso" <Horace.Tso@pgn.com>
Date: Wed, 13 Sep 2006 13:26:54 -0700
Gareth, I asked about a similar question a while back and the code is
simple,

expand.grid(rep(list(0:1), n))

Then I was reminded by a very pragmatic Bill Venables that in the real
world where anything beyond a small n would make your computer very
unhappy.

Horace



>>> "Gareth Williams" <garethdaviswilliams@hotmail.com> 9/13/2006 6:04
AM >>>

Does anyone know how to generate all combinations of a binary sequence
of 
variable size, e.g.
suppose I wanted a binary sequence of length 3, then I have:
000, 001, 010, 011, 100, 101, 110, 111.

Is there an efficient way to generate this when the length is very
large? 
Thanks again for any help.

Best regards,

Gareth

_________________________________________________________________
All-in-one security and maintenance for your PC.  Get a free 90-day
trial!   
http://www.windowsonecare.com/trial.aspx?sc_cid=msn_hotmail

--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>