What is Algorithm: Definition and 722 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

    Exploring the MUSIC Algorithm to Understand its Mathematical Derivations

    I'm studying the MUSIC algorithm in order to implement it in some project of mine, but I have some difficulties understanding the mathematical derivations done in the original Schmidt paper. For those of you who have access to this paper, I'll appreciate your time and help. The author begins...
  2. S

    Simplest algorithm for computing the resultant of a boolean expression?

    hi, let's take something simple, for example: (a>b) && ((b>c) && c>d) || (d > c) Intuitively, it's easy to work out given the values of a, b, c and d and just evaluating the brackets in order of precedence. i.e. Is b > c?? then is c > d Then in addition to the above answer being...
  3. T

    Euchre Tournament random seating algorithm

    Hi All, I'm hoping I can find some help to solve a puzzle that came up last night with friends. I thought I could find a solution but have been out of college too long. We had 3 couples over (8 adults), and wanted to play a single round for each possible pairing of the 8 people. After playing...
  4. D

    Image Median Filtering (Selection Algorithm)

    Homework Statement I started working on a C++ image median filter for fun... I'm supposed to read a 30x30 16-bit grayscale binary image and apply selection algorithm. 3x3 kernel. Please help output is messed up and i don't know where to start fixing it. Homework Equations using...
  5. A

    Algorithm for change-making problem

    Ok, so I found this article that presents an algorithm for deciding whether or not a set of coins allows for use of a greedy algorithm when making change: http://ecommons.cornell.edu/bitstream/1813/6219/1/94-1433.pdf But I'm not quite sure if I've understood it. The way I see it you do...
  6. P

    VHDL coding for IDEA Algorithm

    Hi all ... Does anyone knows how to implement IDEA algorithm in VHDL, especially the multiplier part(Low High Algorithm)? Kindly help me out in this
  7. D

    What is the Solution to the Extended Euclidean Algorithm Homework?

    Homework Statement There's a couple of questions that require the use of this, I'm having trouble with one of them, could anyone help? Homework Equations a) 520x - 1001y = 13 b) 520x - 1001y = -26 c) 520x - 1001y = 1The Attempt at a Solution The first two are easy to do, where you set 1001...
  8. Z

    Two Body problem using Verlet Algorithm Python

    Homework Statement Hi ! I'm trying to solve numerically two body problem using Verlet algorithm in Python. I wrote a code which looks like that : import numpy as np import scipy as sp rm=np.array([0.,0.]) r0=np.array([2.,0.]) p0=np.array([0.,0.1]) dt=0.001 m=0.1 G=0.01 M=500.0def r(dt)...
  9. M

    Deutsch's algorithm vs classical algorithm

    How the Deutsch's algorithm outperforms a classical algorithm? In both algorithms we need two particles (two bits and two qubits). In the quantum case the two qubits are processed by the FCNOT gate simultaneously but it's equivalent to two classical "black boxes". So if we take two classical...
  10. I

    Further Maths, D1 - Dijkstra's Algorithm

    Hi, I can do Dijkstra's Algorithm alright, but I always have problems with questions which have some relevance to the "Order of the Algorithm". For example, in the Further Maths, Decision 1 (OCR) textbook: 8) Suppose you purchase a new computer which is 100 times as fast as your old one...
  11. P

    Understand Grover's Algorithm: Classical Problem vs Quantum Solution

    Could anyone explain me how Grover's algorithm works. I read the article on wiki about it: http://en.wikipedia.org/wiki/Grover_algorithm" but I don't see any relation between classical problem of searching an element in unsorted database and its alledge quicker quantum solution. In classical...
  12. T

    Gauss elimination algorithm for matrix inversion

    Hello guys, I'm writing a C++ function for matrix inversion. I saw many algorithms online, but I'm concerned about the case when a diagonal element equals zero, which is, for some reason, not taken into account by those websites. When we do the elimination for solving a system of linear...
  13. T

    Fit with least squares, Levenberg–Marquardt algorithm

    Hello guys, I need your help with understanding a fitting Algorithm, so that I could make it in a C++ program. I have the following function: g(f; f0, phi0, a, b) = phi0 + a ArcTan((f-f0)/b) Which is a function of "f", frequency. I would like to fit this function with the...
  14. D

    Need help understanding U.S. Naval Observatory's messed up algorithm

    Hello! I'm trying to calculate the equation of time and the declination of the sun based on the U.S. Naval Observatory's algorithm: http://aa.usno.navy.mil/faq/docs/SunApprox.php" But not the U.S. Naval Obseravtory, or any of the astronomers I've tried to contact, has been eager to help me...
  15. B

    Line intersection algorithm optimization

    I am trying to heavily optimize a piece of code in C as well as MIPS assembly. Here is a link to my code: http://dl.dropbox.com/u/7264839/P1-3.c http://dl.dropbox.com/u/7264839/P1-4-1%20new.asm The problem is find the number of intersections between 1 pixel wide lines of different colors...
  16. A

    What is the Running Time of the Activity Selection Algorithm?

    Homework Statement Suppose I have n activicties and I want to join them as much as possible without time crash. We are provided the following algorithm. (1)Consider events in increasing order of finish time (2)Start with the first event on the sorted list (3)Include an event if it is...
  17. D

    Fast algorithm to find root of strictly decreasing function

    What is the fastest algorithm to find the closest root (such that the function value at that point is positive to an error but never negative, if not exactly zero) for a strictly decreasing function?
  18. A

    Greedy Algorithm: Homework Statement, Questions & Tutorials

    Homework Statement See photo 1 for question photo 2 for tutorial Homework Equations The Attempt at a Solution I have 2 questions 1. It seems the 2 methods in part(a) are not optimal. But I don't know if my counter examples are correct. If we use the (1) algorithm, that in my...
  19. B

    Efficient Algorithms for Counting Line Crossings on a Grid

    Hello, there's this problem about line crossings I saw somewhere and was trying to solve. There's a 64x64 grid of 8 bit pixels and it has a bunch of 1 pixel wide vertical and horizontal lines of different colors on it. All parallel lines have at least one space between them. The problem is...
  20. K

    Question on the Euclidean Algorithm

    Homework Statement Let a,b\in\mathbb{Z}. Suppose r_{0}=a and r_{1}=b. By the algorithm, r_{i}=0 for some i\geq 2 is the first remainder that terminates. Show that r_{i-1}=\gcd(a,b). Homework Equations The Attempt at a Solution I've shown that c|r_{i-1}, and I know that I should...
  21. F

    Is bases the same as basis ? (Simplex Algorithm)

    Homework Statement [PLAIN]http://img193.imageshack.us/img193/3662/unledmcg.png The Attempt at a Solution I rewrote the whole thing in dictionary x_3 = 15 - 8x_1 - 4x_2 x_4 = 7 - 2x_1 - 6x_2 z = 0 + 22x_1 - 12x_2 x_i \geq 0 1\leq i \leq 4 a) So my basis/bases is x...
  22. T

    Visual basic algorithm for computing hermite polynomials

    Please I need Visual Basic algorithm for computing Hermite polynomials. Any one with useful info? Thanks.
  23. J

    Question abou Patterson Algorithm

    Hi every one In the preliminaries section, the item c), there a proposition that say: "So by our choice of g we get "\theta/p | \psi/p" whence "\theta | \psi" ". I am not understanding this propositión, Please help me ...
  24. B

    Proof of the The Division Algorithm

    This is going to be kind of a long post, and I'm citing the author because it's directly from a textbook, but I'm assuming this proof is standard and I won't be doing anything unethical. I'm basically going to post it with my questions interrupting the text. I'm not sure how he got from some...
  25. O

    Iteration/Root finding algorithm

    Homework Statement The Attempt at a Solution I've managed to do part a), by factorising the cubic you get when you rearrange the terms. I'm mostly stumped for part b). I know the sequence has to be contractive, otherwise it wouldn't converge. Also, how do I show it's the only...
  26. A

    Simulation of Grover's Quantum Database Search Algorithm

    I have a basic understanding of Grover's algorithm, and I do know it searches through an unstructured database for some value. I recently downloaded the Quantum Processing Simulation (QPS), and after trying out the Grover simulator I became confused: through what database is it searching? It...
  27. T

    Levenberg-Marquardt Algorithm with Several Functions

    Hi there, I have been testing out the Levenberg-Marquardt algorithm. I've successfully coded a method in MATLAB for the example I saw on wikipedia: f(x) = a*cos(bx)+b*sin(ax) and this has worked well. The application I'm using the algorithm for is a system of 3 equations, however. Does...
  28. K

    Basic A* pathfinding algorithm question

    Just looking for some advice here.(This is the first time I'm doing anything like this so please bare with me) I have been given a project where we have a game and 4 agents (the other 3 agents are other computer science students) The idea is to program a good AI that can beat theirs. I am...
  29. L

    Mathematica Gillespie Algorithm (Monte Carlo Simulation) for simple process in Mathematica

    I am trying to model a simple birth and death process in Mathematica using the Gillespie Algorithm. I am using 1 DNA molecule that is transcribed to mRNA with rate k1, \mbox{DNA} \longrightarrow \mbox{DNA + RNA} and the transcribed RNA are subject to degradation with rate k2...
  30. P

    Analysis of the Binary Insertion Sort algorithm

    Good morning, I implemented the Binary Insertion Sort algorithm in C++, and now I want to analyse its time complexity. This is the Insertion Sort algorithm, but the linear search technique (which is used for locating the position in which to insert a particular integer) is replaced by a binary...
  31. P

    Analyzing the time complexity of an algorithm

    Homework Statement Analyze the worst-case time complexity of the following algorithm, which finds the first term of a sequence of integers equal to some previous term. procedure find (a1, a2, a3,..., an: integers) location := 0 i := 2 while i ≤ n and location = 0 begin j := 1 while j < i...
  32. D

    What are the pitfalls in implementing binary search?

    On the website http://stackoverflow.com/questions/504335/what-are-the-pitfalls-in-implementing-binary-search, it states that the Pascal code (note that in Pascal, the array indexing starts with 1) PROCEDURE BinarySearch (A : anArray, Size : anArraySize...
  33. L

    Euclide's Algorithm to Calculate GCD

    Homework Statement Using Euclid's algorithm write a program with a function that determines and returns the GCD of two integer arguments. This is what i wrote, when i print the remainder is zero, How can i get the last remaninder before the zero value? :confused: Thanks Homework...
  34. D

    Using the Insertion Sort algorithm on a linked list

    Homework Statement Hi there, I wish this wasn't my first post but unfortunately, it is. I will try to contribute later in the semester when my workload is less. On to the topic, the problem is I have to implement the insertion sort algorithm on a linked list. I have the algorithm for Java...
  35. S

    How can the Extended Euclidean Algorithm be simplified for faster computation?

    Hi all, ok so below is an example of the Extended Euclidean Algorithm, and i understand the first part perfectly to find the g.c.d. 701 − 2 × 322 = 57, 322 − 5 × 57 = 37, 57 − 37 = 20, 37 − 20 = 17, 20 − 17 = 3, 17 − 5 × 3 = 2, 3 − 2 = 1, and 1 = 3 − 2 = 6 × 3 − 17 = 6 × 20 − 7...
  36. W

    Is there a method for the simplex algorithm that avoids cycling?

    Homework Statement "There exists an implementation of the simplex algorithm that avoids cycling. (If your answer is `yes', describe the strategy; if your answer is `no' give an example and explain briefly why every strategy must fail.)" The Attempt at a Solution We normally do the...
  37. P

    How reason that an algorithm has n*logn time complexity?

    Some time ago I wrote an exam where I had to write a pseudocode to sort elemens in a list. I used a quicksort with the pivot in the middle and wrote that the algorithm has time complexity in best case O(n*logn) because it is a divide-and-conquer algorithm. That didn't satisfy my teacher and he...
  38. W

    Simplex algorithm - phase one - why do I need to use it here?

    Hello everyone, I hope I've posted in the right section! I have the following linear program. All I've done is added my slack variables (w) and made each constraint the subject, as you do. \mathrm{maximize} \ z=x_1+3x_2 \ w_1 = -3 + x_1 + x_2 \\ w_2 = -1 + x_1 - x_2 \\ w_3 = 4 - x_1 -2x_2...
  39. A

    Calculators Algorithm for Calculator application

    I need an algorithm for developing a calculator application. When I googled , I got results that perform the ordinary push and pop operations . I need the complete algorithm that can be useful to code a calculator application in GUI.
  40. N

    Find Largest & Second Largest Number Index in Array - Ask Algorithm

    a function: can give the index of the largest number in an array. also give the index of the second largest number, and the index of the third and the forth. such as a={1,2,3,5,7,99,121,3,2,24,10} the code can give the result followed: 6,5,9,10 how to make the function?
  41. S

    Using Reme's Algorithm to Find q2(x) for ex on [-1,1]

    Homework Statement Find q2(x) for f(x) = ex on [-1,1] using Reme's second algorithm. Homework Equations The Attempt at a Solution For the first iteration: Step a of the algorithm gives a0 = 0.989141, a1 = 1.130864, a2 = 0.553940 and E = 0.0443369. The question I am asking is how...
  42. B

    Master the Eigenvalue Algorithm for Math GRE Exams

    I'm taking the math subject GRE in just over a year's time... and I was wondering if there are "ideal" algorithms to have in our tool box to do a computation like this quickly. Obviously the type of matrices in a standardized exam are going to be fairly clean or look dirty but have some less...
  43. A

    Locating Pixels with Bresenham's line algorithm

    hi,I wanted to locate the pixels of a line drawn from (0,0) to (-4,-8) with bresenham's algorithm.I couldn't find a suitable algorithm for finding these pixel locations.Can anyone help me please?(the algorithm can be without computer and work by hand)
  44. A

    Locating Pixels with Bresenham's line algorithm

    hi,I wanted to locate the pixels of a line drawn from (0,0) to (-4,-8) with bresenham's algorithm.I couldn't find a suitable algorithm for finding these pixel locations.Can anyone help me please?(the algorithm can be without computer and work by hand)
  45. M

    Algorithm to solve a maximization problem

    I have two sets of vectors: A: a1, a2, a3... an B: b1, b2, b3... bm n > m and n/m is an integer, p. Each vector bi has ranked, in order of preference, a set of vectors from A. For example, b1 may "prefer" a1, a9, and a10. The only constraint on this set is that each vector ai from A appears...
  46. P

    Memory management-worst fit algorithm

    let us suppose we use the worst fit algorithm for allocating memory...initaially when whole of the memory is available...then it allocates full memory to one single process...hence no multiprogramming possible...hence what are the advantages of this algorithm...over first fit and best fit... Thanks
  47. timthereaper

    Help on Fitness Function for Genetic Algorithm

    Hey all, I'm trying to learn how to write genetic algorithms. I've constructed a kind of crude experiment just to see how the algorithm solves: An array of integers is my "genome". The "ideal genome" is an array of the first ten numbers of the Fibonacci sequence (1,1,2,3,5,8,13,21,34,55). I'm...
  48. R

    Restoring and non restoring division algorithm

    Can anyone please explain to me how and why do restoring and non restoring algorithms for division work and please provide me with a correct flowchart for the non restoring division.
  49. T

    Calculate the Depth of the recursive algorithm

    Homework Statement Hello to everybody I have this homework and my main issue is that is cannot find any bibliography to read that does what my homework requires. The problem goes like We have this recursive algorithm that calculates the sum of an array elements from array element k to array...
  50. K

    Algorithm definition generalisation / time-entaglement phenomennon

    Please let me mention certain idea here, although it is very vague. The general notion of algorithm is model of computation with finite number of steps which my be performed on device from "set of computational devices". Up to now "Set of Computational devices" consists of quantum and...
Back
Top