Re: Number of zeros finite or infinite?
- To: mathgroup at smc.vnet.net
- Subject: [mg115435] Re: Number of zeros finite or infinite?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 11 Jan 2011 00:33:45 -0500 (EST)
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.