- #1
Manchot
- 473
- 4
Hey everyone. I've been looking for a method to find a zero of a certain equation numerically, but I've been having a problem doing so. I guess that I could do some form of transformation on it, but I haven't been successful thus far. Basically, the equation's in the form
[tex]f(x) = \left\{ \begin{array}{rcl}
1 & \mbox{for}
& x \neq a \\ 0 & \mbox{for} & x=a
\end{array}\right.[/tex]
I'd like to be able to solve for a. Now, I do know the interval that a's in: it's between c and d. We also know that a is a positive integer. Now, one idea I had was able to use the floor function to make an "indentation" in the graph.
[tex]g(x) = f(\lfloor{x}\rfloor) + (f(\lfloor{x}\rfloor+1)-f(\lfloor{x}\rfloor))(x-\lfloor{x}\rfloor)[/tex]
Another idea that I had was to try to "flip" half of the graph around by negating it. I could then use the binary search algorithm. Unfortunately, to know which half to flip, I'd have to use a itself, which I don't know.
Is there any sort of transformation that I can do on the function to get it to "behave" smoothly, and allow me to use Newton's method on it (or any other quick approximation) in a computer? Keep in mind that I can only evaluate the function or its derivative, since I'm using numerical methods. Thanks.
[tex]f(x) = \left\{ \begin{array}{rcl}
1 & \mbox{for}
& x \neq a \\ 0 & \mbox{for} & x=a
\end{array}\right.[/tex]
I'd like to be able to solve for a. Now, I do know the interval that a's in: it's between c and d. We also know that a is a positive integer. Now, one idea I had was able to use the floor function to make an "indentation" in the graph.
[tex]g(x) = f(\lfloor{x}\rfloor) + (f(\lfloor{x}\rfloor+1)-f(\lfloor{x}\rfloor))(x-\lfloor{x}\rfloor)[/tex]
Another idea that I had was to try to "flip" half of the graph around by negating it. I could then use the binary search algorithm. Unfortunately, to know which half to flip, I'd have to use a itself, which I don't know.
Is there any sort of transformation that I can do on the function to get it to "behave" smoothly, and allow me to use Newton's method on it (or any other quick approximation) in a computer? Keep in mind that I can only evaluate the function or its derivative, since I'm using numerical methods. Thanks.
Last edited: