MathGroup Archive 2008

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

Search the Archive

Re: Re: Re: Creating a set from two other sets

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84792] Re: [mg84788] Re: [mg84774] Re: Creating a set from two other sets
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Mon, 14 Jan 2008 06:51:35 -0500 (EST)
  • References: <20080113071810.NOTL2.263234.root@eastrmwml24.mgt.cox.net> <200801140850.DAA13987@smc.vnet.net>

It depends, of course, on what you want to do with it, but for some  
purposes the simplest way is to use Interval, e.g.:

  int1 = Interval[{3, 10}];
  int2 = Interval[{5, 12}];
IntervalMemberQ[int1, 4]
True
IntervalMemberQ[int2, 4]
False
IntervalIntersection[int1, int2]
Interval[{5, 10}]

and so on.

Andrzej Kozlowski

On 14 Jan 2008, at 17:50, Arne Hallam wrote:

> This is great.  Thank you.
>
> I did not know how to use table in picking from a set.  I had defined
> the sets a and b so I just did the following.
>
> a={0, 1, 2, 3, 4};
> b={-1, 1, 2, 3};
> SA=Table[x/y,{x,a},{y,b}]
>
>
> Thanks.
>
> Any easy way to create a set with an infinite number of members as in
> 3<=x<=10?
>
> Bob Hanlon wrote:
>> In v6 you can also do this directly with Table
>>
>> Outer[#1/#2 &, {0, 1, 2, 3, 4}, {-1, 1, 2, 3}] ==
>> Table[a/b, {a, {0, 1, 2, 3, 4}}, {b, {-1, 1, 2, 3}}]
>>
>> True
>>
>>
>> Bob Hanlon
>>
>> ---- Steve Luttrell <steve at _removemefirst_luttrell.org.uk> wrote:
>>> In[1]:= Outer[#1/#2&,{0,1,2,3,4},{-1,1,2,3}]
>>> Out[1]= {{0,0,0,0},{-1,1,1/2,1/3},{-2,2,1,2/3},{-3,3,3/2,1}, 
>>> {-4,4,2,4/3}}
>>>
>>> Stephen Luttrell
>>> West Malvern, UK
>>>
>>> <ahallam at iastate.edu> wrote in message news:fmcqap$ga0$1 at smc.vnet.net 
>>> ...
>>>> 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?
>>>>
>>>>
>>
>
> -- 
> with all thy getting get understanding---Proverbs 4:7.
>
> The gentle art of being gentle---of kindness and forgiveness,
> sensitivity and thoughtfulness and generosity and humility and good
> old-fashioned love---have gone out of fashion.  Ironically, everyone  
> is
> demanding their rights, and this demand is so shrill that it destroys
> one of the most basic rights, if we can put it like that: the right,  
> or
> at least the longing and hope, to have a peaceful, stable, secure, and
> caring place to live, to be, to learn, and to flourish---N.T. Wright.
>
> In the wildness of speculation it has been suggested (of course more  
> in
> jest than in earnest),that Europe ought to grow its corn in America,  
> and
> devote itself solely to manufactures and commerce, as the best sort of
> division of the labour of the globe---Thomas Malthus, An Essay on the
> Principle of Population Book III, Chapter XII.
>
> Arne Hallam
> Department of Economics
> 266 Heady Hall
> Iowa State University
> Ames, IA 50011
>
> ahallam at iastate.edu
> Work:	515-294-5861
> FAX: 	515-294-0221
> Home:	515-292-8739
>



  • Prev by Date: Problem trying to Solve for 'theta' ... v6.01
  • Next by Date: Problem with Distribution Functions
  • Previous by thread: Re: Re: Creating a set from two other sets
  • Next by thread: Re: Re: Re: Creating a set from two other sets