What is Algorithm: Definition and 721 Discussions

In mathematics and computer science, an algorithm ( (listen)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation. Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks. In contrast, a heuristic is a technique used in problem solving that uses practical methods and/or various estimates in order to produce solutions that may not be optimal but are sufficient given the circumstances. As an effective method, an algorithm can be expressed within a finite amount of space and time, and in a well-defined formal language for calculating a function. Starting from an initial state and initial input (perhaps empty), the instructions describe a computation that, when executed, proceeds through a finite number of well-defined successive states, eventually producing "output" and terminating at a final ending state. The transition from one state to the next is not necessarily deterministic; some algorithms, known as randomized algorithms, incorporate random input.The concept of algorithm has existed since antiquity. Arithmetic algorithms, such as a division algorithm, were used by ancient Babylonian mathematicians c. 2500 BC and Egyptian mathematicians c. 1550 BC. Greek mathematicians later used algorithms in 240 BC in the sieve of Eratosthenes for finding prime numbers, and the Euclidean algorithm for finding the greatest common divisor of two numbers. Arabic mathematicians such as al-Kindi in the 9th century used cryptographic algorithms for code-breaking, based on frequency analysis.The word algorithm itself is derived from the name of the 9th-century mathematician Muḥammad ibn Mūsā al-Khwārizmī, whose nisba (identifying him as from Khwarazm) was Latinized as Algoritmi. A partial formalization of the modern concept of algorithm began with attempts to solve the Entscheidungsproblem (decision problem) posed by David Hilbert in 1928. Later formalizations were framed as attempts to define "effective calculability" or "effective method". Those formalizations included the Gödel–Herbrand–Kleene recursive functions of 1930, 1934 and 1935, Alonzo Church's lambda calculus of 1936, Emil Post's Formulation 1 of 1936, and Alan Turing's Turing machines of 1936–37 and 1939.

View More On Wikipedia.org
  1. E

    Many-Body Numeric Integration Algorithm

    That is to say, how does one go about it for a non-separable partial differential equation? Let me preface by saying that I am not asking for an answer of perturbation theory, variational theory, mean-field theory, or some sort of self-consistent guess-and-check method (i.e., coupled...
  2. A

    Improving a Galaxy Generation algorithm

    Hello there, I'm developing a 4x Space Opera game. For my galaxy generation algorithm I'm using an improved version of the "Accrete" one, which I'm sure some of you may have heard. It generates fairly believable planets. Rocky ones are placed in the inner system, while gas giants in the outer...
  3. I

    How to accelerate the SVD algorithm?

    I've written a program in c language in terms of the GR SVD algorithm. To my dispointment,its performance is worse than the svd of matlab. I wish to get to know which algorithm the MATLAB used. Who may tell me? Thanks.
  4. S

    Testing a Lanczos (tridiagonalization) algorithm

    So I implemented a tridiagonalization algorithm, however I don't know if the result that I am receiving is accurate. Does anyone know of an easy way of testing this? I suppose it is possible to scour around for code, but it would be difficult to find matching code. So if anyone knows anything...
  5. D

    Grover's algorithm on entangled states

    If you run Grover's algorithm on the first qubit of any of the Bell states, does it destroy the entanglement? If not, wouldn't it be a way to communicate faster than light?
  6. C

    Regarding Floyd's cycle-finding algorithm

    Well I understand what is happening - the tortoise moving 1 step, and the hare moving 2 steps and finally coinciding at a point. But I want a mathematical proof of this - ie; when you have 2 counters moving in a cycle, one going 1 step, the other 2 steps, then they finally meet at a point.
  7. A

    Help in Explaining POSIT algorithm (3D maths)

    Hello Everyone, This is my fisrt post! I have been suggested that this forum's members may be able to help me, this thread was orginially posted in another forum, they have re-directed me towards this community! : {original post} Hi guys, I've been doing some background hobby...
  8. C

    C/C++ Solving Error in C++ Digit Algorithm Program

    I wrote a program to find the number of digits of an integer, but I always get the wrong result. Could someone point out the error? Here's the source code: #include <iostream> #include <cmath> using namespace std; int main() { int i=53443; cout<<log(i); return 0; }...
  9. R

    C/C++ How to Create a Spiralling Algorithm in C++ for Printing Patterns

    Hey, I got an assignment to write and algorithm in C++ to print this pattern: 35 34 33 32 31 30 16 15 14 13 12 29 17 04 03 02 11 28 18 05 00 01 10 27 19 06 07 08 09 26 20 21 22 23 24 25 As you...
  10. H

    Odd Graph Algorithm assignment

    I've got a small assignment to do on graphs but it's a bit frustrating that no standard algoritms such as Dijkstra, Bellman-Ford, etc. can be used or at least I don't know how could they help. Given a graph one is to find shortest path through N points. That's it. Starting point can be...
  11. B

    Pseudo random number algorithm

    I'm trying to figure out this little problem. I'm trying to figure out which algorithm is being used.I know the set of numbers is being used to generate the 5 digit number. I believe a Pseudo random number generator algorithm is being used. I know the set of number are being used as the seed...
  12. M

    Proof of Multiplicative Inverses of Coprime Numbers via Euclidean Algorithm

    Hi I am currently studying Information Theory. Could I please have anyone's ideas on the following question: Using the Euclidean algorithm, show that coprime numbers always have multiplicative inverses modulo each other. I tried the following proof, using Fermat's little theorem, let me...
  13. H

    Complexity of divide and conquer algorithm?

    Let's say I have some algorithm with complexity O(n^k) for some constant k. and let's say it runs in some time T. Now, I want to implement a divide and conquer approach for this algorithm, by dividing the problem in half each recursion. So basically, the first time i run my algorithm it will run...
  14. A

    Reliabilty of complex systems using F-V algorithm for approximation

    For a system with minimum cut set (C1,C2,C3),(C4,C5,C6) and (C4,C5,C7), Using the F-V algorithm, calculate the first and second order approximations given P[C1] =P[C1] = P[C2] =0.107, P[C3] =0.168,P[C4] =P[C5] =0.0478,P[C6] =0.0921,P[C7] =0.102 Answers, Ist order= 0.002366919, 2nd...
  15. P

    MATLAB Saving Matrices Generated by Matlab Algorithm

    Hi I have a question, I have to save to file the matrixs generated by an algoritm in Matlab. So i was wondering if is it possibile and how, to use in the filename a variable of the algoritm. Let's say "i" is the counter of my cicle and i would like to save the matrix generated at every cicle...
  16. D

    Proving a Division Algorithm for Real Numbers?

    How might I prove a Division Algorithm for the Real numbers? That is to say, if x, \alpha \in \mathbb{R}, then x=k \alpha + \delta for some k \in \mathbb{Z}, \delta \in \mathbb{R} with 0 \leq \delta < \alpha where k, \delta are unique.
  17. V

    Integer Factorization Algorithm

    I am posting an integer factorization algorithm that I have developed. I am hoping for feedback on any obvious flaws that I might have missed before writing a computer programme to test it out. Thanks in advance Visu
  18. I

    Top Algorithm Design Book Recommendations for Non-CS Programmers

    can someone recommend a good algorithm design book? like the end all be all of algo design? so that i don't have to read anything else cause I'm not a cs major just someone who wants to be decent at programming
  19. R

    Expectation for # Exchanges (Quicksort Algorithm)

    Hi I am reading Hoare's original paper where he derives the complexity of quicksort. I am trying to figure how he derives the expectation for the number of exchanges (sorry if this is a very CS-specific question): \frac{(N-r-1)(r-1)}{N} \frac{N}{6}+\frac{5}{6N} I can't see...
  20. J

    Shortest Path from Nodes C to F using Dijkstra's Algorithm

    Hi The purpose of this question is to find the shortest path from nodes c to f. I have attached the question using the below headings: Homework Statement An image showing a graph can be seen in the attachment Homework Equations The Attempt at a Solution A table can be...
  21. B

    Modular Algorithm for Solving Equations with Unknowns Modulo 100

    how can i solve this problem? [ x1= a (mod 100) , a= 20 (mod 37) ] [ x2= b (mod 100) , b= 15 (mod 37) ] [ x3= c (mod 100) , c= 18 (mod 37) ] must be ; x2= a.k + y (mod100) and x3= b.k + y (mod100) i need find b and c.. thank you best regards..
  22. S

    How Do You Calculate a(t+dt) Using the Velocity Verlet Algorithm?

    Homework Statement I am going to use the velocity verlet algorithm to simulate the position, velocity and acceleration at time t of some particle. Homework Equations We got the Langevin equation: a(t) = -v(t)/tau - U'(x) / m + F_f(t) / m Where tau is the mass divided by the friction...
  23. M

    Euclid's Algorithm Homework: Stuck & Need Help

    Homework Statement http://aycu33.webshots.com/image/44152/2001827062284448769_rs.jpgThe Attempt at a Solution pretty stuck...
  24. S

    MATLAB Finding Primes using Algorithm in MATLAB

    Hi all, i understand the following however i don't know how to put this on matlab. any help or hints will be very appreciated. The following algorithm enables us to identify the prime number up to a given integer N, by eliminating all non-primes in that interval. It starts from a lower end...
  25. P

    Maze generation algorithm for specified parts

    I am an undergraduate student studying mechanical engineering. We are doing a project called the labyrinth cutter, we're constructing a piece of artwork consisting of a a gantry connected to a cutter head. The cutter is supposed to cut out a labyrinth to a piece of music. I decided to use the...
  26. H

    Data Structures and Algorithm Analysis

    Has anyone here taken this class before? I've been in this class for two weeks, and I still can't get a feel for how difficult or time consuming it may be. My instructor keeps mentioning discrete mathematics (which I haven't taken), although it wasn't a prerequisite for the course. Additionally...
  27. B

    Estimating Pi with Twister Algorithm & Monte Carlo Simulation

    okay new problem here. I am doing a Monte Carlo simulation to estimate pi. The question deals with throwing darts randomly at a board with a radius 1 with a square inscribed in it. I have done a script that randomly selected a number b/w -1 and 1. Then I was supposed to generate the results of...
  28. S

    Fast Algorithm for Determining Path Existence in a Graph?

    Is there an algorithm which is O(1) or O(log n) (basically a very fast algorithm) which can tell whether there is a path from a node A to a node B in a graph? Thanks
  29. E

    The limit of a factoring algorithm

    Hi Ho! It is easy to observe that to get all factors of an integer n, one does not need to try whether a divides n for 1 < a < n. But, rather using the following observation: Suppose n is 24, then 24 / 1 = 24 24 / 2 = 12 24 / 3 = 8 24 / 4 = 6 -------------(!) 24 / 6 = 4 24 / 8...
  30. P

    Levenberg-Marquadt Algorithm (GSL implementation)

    Hello there, I have to fit a one term exponential curve: y = a*exp(-b*t), and I have to implement the fitting procedure in a C program. Some days ago I discovered the GSL (GNU Scientific Library), and I told myself better later than never ;-) When reading the GSL documentation and the...
  31. M

    Developing an Algorithm for Calculating Range of Oerlikon 20 mm Auto-Cannon

    I've been assigned a relatively funky physics project, and the process of writing the algorithm for said project has completely stumped me. I have chosen to research the Oerlikon 20 mm auto-cannon, and have done all of my research and am at the point where I am supposed to write an...
  32. M

    How Do I Design an Algorithm to Convert Height and Weight Measurements?

    Homework Statement The assignment was to design an algorithm that asks for a user's height in feet and inches and their weight in pounds. The output of user's height and weight is suppose to be the user's height in meters and the user's weight in kilos. So I'm basically just suppose to convert...
  33. michael879

    Solving Shor's Algorithm to Factor 15: Results & Analysis

    hey I have a quick question about this. I was trying to understand the QFT operator, so I manually used shor's algorithm to factor 15. I used 2 for the random number. My results seem a bit weird tho. below are the probabilities of observing each number (the correct answer is 4, since the...
  34. Z

    Simplify Decimal to Radical Decimal to Radical Algorithm

    decimal to radical algorithm? does anyone know if there is a method of writing a decimal number in its simplified radical form?? I really would like to know if there is
  35. C

    Deterministic time/space for an algorithm?

    can someone point me to some resources to help find deterministic time and space for algorithms? Is there any software I can download which will help me determine these? Also is there any software which will help me come up with a growth function? Perhaps plotting data etc.
  36. D

    Problem with summation algorithm

    Hi there, I'm trying to right a program for class that 1st assigns random single precission floats from 0 to 1 to the elements 1-d array and then sums them up. Next I'm supposed to compare to this thing called the Kahan summation algorithm for different values of N (array size) using the...
  37. michael879

    Understand Shor's Algorithm & Quantum Fourier Transform

    hey, from what I've read here: http://www.quantiki.org/wiki/index.php/Shor%27s_Algorithm , I understand most of the algorithm. The one thing that I don't get is what the quantum Fourier transform does to the input register. Can someone either explain how this works or what exactly it does?
  38. michael879

    Why is the brute force factoring algorithm exponential time?

    ok so I thought of this factoring algorithm, and I did some quick analysis on it (attached picture, time is in seconds * 5). It appears to be polynomial. However, when I see the basic brute force factoring algorithm I think that's also polynomial. So before I get excited over nothing. Can...
  39. Math Is Hard

    Perceptron learning algorithm?

    Have you ever written a perceptron learning algorithm? http://en.wikipedia.org/wiki/Perceptron Which language did you use? Would it be overly complicated to try to write it in C++ (compared with, say, MATLAB)?
  40. A

    Generic algorithm for probability any propositional formula

    Ciao all, Is there a generic algorithm to compile the probability P(A) of any propositional formula A (provided that we have only the probability of each atoms constituting A)? For example, we have that A= a1 and not (a2 and a3 and ( not a4 and not a5 and not a6 ..) , or any other...
  41. C

    Guessing Number-Generating Algorithm

    Hey everyone. Before I get started on the actual problem, here's a quick background story: Last year my math teacher gave out passwords to check grades online. They were constructed in the following manner - 1st initial, 2nd initial, random 1 digit number. The students in the class...
  42. L

    How to Convert Between Julian Day and Gregorian Date?

    Hi guys, I have another weak problem here if you would care to help, please. I am trying to convert between the julian day and the gregorian date, and I found a eally good website:http://www.ortelius.de/kalender/calc_en.php The only problem is that when I run into the centennial cycle...
  43. S

    Nearest neighbor and cheapest link algorithm

    Homework Statement I need to calculate the relative error of the nearest neighbor algorithm. The book says it is the difference between the worst and nearest neighbor solution to the nearest neighbor solution. Does the mean that for example I have CITY A, find the fastest way to back to city...
  44. N

    Diagonalization Algorithm for Large Matrices: Any Suggestions?

    Does anyone here know of any fast algorithms to diagonize large, symmetric matrices, that are mostly zeros? (by large I mean 300x300 up to several million by several million)
  45. Q

    Ultra-lossless compression algorithm

    About a year ago I came up with an idea for a compression algorithm which could potentially compress any type of data (pictures, movies, text, ect) with equal ability, and could potentially compress it to 1/1000 or less of its original size. It is such a simple idea that I am sure that if it...
  46. C

    Genetic Replicative Algorithm and Administration

    if people in administration were educated and understood the genetic replicative algorithm/game theory as it applied to all life, would this knowledge result in an means of administration that would mean better quality of life for all people? Or would there be some counter-intuitive effect which...
  47. A

    Converting an algorithm into an equation

    Hello. I've got a simply ballistics program with a very simply algorithm to deal with air friction. However, I am trying to find a mathematical forumula equivalent. Here is the algorithm: G = accel due to gravity (universal constant) F = projectile air friction factor (constant for a given...
  48. H

    Noise handling algorithm in 8 wire touch screen

    Noise handling algorithm in 8 wire touch screen here's how a touch screen work http://focus.ti.com/lit/an/slaa298/slaa298.pdfProblem: when the touch pen is stationary on a point and reading ADC values from a touch screen using the micro controller, the ADC values are never the same eg, 1st...
  49. P

    Binary Jacobi Symbol Algorithm: Add, Subtract & Shift

    Jacobi Symbol - Binary NOTE: if its past 8:30 AM Eastern Time, don't worry about it. thanks for the consideration The Question: Exercise 13.1. Develop a “binary” Jacobi symbol algorithm, that is, one that uses only addition, subtractions, and “shift” operations, analogous to the binary...
  50. Z

    Algorithm Flow Chart: Create Easily & Automatically

    Algorithm flow chart?? I don't know if the exact word is flow chart, It's a direct translation from a french word, it's something that you represent an algorithm with bunch of circles, rectangles, parallelograms, and Rhombus. Anyone know what I'm talking about ? in case someone does, is there...
Back
Top