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. Ƒ

    Comp Sci Solving Twin Primes with a Sieve Algorithm in Fortran

    Homework Statement I have been trying to come up with a program to calculate twin primes using a sieve algorithm in Fortran. So far I have been successful in creating one that finds primes, but I am having difficulty finding one that finds prime twins. If I knew how to do this I could find...
  2. H

    How Does the Euclidean Algorithm Scale with Multiplication Factors?

    Prove that the number of steps of the euclidean algorithm needed to find gcd(km,kn) is exactly the same as the number of steps needed to find gcd(m,n). any help on this would be appreciated. I'm really lost.
  3. O

    An algorithm for numerical double integration over non-rectangular regions.

    is there one that is stable and accurate?
  4. L

    Minimum Spanning Tree - Algorithm

    Homework Statement Suppose a weighted connected graph G = (V,E) has n edges. Describe an algorithm to find a Minimum Spanning Tree of G in O(n) time. Prove the correctness of your answer. (Here n = |V |). Homework Equations I know about DFS, BFS, Prims algorithm The Attempt at a...
  5. H

    Algorithm to find out whether an input is a prime number or not

    Homework Statement 1- write an algorithm to find out whether an input is a prime number or not. 2-write aa program to compute square root by Newton method 3-write an algorithm to show an input is perfect or not. 4- Homework Equations The Attempt at a Solution
  6. V

    Finding an approximation algorithm

    For a class project, I need to make an application that, among other things, can sort students in a class into project teams that takes students' schedules into consideration and groups students with overlapping schedules together. The way I'm storing schedule data is a collection of times...
  7. I

    Java What's wrong with my sorted linked list algorithm? (Java)

    So my algorithm compares a node that needs to be inserted with the current linked list set. it goes from first (which contains the lowest integer) and moves forward until it hits null or when the key trying to be inserted is no longer greater than the nodes being compared to. My input of 23...
  8. M

    Hash Algorithm MD5 calculation

    Hi. I'm studying the cryptography MD5 calculation and have some trouble I'd like to seek help with. I am trying to comprehend the MD5 memo http://www.ietf.org/rfc/rfc1321.txt" and have trouble understanding the calculation. Here is what I comprehend so far. A message is appended with a 1...
  9. H

    Average distance minimization algorithm

    This could be a well-known problem, but I looked around and I don't see anything. Suppose there is a set of points p_1, p_2, ... p_N. For simplicity, assume Euclidean space of arbitrary dimensionality, but this could be any metric space. I need to find a new set q_1, q_2, ... q_n of n...
  10. A

    Metropolis-Monte Carlo Algorithm

    peace upon you every body i spent few minutes searching where to post my topic .. because it's talking about something in computational physics and i found no forum for computational physics or things like that. so if you don't mind opening new forum for computational physics and i can offer...
  11. O

    Help with elastic collision algorithm (need unit vector and velocity)

    hello there. this is as much a comp sci question as a physics question, however the comp sci board looked more like a 'computer technology' board, and didn't have much stuff relevant to physics. even though I'm trying to optimize an algorithm for a very specific need, it requires knowledge of...
  12. O

    Rate of convergence in an algorithm

    Homework Statement Calculate the operating temperature for a flash unit. osf_2= 0.9 P = 750 mmHg f_1=30, A_1=15.9, B_1=2788.5, C_1=-52.3 f_2=50, A_2=16.0, B_2=3096.5, C_2=-53.7 f_3=40, A_3=16.1, B_3=3096.5, C_3=-59.4 T_{guess} = 400K calculate...
  13. O

    Engineering Nodal analysis algorithm applied to a circuit without voltage sources

    Homework Statement I am having some trouble with the nodal analysis algorithm explained in this web page http://www.swarthmore.edu/NatSci/echeeve1/Ref/mna/MNA3.html My electrical circuits knowledge is very basic, and I need to get the equivalent resistance of a circuit for a non related...
  14. P

    Division algorithm and unique Gaussian integers

    Homework Statement Theorem Let \alpha\neq0 and \beta be Gaussian integers. Then there are Gaussian integers \tau and \rho such that \beta=\tau\alpha+\rho and N\left(\rho\right)<N\left(\alpha\right) Problem Show that the Guassian integers \tau and \rho in the Theorem are unique if and only...
  15. R

    Euclidean Algorithm: Solving x-1 = (x^3-x^2+2x-2)-(x+1)(x^2-2x+1)

    Homework Statement The following is a worked example, I circled around the part which I couldn't follow: http://img15.imageshack.us/img15/161/untitleou.jpg Homework Equations The Attempt at a Solution To begin with, I can't understand why they wrote: x-1 =...
  16. J

    Uncovering Hidden Treasures: 3 IIT Students' Primality-Test Algorithm

    This is an old news, but isn't it impressive? 3 IIT undergrad students discovered a newer algorithm for primality-tests-of-an-integer as part of their undergrad student project. That even using some centuries old well known formula and just high school mathematics. Wondering how many such low...
  17. N

    Understanding the Time Complexity of Nested Loops in Algorithms

    Ok, I am brand new at this so I am kind of confused how to figure this out. i \leftarrow n while i >= 1 j \leftarrow i while j <= n <body of the j loop>, needs (1) j \leftarrowj*2 end j while i \leftarrowi-1 end i while I know that with nested...
  18. W

    Why lanczos algorithm is useful for finding the ground state energy?

    i am now reading some materials on lanczos algorithm, one of the ten most important numerical algorithms in the 20th century my puzzle is, why it is useful for finding out the ground state energy? i can not see anything special about the ground state energy in the algorithm
  19. Saladsamurai

    Need Help Developing Algorithm to Decode MathML

    Yeah. I know it is going to be a pain. But I need to do it for work. If you are not familiar with MathML, it is similar to LaTeX. Here is an example: The expression x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}would me represented in MathML as <mrow> <mi>x</mi> <mo>=</mo> <mfrac>...
  20. C

    Simulating relativity in a velocity verlet algorithm

    (Skip to the * mark if you would like to see my question without the background) Hi, I'm trying to write a turn-based computer game which simulates space combat at relativistic speeds, but I'm a beginner at programming and I don't know much physics beyond the high school level. The game...
  21. O

    How Does Choosing Ball Subsets Affect Their Weight Growth in an Algorithm?

    there are n balls of weight 1/n. an opponent choose each time a subset of balls that each one has weight less than 1. then each ball in this set, its weight is multiplied by 1+\frac{1}{|S|} where S is the set of balls that the opponent chose. I need to show that for each choice of subsets...
  22. C

    F4 algorithm for calculating Groebner bases

    Dear all, I have a question concerning Faugere's improved F4 algorithm. You can find it in the attached file faugere_f4.pdf on page 9. In section 2.6 (page 14) an example is given for how the algorithm works. According to the example the second while-loop in the improved F4 algorithm...
  23. I

    A Question About Grover's Algorithm (Quantum Computing)

    Hey guys, After taking linear algebra I decided I could try my hand at learning some introductory QC algorithms, and downloading this introductory paper from arxiv: http://arxiv.org/abs/quant-ph/0301079v1 After mulling through it for a couple of days, I got a little disturbed by their...
  24. J

    Why Does RSA Encryption Return the Original Number?

    Struggling to put a number through this as I keep getting my original number as the encrypted number too. A = 11 p = 3 q = 5 n = pq = 15 z = (p-1)(q-1) = 2*4 = 8 k = co-prime of z = 7 So, A=11 n=15 z=8 (Public key) k=7(Public key) kj = 1 (mod z) 7j = 1 (mod 8) for which I am getting j =...
  25. B

    What exactly is a Parallel Algorithm ?

    What exactly is a "Parallel Algorithm"? I understand what parallel algorithms are intended to do, but I do not know what they are used for.
  26. Q

    Help With Pseudo Coded Algorithm for The Diamond-Square Algorithm

    Homework Statement I am trying to write a pseudocoded recursive algorithm. Algorithm is located @: http://gameprogrammer.com/fractal.html#diamond" I am getting the ending wrong. Homework Equations Do diamond step. Do square step. Reduce random number range. Call myself...
  27. M

    Is There a Problem With No Asymptotically Optimal Algorithm?

    I was just wondering. Is there a computational problem P for which there is no asymptotically least-time solution? In other words: let x be an algorithm which is a solution to P. Denote by T(x), the worst-case runtime of x as a function of its input size. Is it possible that for any...
  28. D

    No Fastest Algorithm: Examples & Explanation

    It has been conjectured that there is no fastest algorithm for multiplication, among other things. Can somebody give me an example of something that provably has no fastest algorithm for?
  29. C

    Simple Hex Multiplication question from AES Algorithm

    I searched around a while on the site to see if I could find a thread that could answer this question and was unable to find one. If this has already been asked before, I apologize. I'm having a problem with something in the AES crypto algorithm...
  30. N

    Smoothing algorithm for times series and slope measurement

    Hi, I'm doing an experiment that gathers one data point approximately each second. I have plotted all the datapoints on a graph. The graph has many tops and bottoms. Now due to the fact that there are so many data points and that I can visualle tell that there are several overal trends: one...
  31. A

    Euclidean algorithm congruences

    1)5x=1(16) is equivalent to x=5(6) is equivalent to x=1(2), x=2(3) <the equal sign here i mean congruence to> i'm a bit confused about the equivalence...how this is so? 2)3k-7n=1, k,n integers by using euclidean algorithm i got k=-2, n=-1. but the answer i got here is k=5, n=2 (the...
  32. K

    Help with design of lift algorithm

    Hi there, i am working on a lift algorithm and i don't know how to implement it. can anyone pls code the program for me in ANSI C? i will be grateful for the favour. regards kautilya
  33. R

    Music Algorithm: Notes to Math?

    I have heard that it is possible to convert music notes into mathematical numbers. To create an algorithm, can you use musical notes, or patterns?
  34. K

    Finding Solutions for x12+x22=1 on Finite Fields Zp using Prime Number Algorithm

    i am sorry guys, the last time i posted this problem it was completely different but this time if we Let x12+x22=1 be a unit circle upon a finite field Zp where p is prime. Is there any algorithm which can give all the possible solutions (x1,x2) an element of Zp*Zp as well as the total number of...
  35. Z

    An small question about RSA algorithm

    on the RSA algorithm http://en.wikipedia.org/wiki/RSA why simply we can not choose e=1 or e=2 ? it would simplify the calculations a lot.
  36. M

    What is the most optimal algorithm for playing a popular guessing game?

    I need to come up with an optimal algorithm for playing a popular guessing game which you might know by a handful of names like Bulls and Cows, Codebreaker, Guess-the-number, Mastermind(without repeating digits though). Here's the general definitions from the wiki page: I have thought about...
  37. K

    Sorting Pages in QuarkXPress: A Constrained Approach

    Hi I have a sorting problem I haven't been able to solve and was hoping someone here could lend some insights. The basic problem is resorting pages in a page layout application (QuarkXPress) where I'm constrained to only the functions Quark supplies for moving pages around in a document...
  38. G

    Grover's Algorithm: is it really a search algorithm

    I'm wondering how it really is useful. The input for the, say 2-qubit, quantum computer that is running Grover's algoritm is |\Psi \rangle = (|1 \rangle + |2 \rangle + |3 \rangle + |4 \rangle) / \sqrt{4} And let us say we're looking the 3rd element in the so-called database. Now, Grover...
  39. M

    The algorithm used by Google Maps?

    I was using at Google Earth, and used it to look at some directions when I noticed that program recommended that I take a right and drive down this road, then take a u-turn and drive past from where I turned originally, when I could've just simply taken a left instead. Does anyone know how...
  40. S

    Algorithm for prime factorization

    Homework Statement One algorithm for finding the prime factorization of a number n is the following: Starting with d = 2, and continuing until n\geqd, try to divide n by d. If n/d, then record d as a (prime) factor and replace n by n/d; otherwise replace d by d + 1. a) When d is recorded...
  41. TheFerruccio

    Need an algorithm for satellite passing through non-penumbral earth shadow

    I have a simulation with a satellite that orbits Earth in 3d. Earth's shadow, for simplification purposes (the satellite is pretty close to earth) is either on or off. There's no light diffraction here. It can be represented as a cylinder with radius ~6378km, and an axis which aligns with...
  42. Pythagorean

    Ethod or algorithm that will always win in chess

    is there a method or algorithm that will always win in chess or can the algorithm/method always be fooled by the choices of the opponent? I know for a while there was a lot of noise over Big Blue, but I'm curious where the subject sits today. In all the games I play (i.e. amateur games)...
  43. S

    C/C++ Problem in c++ in writing an algorithm

    Hello, please help me to find the problem in algorithm. My task is to read from file hotel visitor's info (name/surname, date of arrival, date of departure, room number). Than, to contract similar room numbers and write near the overall number of days in particular room. So everything is good...
  44. S

    Greedy Algorithm for license purchase problem

    Your friends are starting a security company that needs to obtain licenses for n different pieces of cryptographic software. Due to regulations, they can only obtain these licenses at the rate of at most one per month. Each license is currently selling for a price of $100. However, they are...
  45. R

    How can I improve convergence for my complex mathematical model?

    I have a complex mathematical model (about 2000 lines of code) which calculates heat exchanger performance. Using Q=UxAxLMTD I want to iterate the entering temperature until I find that the installed surface satisfies a target duty. At present I 1 guess an entering temperature and from...
  46. S

    Developing an Algorithm for Predicting Robot Position Over Time

    Hello everyone, I am a researcher for a robotic soccer project, and I am developing a guidance algorithm in which I need to be able to predict the position of our robots over time, given only that they have a constant acceleration. These are omnidirectional wheeled robots, which means they...
  47. F

    What is the algorithm for generating numbers based on a given input?

    I read the rules of the site and read the stickies, I hope this is in the right section. I need help figuring out this algorithm, putting a number in generates the corresponding numbers. Sorry if the post is long, I tried to get as much information as possible. I can enter any number that...
  48. G

    Finding the recurrence from an algorithm

    I need some help. I am having a hard time find the recurrence when given an algorithm in c++. The algorithm is a Max search: Its where the program goes through the array from first element to last, or last to first (depends on how you program it) to look for the largest value. In this case it...
  49. S

    Mathematica Help with Prim's Algorithm in Mathematica

    This is my project of Spanning Tree by using Prim's Algorithm , I have to implies this problem (#4, PIC is attached) into Mathematica ( I have version 6 btw). Which we never learned in class. Its my Applied Math class, all we do/did is theorems. We never learned a single thing about this program...
  50. I

    Langevin dynamics random force term generation algorithm

    Hi, Can anyone tell me an algorithm to generate the stationary Gaussian distribution R(t) with \langle R(t) \rangle = 0 (zero mean) \langle R(t) R(t')^{T} \rangle = A \delta(t-t') , A = 2 \gamma k_B T m (autocorrelation) ? What I just wrote is from the Wikipedia article "Langevin...
Back
Top