Computer Algorithm

Consider how you use a computer in a typical day. For example, you start working on a report, and once you have completed a paragraph, you perform a spell check. You open up a spread sheet application to do some financial projections to see if you can afford a new car loan. You use a web browser to search online for a kind of car you want to buy.
You may not think about this very consciously, but all of these operations performed by your computer consist of algorithms. An algorithm is a well-defined procedure that allows a computer to solve a problem. Another way to describe an algorithm is a sequence of unambiguous instructions. The use of the term 'unambiguous' indicates that there is no room for subjective interpretation. Every time you ask your computer to carry out the same algorithm, it will do it in exactly the same manner with the exact same result.
Consider the earlier examples again. Spell checking uses algorithms. Financial calculations use algorithms. A search engine uses algorithms. In fact, it is difficult to think of a task performed by your computer that does not use algorithms.
A very simple example of an algorithm would be to find the largest number in an unsorted list of numbers. If you were given a list of five different numbers, you would have this figured out in no time, no computer needed. Now, how about five million different numbers? Clearly, you are going to need a computer to do this, and a computer needs an algorithm.
Root Finding Algorithm
A number x, such that f(x) = 0, is a root or a zero of the function. Solving an equation, f(x) = g(x), is the same as finding the roots of the function h(x) = f(x) - g(x).
The algorithm for the approximate zero of f(x) is xn+1 = xn - f(xn ) / f'( xn ) .
Starting with n = 1, you can get x2. Use x2 to get x3, and so on, recursively. The iteration stops when a fixed point (up to the desired precision) is reached, that is when the newly computed value is sufficiently close to the preceding ones. In the limit, as n goes to infinity, an infinite number of iterations, xn, approaches the zero of the function. This is a recursive formula that needs to be started with a reasonable initial guess. The function also needs to have a non-zero derivative. This method is called Newton's method or the Newton - Raphson method of root finding. Replacing the derivative in Newton's method with a finite difference, we get the secant method. This method does not require the computation (nor the existence) of a derivative, but the price is slower convergence.
There is formulate methods which are agnostic to the functional form
- Trial and error method
- Bisection method
- Algorithm convergence
- False position (regula falsi) method
- Secant method
- Newton-Raphson
- Ridders’ method
- Root finding algorithms gotchas
- MATLAB’s root finding built-in command
If an algorithm diverges with the suggested initial bracket: indicate so, appropriately modify the bracket, and show the modified bracket in the above table as well. Make your conclusions about speed and robustness of the methods.
American Journal of Computer Science and Information Technology is committed to upholding the highest standards of publication ethics and takes all possible measures against any publication malpractices.
You can send your manuscript at https://www.imedpub.com/submissions/american-computer-science-information-technology.html
Media Contact:
Lina James
Managing Editor
Mail Id: computersci@scholarlypub.com
American Journal of Computer Science and Engineering Survey
Whatsapp number: + 1-504-608-2390