I was reading about some root-finding algorithms and wondered if there is a way to find functions specifically with n zeros, for example: finding a function (or a set of functions) that has 378 zeros. Is that possible?
Asked
Active
Viewed 136 times
3
-
$f(x)=(x-a)(x-b)(x-c)$ has its zeros at? – egreg Apr 26 '13 at 13:14
-
Consider polynomial functions... – David Mitra Apr 26 '13 at 13:14
-
6$f(x)=0$ if $x \in {1,2,3,..., 378 }$ and $f(x)=1$ otherwise.... – N. S. Apr 26 '13 at 13:28
2 Answers
11
$$f(x)=\prod_{k=1}^{378}(x-k)$$
Brian M. Scott
- 616,228
-
-
1@Gustavo: If $a_1,\dots,a_n$ is any finite set of real numbers, $$f(x)=\prod_{k=1}^n(x-a_k)$$ is a polynomial of degree $n$ whose roots are precisely the numbers $a_1,\dots,a_n$. – Brian M. Scott Apr 26 '13 at 13:17
-
Everytime I think I'm going to ask something mathematically challenging, there comes Brian and answer it in 0,004sec. Haha – Red Banana Apr 26 '13 at 13:21
7
Brian has given the obvious answer, but it occurs to me that there are probably a lot of other ways to answer the question. For example, consider $$f_k(x) = \sin x + \frac xk.$$
Since $-1\le\sin x\le 1$, all the zeroes of this function lie between $-k$ and $k$. In this interval, $\sin x$ has $2\left\lfloor \frac k\pi\right\rfloor+1$ zeroes. Adding the $\frac xk$ term moves those zeroes around, but does not eliminate them.

So by adjusting $k$ suitably, you can find a function in this family with any odd number of zeroes; for even numbers of zeroes use $\cos x + \frac xk$ instead.
MJD
- 65,394
- 39
- 298
- 580