Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: need to make a special function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68315] Re: need to make a special function
  • From: "Norbert Marxer" <marxer at mec.li>
  • Date: Tue, 1 Aug 2006 06:59:42 -0400 (EDT)
  • References: <eakec7$qvd$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi

The built-in function Tuples does what you want:

     f[n_] := Tuples[{0, 1}, n]

Best Regards
Norbert Marxer
www.mec.li

Nabeel Butt wrote:
> Dear Users,
>         I need help on making a special type of function which has the
> following properties.
>    f[1]={{0},{1}}
>    f[2]={{0,0},{0,1},{1,0},{1,1}}
>    f[3]={{0,0,0},{0,0,1},{0,1,0},{0,1,1},{1,0,0},{1,0,1},{1,1,0},{1,1,1}}
> .............so on you can see the pattern emerging.
>  I need a very efficient code to perform the above evaluation in some
> optimization problem.
>     Thanks in advance.
>      regards,
>         Nabeel
> -- 
> Nabeel Butt
> LUMS,Lahore


  • Prev by Date: XMLElement with sub-elements?
  • Next by Date: Re: Mouse wheel scroll speed
  • Previous by thread: Re: need to make a special function
  • Next by thread: Re: need to make a special function