MathGroup Archive 2002

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

Search the Archive

Re: [Newbie questions] function composition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38095] Re: [mg38050] [Newbie questions] function composition
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Tue, 3 Dec 2002 04:30:25 -0500 (EST)
  • References: <200211281907.OAA23956@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Your first problem I don't understand. As for the second, this may give you
a taste of Mathematica's powers:

In[1]:=
<<DiscreteMath`Combinatorica`

In[2]:=
KSubsets[{a, b, c}, 2] /. {x_, y_} -> {x -> 0, y -> 0}
Out[2]=
{{a -> 0, b -> 0}, {a -> 0, c -> 0}, {b -> 0, c -> 0}}

Tomas Garza
Mexico City
----- Original Message -----
From: "Francois Bernard Lauze" <francois at itu.dk>
To: mathgroup at smc.vnet.net
Subject: [mg38095] [mg38050] [Newbie questions] function composition


> Hi,
>
> Hope I won't be too imprecise, I just started with mathematica
> last Friday.
> 1)
> I want to define a function, say f, with among others the following
property
> f[f[a,b,c],d,e] should be evaluated as f[f[a,b,1/2],b,1/2] in case
> b = d and c = d = 1
>
>
> 2) from a list, say {a,b,c}, I would like to generate
> {{b->0,c->0},{a->0,c->0},{a->0,b->0}
> I guess I have understood the iterative way of doing that,
> but what about a more functionqal form?
>
> Thanks a lot,
> Francois
>
> --
> Francois Lauze
> The IT University of Copenhagen, Glentevej 67
> 2400 Kbh NV, Denmark
> Tel (45) 38 16 89 29
>
>
>




  • Prev by Date: AddArrow
  • Next by Date: Re: Producing ticks on left axis with axis labels
  • Previous by thread: RE: AddArrow
  • Next by thread: Re: [Newbie questions] function composition