MathGroup Archive 1995

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

Search the Archive

Re: Challenge!


wagner at bullwinkle.cs.Colorado.EDU (Dave Wagner) wrote:

>Here's my best shot:
>
>In[167]:=
>    interleave[list1_List, list2_List] :=
>    	#[[Random[Integer, {1,2}]]]& /@ Transpose[{list1, list2}]

An alternative to write this is:

        If[Random[]<.5, First, Last] /@ Transpose[{list1, list2}]



=======================================================     
Jorma Virtamo
VTT Information Technology / Telecommunications
P.O. Box 1202,  FIN-02044 VTT,  Finland
phone:  +358 0 456 5612           
fax:    +358 0 455 0115
email:  jorma.virtamo at vtt.fi
web:    http://www.vtt.fi/tte/
=======================================================



  • Prev by Date: Re: Challenge!
  • Next by Date: Re: how can I do this functionally?
  • Previous by thread: Re: Challenge!
  • Next by thread: Re: Challenge!