Re: Domains
- To: mathgroup at smc.vnet.net
- Subject: [mg85341] Re: Domains
- From: Szabolcs <szhorvat at gmail.com>
- Date: Wed, 6 Feb 2008 06:37:20 -0500 (EST)
- References: <foavks$hn3$1@smc.vnet.net>
On Feb 6, 1:39 am, Akki <lodhaakhi... at gmail.com> wrote: > Hi, > > How does one create a domain for a variable in Mathematica ? > > For e.g. x is a variable and I would like to create a domain for x > consisting of 3, 5, 7 only. > i.e. dom = {3,5,7} then use the condition \Element[x,dom] Hi, If you would like to use this variable in functions like Reduce, you could try the expression (x==3 || x==5 || x==7) (or generating this automatically from the list {3, 5, 7}: Or@@(x==#& /@ {3,5,7}) ). Szabolcs