MathGroup Archive 2009

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

Search the Archive

Re: problem with EvenQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105952] Re: [mg105923] problem with EvenQ
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 27 Dec 2009 02:27:12 -0500 (EST)
  • Reply-to: hanlonr at cox.net

y /. FindInstance[
   y*2 < 100 && y > 0 && 2*Round[y/2] == y,
   y, Integers, 5] // Sort

{6,10,16,42,44}

y /. FindInstance[
   y*2 < 100 && y > 0 && 2*IntegerPart[y/2] == y,
   y, Integers, 5] // Sort

{6,10,16,42,44}

y /. FindInstance[
   {z == y/2, y*2 < 100, y > 0, Element[z, Integers]},
   {y, z}, Integers, 5] // Sort

{6,10,16,42,44}


Bob Hanlon

---- dvholten <info at dvholten.de> 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




  • Prev by Date: Re: Manipulate Plot command - blank plot
  • Next by Date: reverse the order of replacements in a list of rules
  • Previous by thread: Re: problem with EvenQ
  • Next by thread: Re: problem with EvenQ