MathGroup Archive 2009

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

Search the Archive

Re: problem with EvenQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105947] Re: [mg105923] problem with EvenQ
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 27 Dec 2009 02:26:15 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200912270006.TAA12116@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

That seems to be an incomplete implementation of FindInstance.  But the 
following will work, albeit with the very unsurprising result shown:

    FindInstance[2 y < 100 && Mod[y, 2] == 0, {y}, Integers]
{{y->0}}

    (* for a less unsurprising result: *)
    FindInstance[2 y < 100 && Mod[y, 2] == 0 && y > 0, {y}, Integers]
{{y->48}}

dvholten wrote:
> Hi folks,
> i puzzled all afternoon, but couldnt get this one solved:
> what is the proper way of using EvenQ[] within FindInstance[] ?
> I cant use it like
>     FindInstance[ y*2 < 100 && EvenQ[y], {y}, Integers ]
> or even
>     FindInstance[ EvenQ[y], {y}, Integers ]
> 
> Actually, the expression used in FindInstance is much more complex,
> but i condensed the problem to be EvenQ[] - i expect some kind of 
> special notation to help here.
> 
> thanks
> dvh
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Best way to do contractions (arbitrary Tables with a Sum)?
  • Next by Date: Re: Figure quality
  • Previous by thread: problem with EvenQ
  • Next by thread: Re: Re: problem with EvenQ