Re: conditionals on lists
- To: mathgroup at smc.vnet.net
- Subject: [mg79111] Re: [mg79088] conditionals on lists
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Thu, 19 Jul 2007 03:23:45 -0400 (EDT)
- References: <200707180657.CAA04493@smc.vnet.net>
On Jul 18, 2007, at 2:57 AM, mausgeo at aol.com wrote: > I am trying to run a simulation of a roulette game and I have created > a list of 1's and -1's to represent wins and losses. Using the Split > command I can get ordered pairs with the first coordinate being either > 1 or -1 and the second coordinate being the number of successive > entries. I am having trouble applying a conditional to this new list > as I would like to perform a different function depending on the first > coordinate of the ordered pair. How do I apply a conditional to a list > of ordered pairs? You're question is unclear, do you mean something like If[#1>#2,#1,#2]&@@@{{1,5},{-1,3}} ? Regards, Ssezi
- References:
- conditionals on lists
- From: mausgeo@aol.com
- conditionals on lists