MathGroup Archive 2009

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

Search the Archive

Re: Re: problem with EvenQ


One can also do it as follows:

evenQ[x_?NumberQ] := EvenQ[x]

FindInstance[evenQ[x], x, Integers]

 {{x->0}}

Andrzej Kozlowski

On 27 Dec 2009, at 16:26, Murray Eisenberg wrote:

> 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: Re: reverse the order of replacements in a list of rules
  • Next by Date: Re: Best way to do contractions (arbitrary Tables with a Sum)?
  • Previous by thread: Re: problem with EvenQ
  • Next by thread: Re: problem with EvenQ