Re: Creating a set from two other sets
- To: mathgroup at smc.vnet.net
- Subject: [mg84787] Re: Creating a set from two other sets
- From: "ahallam at iastate.edu" <ahallam at iastate.edu>
- Date: Mon, 14 Jan 2008 03:49:55 -0500 (EST)
- References: <fmcqap$ga0$1@smc.vnet.net> <fmcsg2$htt$1@smc.vnet.net>
On Jan 13, 5:25 am, Peter Breitfeld <ph... at t-online.de> wrote: > ahal... at iastate.edu schrieb: > > > So I would like to create a set AB which consists of all ratios a/b > > where a is an element of {0,1,2,3,4} and b is an element of > > {-1,1,2,3}. Table does not seem to let me use elements of a set as > > compared to sequential lists. > > > Any ideas? > > Do you want something like this: > > z = {0, 1, 2, 3, 4}; n = {-1, 1, 2, 3}; > Union@Flatten@Table[a/b, {a, z}, {b, n}] > > Gruss Peter > -- > ==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-== > Peter Breitfeld, Bad Saulgau, Germany --http://www.pBreitfeld.de This works really well. Thank you. On a related subject, is there an easy way to create either of the sets z and n. What I would like to do is say that x is an element of a set if it is between (including) 0 and 4 and is an integer and so on. Or how to create a set that is all Reals between 4 and 8.