Re: Intersection of sets of results
- To: mathgroup at smc.vnet.net
- Subject: [mg37115] Re: Intersection of sets of results
- From: "Steve Luttrell" <luttrell at _removemefirst_westmal.demon.co.uk>
- Date: Thu, 10 Oct 2002 03:20:51 -0400 (EDT)
- References: <ao0tje$gs9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Here is a way of doing what you want (output cells are indented): <<"Algebra`InequalitySolve`" x[n_]:=2331+8 n y[n_]:=-3108-11 n soln=InequalitySolve[{x[n]>=0,y[n]>=0},n] -(2331/8) <= n <= -(3108/11) FullForm[soln] Inequality[Rational[-2331,8],LessEqual,n,LessEqual,Rational[-3108,11]] Range[Apply[Sequence,{Ceiling[soln[[1]]],Floor[soln[[-1]]]}]] {-291, -290, -289, -288, -287, -286, -285, -284, -283} -- Steve Luttrell West Malvern, UK email: luttrell at westmal.demon.co.uk "flip" <flip_alpha at safebunch.com> wrote in message news:ao0tje$gs9$1 at smc.vnet.net... > Hello All, > > I have two equations that I have solved for: > > x[n_] := 2331 + 8 n > y[n_] := -3108 - 11n > > I want to include only solutions which are non-negative, that is x >= 0 and > y >= 0. > > In this example we can do 2331 + 8n > = 0 and solve for n, n >= -291.375 > and -3108 - 11 n >= 0 and solve for n, n <= -282.545 > > So we have -291.375 <= n <= -282.545. > > The "integer solution set here is for n = > {-290, -289, -288, -287, -286, -285, -284, -283}. > > So in this case we have 8 non-negative solutions. > > Given that I can supply x[n] and y[n], how do I go about finding the set n? > > Thank you for any inputs, Flip > > >