MathGroup Archive 2006

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

Search the Archive

Re: RandomList and pure function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70889] Re: RandomList and pure function
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Mon, 30 Oct 2006 05:33:41 -0500 (EST)
  • References: <ei18or$8n7$1@smc.vnet.net>

First your list of pseudorandom numbers between 0 and 1

n = 100;
lis = RandomReal[{0, 1}, {n, 2}];

And here is three ways to get what you search for

sol1 = (#1[[1]] + 2*#1[[2]] & ) /@ lis;

sol2 = lis /. {x_Real, y_Real} -> x + 2*y;

sol3 = Apply[#1 + 2*#2 & , lis, 1];

(*Check*)

sol1 == sol2 == sol3
True

Regards
Dimitris


  • Prev by Date: Re: Simultaneous ODEs
  • Next by Date: Re: RandomList and pure function
  • Previous by thread: RandomList and pure function
  • Next by thread: Re: RandomList and pure function