Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*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 1995

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

Search the Archive

Re: Challenge!

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg948] Re: Challenge!
  • From: jorma.virtamo at vtt.fi (Jorma Virtamo)
  • Date: Wed, 3 May 1995 00:27:32 -0400

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!