[Date Index] [Thread Index] [Author Index]
Re: Number of zeros finite or infinite?
On 1/10/11 at 2:40 AM, icorone at hotmail.com (James) wrote: >I'm working on a program that deals with zeros of functions and >would like to know if the zeros are finite or not. For example, in >the finite case : >testcase1 = Reduce[2*x^2 + 3*x - 1 == 0, x] >and in the infinite case for example, I would obtain something like: >thezeros = Reduce[1 - 4*Sin[z]^2 == 0, z] >Can someone please help me distinguish the two cases so that I can >then process them differently? For example, in pseudo code: In:= finiteZerosQ[x_] := FreeQ[x, C] In:= testcase1 = Reduce[2*x^2 + 3*x - 1 == 0, x]; finiteZerosQ[testcase1] Out= True In:= thezeros = Reduce[1 - 4*Sin[z]^2 == 0, z]; finiteZerosQ[thezeros] Out= False What I am doing is looking to see if the result returned by Reduce has an automatically generated constant which by default is C[n]. Something with a finite number of zeros should not have this constant while something with an infinite number of zeros should have it. Note, this implicitly assumes the default behavior of Reduce and the expression fed to Reduce does not contain C.